| Index: gpu/command_buffer/client/gles2_implementation.cc | 
| diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc | 
| index 0f12cd4c93d2c81f807d469a9a670f165c6b5f50..82d2e9bd6e0a4694cff6a61d4d27b7b5ec9986c0 100644 | 
| --- a/gpu/command_buffer/client/gles2_implementation.cc | 
| +++ b/gpu/command_buffer/client/gles2_implementation.cc | 
| @@ -804,6 +804,15 @@ bool GLES2Implementation::GetHelper(GLenum pname, GLint* params) { | 
| case GL_MAX_VERTEX_UNIFORM_VECTORS: | 
| *params = capabilities_.max_vertex_uniform_vectors; | 
| return true; | 
| +    case GL_MAX_VIEWPORT_DIMS: | 
| +      if (capabilities_.max_viewport_width > 0 && | 
| +          capabilities_.max_viewport_height > 0) { | 
| +        params[0] = capabilities_.max_viewport_width; | 
| +        params[1] = capabilities_.max_viewport_height; | 
| +        return true; | 
| +      } | 
| +      // If they are not cached on the client side yet, query the service side. | 
| +      return false; | 
| case GL_NUM_COMPRESSED_TEXTURE_FORMATS: | 
| *params = capabilities_.num_compressed_texture_formats; | 
| return true; | 
| @@ -847,6 +856,23 @@ bool GLES2Implementation::GetHelper(GLenum pname, GLint* params) { | 
| *params = static_cast<GLint>(query_tracker_->CheckAndResetDisjoint()); | 
| return true; | 
|  | 
| +    case GL_VIEWPORT: | 
| +      if (state_.viewport_width > 0 && | 
| +          state_.viewport_height > 0 && | 
| +          capabilities_.max_viewport_width > 0 && | 
| +          capabilities_.max_viewport_height > 0) { | 
| +        params[0] = state_.viewport_x; | 
| +        params[1] = state_.viewport_y; | 
| +        params[2] = std::min(state_.viewport_width, | 
| +                             capabilities_.max_viewport_width); | 
| +        params[3] = std::min(state_.viewport_height, | 
| +                             capabilities_.max_viewport_height); | 
| +        return true; | 
| +      } | 
| +      // If they haven't been cached on the client side, go to service side | 
| +      // to query the underlying driver. | 
| +      return false; | 
| + | 
| // Non-cached parameters. | 
| case GL_ALIASED_LINE_WIDTH_RANGE: | 
| case GL_ALIASED_POINT_SIZE_RANGE: | 
| @@ -879,7 +905,6 @@ bool GLES2Implementation::GetHelper(GLenum pname, GLint* params) { | 
| case GL_IMPLEMENTATION_COLOR_READ_FORMAT: | 
| case GL_IMPLEMENTATION_COLOR_READ_TYPE: | 
| case GL_LINE_WIDTH: | 
| -    case GL_MAX_VIEWPORT_DIMS: | 
| case GL_PACK_ALIGNMENT: | 
| case GL_POLYGON_OFFSET_FACTOR: | 
| case GL_POLYGON_OFFSET_FILL: | 
| @@ -914,7 +939,6 @@ bool GLES2Implementation::GetHelper(GLenum pname, GLint* params) { | 
| case GL_STENCIL_WRITEMASK: | 
| case GL_SUBPIXEL_BITS: | 
| case GL_UNPACK_ALIGNMENT: | 
| -    case GL_VIEWPORT: | 
| return false; | 
| default: | 
| break; | 
| @@ -7030,6 +7054,22 @@ void GLES2Implementation::InvalidateCachedExtensions() { | 
| cached_extensions_.clear(); | 
| } | 
|  | 
| +void GLES2Implementation::Viewport(GLint x, | 
| +                                   GLint y, | 
| +                                   GLsizei width, | 
| +                                   GLsizei height) { | 
| +  GPU_CLIENT_SINGLE_THREAD_CHECK(); | 
| +  GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glViewport(" << x << ", " << y | 
| +                     << ", " << width << ", " << height << ")"); | 
| +  if (width < 0 || height < 0) { | 
| +    SetGLError(GL_INVALID_VALUE, "glViewport", "negative width/height"); | 
| +    return; | 
| +  } | 
| +  state_.SetViewport(x, y, width, height); | 
| +  helper_->Viewport(x, y, width, height); | 
| +  CheckGLError(); | 
| +} | 
| + | 
| // Include the auto-generated part of this file. We split this because it means | 
| // we can easily edit the non-auto generated parts right here in this file | 
| // instead of having to edit some template or the code generator. | 
|  |