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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 #include <string> 6 #include <string>
7 #include <map> 7 #include <map>
8 #include <build/build_config.h> 8 #include <build/build_config.h>
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #define GLES2_GPU_SERVICE 1 10 #define GLES2_GPU_SERVICE 1
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 } 914 }
915 glVertexAttribPointer(indx, size, type, normalized, stride, ptr); 915 glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
916 } else { 916 } else {
917 SetGLError(GL_INVALID_VALUE); 917 SetGLError(GL_INVALID_VALUE);
918 } 918 }
919 return parse_error::kParseNoError; 919 return parse_error::kParseNoError;
920 } 920 }
921 921
922 parse_error::ParseError GLES2DecoderImpl::HandleReadPixels( 922 parse_error::ParseError GLES2DecoderImpl::HandleReadPixels(
923 uint32 immediate_data_size, const gles2::ReadPixels& c) { 923 uint32 immediate_data_size, const gles2::ReadPixels& c) {
924 // TODO(gman): Implement. 924 GLint x = c.x;
925 GLint y = c.y;
926 GLsizei width = c.width;
927 GLsizei height = c.height;
928 GLenum format = c.format;
929 GLenum type = c.type;
930 uint32 pixels_size = GLES2Util::ComputeImageDataSize(
931 width, height, format, type, pack_alignment_);
932 void* pixels = GetSharedMemoryAs<void*>(
933 c.pixels_shm_id, c.pixels_shm_offset, pixels_size);
934 parse_error::ParseError result = ValidateReadPixels(
935 this, immediate_data_size, x, y, width, height, format, type, pixels);
936 if (result != parse_error::kParseNoError) {
937 return result;
938 }
939 glReadPixels(x, y, width, height, format, type, pixels);
925 return parse_error::kParseNoError; 940 return parse_error::kParseNoError;
926 } 941 }
927 942
928 parse_error::ParseError GLES2DecoderImpl::HandlePixelStorei( 943 parse_error::ParseError GLES2DecoderImpl::HandlePixelStorei(
929 uint32 immediate_data_size, const gles2::PixelStorei& c) { 944 uint32 immediate_data_size, const gles2::PixelStorei& c) {
930 GLenum pname = c.pname; 945 GLenum pname = c.pname;
931 GLenum param = c.param; 946 GLenum param = c.param;
932 parse_error::ParseError result = 947 parse_error::ParseError result =
933 ValidatePixelStorei(this, immediate_data_size, pname, param); 948 ValidatePixelStorei(this, immediate_data_size, pname, param);
934 if (result != parse_error::kParseNoError) { 949 if (result != parse_error::kParseNoError) {
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 } 1242 }
1228 1243
1229 // Include the auto-generated part of this file. We split this because it means 1244 // Include the auto-generated part of this file. We split this because it means
1230 // we can easily edit the non-auto generated parts right here in this file 1245 // we can easily edit the non-auto generated parts right here in this file
1231 // instead of having to edit some template or the code generator. 1246 // instead of having to edit some template or the code generator.
1232 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 1247 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
1233 1248
1234 } // namespace gles2 1249 } // namespace gles2
1235 } // namespace command_buffer 1250 } // namespace command_buffer
1236 1251
OLDNEW
« 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