diff options
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.h | 6 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 17 |
2 files changed, 22 insertions, 1 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h index fec3de9..bfd0d32 100644 --- a/gpu/command_buffer/client/gles2_implementation.h +++ b/gpu/command_buffer/client/gles2_implementation.h @@ -28,6 +28,12 @@ class GLES2Implementation { void* transfer_buffer, int32 transfer_buffer_id); + // The GLES2CmdHelper being used by this GLES2Implementation. You can use + // this to issue cmds at a lower level for certain kinds of optimization. + GLES2CmdHelper* helper() const { + return helper_; + } + // Include the auto-generated part of this class. 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. diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index d6f2aba..b6a1414 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -921,7 +921,22 @@ parse_error::ParseError GLES2DecoderImpl::HandleVertexAttribPointer( parse_error::ParseError GLES2DecoderImpl::HandleReadPixels( uint32 immediate_data_size, const gles2::ReadPixels& c) { - // TODO(gman): Implement. + GLint x = c.x; + GLint y = c.y; + GLsizei width = c.width; + GLsizei height = c.height; + GLenum format = c.format; + GLenum type = c.type; + uint32 pixels_size = GLES2Util::ComputeImageDataSize( + width, height, format, type, pack_alignment_); + void* pixels = GetSharedMemoryAs<void*>( + c.pixels_shm_id, c.pixels_shm_offset, pixels_size); + parse_error::ParseError result = ValidateReadPixels( + this, immediate_data_size, x, y, width, height, format, type, pixels); + if (result != parse_error::kParseNoError) { + return result; + } + glReadPixels(x, y, width, height, format, type, pixels); return parse_error::kParseNoError; } |