summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc5
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc4
2 files changed, 8 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index edb0a7f..4a38f62 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -1646,9 +1646,12 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context,
// 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.
+ // mailing list archives. It also implicitly enables the desktop GL
+ // capability GL_POINT_SPRITE to provide access to the gl_PointCoord
+ // variable in fragment shaders.
if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) {
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
+ glEnable(GL_POINT_SPRITE);
}
if (use_shader_translator_) {
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 440440b..9f3f769 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc
@@ -85,6 +85,10 @@ void GLES2DecoderTestBase::InitDecoder(const char* extensions) {
.Times(1)
.RetiresOnSaturation();
+ EXPECT_CALL(*gl_, Enable(GL_POINT_SPRITE))
+ .Times(1)
+ .RetiresOnSaturation();
+
engine_.reset(new StrictMock<MockCommandBufferEngine>());
Buffer buffer = engine_->GetSharedMemoryBuffer(kSharedMemoryId);
shared_memory_offset_ = kSharedMemoryOffset;