Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 468024: Add glReadPixel service implemenation.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
===================================================================
--- gpu/command_buffer/service/gles2_cmd_decoder.cc (revision 33748)
+++ gpu/command_buffer/service/gles2_cmd_decoder.cc (working copy)
@@ -921,7 +921,22 @@
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;
}
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698