| 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..eaf44d0c5e83d6d5063bb69f88123d97fe8a6c95 100644
|
| --- a/gpu/command_buffer/client/gles2_implementation.cc
|
| +++ b/gpu/command_buffer/client/gles2_implementation.cc
|
| @@ -804,6 +804,10 @@ 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:
|
| + params[0] = capabilities_.max_viewport_width;
|
| + params[1] = capabilities_.max_viewport_height;
|
| + return true;
|
| case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
|
| *params = capabilities_.num_compressed_texture_formats;
|
| return true;
|
| @@ -847,6 +851,20 @@ 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) {
|
| + 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 +897,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 +931,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 +7046,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.
|
|
|