diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-25 23:31:41 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-25 23:31:41 +0000 |
commit | 295faf4b1bc7b1432441703b25a6595c7df7b35c (patch) | |
tree | 87935aa3b394d57a89a049821881897f8549bab2 /gpu | |
parent | 735873dcf6f73eb6a38a78f858733b827422802f (diff) | |
download | chromium_src-295faf4b1bc7b1432441703b25a6595c7df7b35c.zip chromium_src-295faf4b1bc7b1432441703b25a6595c7df7b35c.tar.gz chromium_src-295faf4b1bc7b1432441703b25a6595c7df7b35c.tar.bz2 |
Clear the backbuffer on initialization in GLES2DecoderImpl
TEST=unit tests
BUG=110352
Review URL: http://codereview.chromium.org/9195022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119140 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 3 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index eafb386..e45d183 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -2163,6 +2163,9 @@ bool GLES2DecoderImpl::Initialize( DoBindFramebuffer(GL_FRAMEBUFFER, 0); } + // Clear the backbuffer. + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + // OpenGL ES 2.0 implicitly enables the desktop GL capability // VERTEX_PROGRAM_POINT_SIZE and doesn't expose this enum. This fact // isn't well documented; it was discovered in the Khronos OpenGL ES 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 404e036..9ffef0b 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -151,6 +151,11 @@ void GLES2DecoderTestBase::InitDecoder( .WillOnce(SetArgumentPointee<1>(has_stencil ? 8 : 0)) .RetiresOnSaturation(); + EXPECT_CALL(*gl_, Clear( + GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)) + .Times(1) + .RetiresOnSaturation(); + EXPECT_CALL(*gl_, Enable(GL_VERTEX_PROGRAM_POINT_SIZE)) .Times(1) .RetiresOnSaturation(); |