Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
index 914bc793bb8e30b4deb1cc48a31da8884eab0d86..a13340407324680248284a5bf8f9f842ca8b5003 100644 |
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
@@ -2693,9 +2693,10 @@ bool GLES2DecoderImpl::Initialize(const scoped_refptr<gfx::GLSurface>& surface, |
util_.set_num_compressed_texture_formats( |
validators_->compressed_texture_format.GetValues().size()); |
- if (gfx::GetGLImplementation() != gfx::kGLImplementationEGLGLES2) { |
- // We have to enable vertex array 0 on OpenGL or it won't render. Note that |
- // OpenGL ES 2.0 does not have this issue. |
+ if (!feature_info_->gl_version_info().BehavesLikeGLES()) { |
+ // We have to enable vertex array 0 on GL with compatibility profile or it |
+ // won't render. Note that ES or GL with core profile does not have this |
+ // issue. |
glEnableVertexAttribArray(0); |
} |
glGenBuffersARB(1, &attrib_0_buffer_id_); |
@@ -4931,8 +4932,7 @@ void GLES2DecoderImpl::DoBindSampler(GLuint unit, GLuint client_id) { |
void GLES2DecoderImpl::DoDisableVertexAttribArray(GLuint index) { |
if (state_.vertex_attrib_manager->Enable(index, false)) { |
- if (index != 0 || |
- gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) { |
+ if (index != 0 || feature_info_->gl_version_info().BehavesLikeGLES()) { |
glDisableVertexAttribArray(index); |
} |
} else { |
@@ -7860,11 +7860,10 @@ void GLES2DecoderImpl::RestoreStateForAttrib( |
GL_ARRAY_BUFFER, state_.bound_array_buffer.get() ? |
state_.bound_array_buffer->service_id() : 0); |
- // Never touch vertex attribute 0's state (in particular, never |
- // disable it) when running on desktop GL because it will never be |
- // re-enabled. |
- if (attrib_index != 0 || |
- gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) { |
+ // Never touch vertex attribute 0's state (in particular, never disable it) |
+ // when running on desktop GL with compatibility profile because it will |
+ // never be re-enabled. |
+ if (attrib_index != 0 || feature_info_->gl_version_info().BehavesLikeGLES()) { |
if (attrib->enabled()) { |
glEnableVertexAttribArray(attrib_index); |
} else { |
@@ -7878,7 +7877,7 @@ bool GLES2DecoderImpl::SimulateFixedAttribs( |
GLuint max_vertex_accessed, bool* simulated, GLsizei primcount) { |
DCHECK(simulated); |
*simulated = false; |
- if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) |
+ if (feature_info_->gl_version_info().BehavesLikeGLES()) |
return true; |
if (!state_.vertex_attrib_manager->HaveFixedAttribs()) { |