summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 13:37:34 +0000
committerzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 13:37:34 +0000
commit6883023c443ee07cc3ec2db24deefd680c5e6f5e (patch)
tree6c477521fbb0657f3a061f00e57bc5e98aac1f10 /gpu
parent09e4d281877939fa905dcb5a75b90b35be028c64 (diff)
downloadchromium_src-6883023c443ee07cc3ec2db24deefd680c5e6f5e.zip
chromium_src-6883023c443ee07cc3ec2db24deefd680c5e6f5e.tar.gz
chromium_src-6883023c443ee07cc3ec2db24deefd680c5e6f5e.tar.bz2
Revert 142931 - Set default GL state
This breaks almost all the webgl conformance tests and gl_tests on all gpu bots. TEST=unit tests BUG=130617 Review URL: https://chromiumcodereview.appspot.com/10573004 TBR=gman@chromium.org Review URL: https://chromiumcodereview.appspot.com/10581015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142946 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc39
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc111
2 files changed, 0 insertions, 150 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 7bc3b10..091b96b 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2263,45 +2263,6 @@ bool GLES2DecoderImpl::Initialize(
viewport_max_width_ = viewport_params[0];
viewport_max_height_ = viewport_params[1];
- // Set all the default state because some GL drivers get it wrong.
- glActiveTexture(GL_TEXTURE0 + active_texture_unit_);
- glLineWidth(1.0);
- EnableDisable(GL_BLEND, enable_blend_);
- glBlendColor(0.0f, 0.0, 0.0f, 0.0f);
- glBlendFunc(GL_ONE, GL_ZERO);
- glBlendEquation(GL_ADD);
- glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO);
- glClearColor(clear_red_, clear_green_, clear_blue_, clear_alpha_);
- glColorMask(mask_red_, mask_green_, mask_blue_, mask_alpha_);
- EnableDisable(GL_CULL_FACE, enable_cull_face_);
- glCullFace(GL_BACK);
- glClearDepth(clear_depth_);
- glDepthFunc(GL_LESS);
- glDepthRange(0.0f, 1.0f);
- EnableDisable(GL_DEPTH_TEST, enable_depth_test_);
- glEnable(GL_DITHER);
- glFrontFace(GL_CCW);
- glHint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE);
- glLineWidth(1.0f);
- glPixelStorei(GL_PACK_ALIGNMENT, pack_alignment_);
- glPolygonOffset(0.0f, 0.0f);
- glDisable(GL_POLYGON_OFFSET_FILL);
- glSampleCoverage(1.0, false);
- glScissor(viewport_x_, viewport_y_, viewport_width_, viewport_height_);
- EnableDisable(GL_SCISSOR_TEST, enable_scissor_test_);
- EnableDisable(GL_STENCIL_TEST, enable_stencil_test_);
- glClearStencil(clear_stencil_);
- glStencilFunc(GL_ALWAYS, 0, 0xFFFFFFFFU);
- glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
- glStencilMaskSeparate(GL_FRONT, mask_stencil_front_);
- glStencilMaskSeparate(GL_BACK, mask_stencil_back_);
- glPixelStorei(GL_UNPACK_ALIGNMENT, unpack_alignment_);
-
- DoBindBuffer(GL_ARRAY_BUFFER, 0);
- DoBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
- DoBindFramebuffer(GL_FRAMEBUFFER, 0);
- DoBindRenderbuffer(GL_RENDERBUFFER, 0);
-
return true;
}
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
index b942e9d..7de1375 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -190,117 +190,6 @@ void GLES2DecoderTestBase::InitDecoder(
max_viewport_dims, max_viewport_dims + arraysize(max_viewport_dims)))
.RetiresOnSaturation();
- EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, LineWidth(1.0))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, Disable(GL_BLEND))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, BlendColor(0.0f, 0.0, 0.0f, 0.0f))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, BlendFunc(GL_ONE, GL_ZERO))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, BlendEquation(GL_ADD))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, BlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, ClearColor(0.0f, 0.0, 0.0f, 0.0f))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, ColorMask(true, true, true, true))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, Disable(GL_CULL_FACE))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, CullFace(GL_BACK))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, ClearDepth(1.0f))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, DepthFunc(GL_LESS))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, DepthRange(0.0f, 1.0f))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, Disable(GL_DEPTH_TEST))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, Enable(GL_DITHER))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, FrontFace(GL_CCW))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, Hint(GL_GENERATE_MIPMAP_HINT, GL_DONT_CARE))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, LineWidth(1.0f))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, PixelStorei(GL_PACK_ALIGNMENT, 4))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, PolygonOffset(0.0f, 0.0f))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, Disable(GL_POLYGON_OFFSET_FILL))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, SampleCoverage(1.0, false))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, Scissor(
- kViewportX, kViewportY, kViewportWidth, kViewportHeight))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, Disable(GL_SCISSOR_TEST))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, Disable(GL_STENCIL_TEST))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, ClearStencil(0))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, StencilFunc(GL_ALWAYS, 0, 0xFFFFFFFFU))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, StencilOp(GL_KEEP, GL_KEEP, GL_KEEP))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, StencilMaskSeparate(GL_FRONT, 0xFFFFFFFFU))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, StencilMaskSeparate(GL_BACK, 0xFFFFFFFFU))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, PixelStorei(GL_UNPACK_ALIGNMENT, 4))
- .Times(1)
- .RetiresOnSaturation();
-
- EXPECT_CALL(*gl_, BindBuffer(GL_ARRAY_BUFFER, 0))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, BindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, 0))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*gl_, BindRenderbufferEXT(GL_RENDERBUFFER, 0))
- .Times(1)
- .RetiresOnSaturation();
-
engine_.reset(new StrictMock<MockCommandBufferEngine>());
Buffer buffer = engine_->GetSharedMemoryBuffer(kSharedMemoryId);
shared_memory_offset_ = kSharedMemoryOffset;