diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-07 21:03:04 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-07 21:03:04 +0000 |
commit | 76a0ee10dfe0a913f43c0da25bb23c3dcfe72812 (patch) | |
tree | 2a07dee62df7e7a729fc396d1f00762373b13cfb /gpu/command_buffer | |
parent | c3b76f1883d1f265204984e4d00a5cf18cd92e2f (diff) | |
download | chromium_src-76a0ee10dfe0a913f43c0da25bb23c3dcfe72812.zip chromium_src-76a0ee10dfe0a913f43c0da25bb23c3dcfe72812.tar.gz chromium_src-76a0ee10dfe0a913f43c0da25bb23c3dcfe72812.tar.bz2 |
Enable GL_VERTEX_PROGRAM_POINT_SIZE during initialization to match
OpenGL ES 2.0 semantics.
BUG=40172
TEST=ran Worlds of WebGL demo and verified point sprites change size
Review URL: http://codereview.chromium.org/1567027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43878 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r-- | gpu/command_buffer/service/gl_utils.h | 3 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 8 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc | 3 |
3 files changed, 14 insertions, 0 deletions
diff --git a/gpu/command_buffer/service/gl_utils.h b/gpu/command_buffer/service/gl_utils.h index 432dfb4..943681c 100644 --- a/gpu/command_buffer/service/gl_utils.h +++ b/gpu/command_buffer/service/gl_utils.h @@ -12,6 +12,9 @@ #if defined(UNIT_TEST) #include "gpu/command_buffer/service/gl_mock.h" + #if !defined(GL_VERTEX_PROGRAM_POINT_SIZE) + #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 + #endif #else #if defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2) #include <GLES2/gl2.h> // NOLINT diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 63e267d..32308a5 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -1278,6 +1278,14 @@ bool GLES2DecoderImpl::Initialize(GLES2Decoder* parent, DoBindFramebuffer(GL_FRAMEBUFFER, 0); } +#if !defined(GLES2_GPU_SERVICE_BACKEND_NATIVE_GLES2) + // 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 + // mailing list archives. + glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); +#endif + 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 2e78278..63a4bd5 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -83,6 +83,9 @@ void GLES2DecoderTestBase::SetUp() { EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_CUBE_MAP, 0)) .Times(1) .RetiresOnSaturation(); + EXPECT_CALL(*gl_, Enable(GL_VERTEX_PROGRAM_POINT_SIZE)) + .Times(1) + .RetiresOnSaturation(); engine_.reset(new StrictMock<MockCommandBufferEngine>()); Buffer buffer = engine_->GetSharedMemoryBuffer(kSharedMemoryId); |