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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc

Issue 2822513002: Let DoMapBufferRange write the result integer to signal a GL error. (Closed)
Patch Set: Created 3 years, 8 months 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc ('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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h"
6 6
7 namespace gpu { 7 namespace gpu {
8 namespace gles2 { 8 namespace gles2 {
9 9
10 // Custom Handlers 10 // Custom Handlers
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 if (*result != 0) { 1315 if (*result != 0) {
1316 *result = 0; 1316 *result = 0;
1317 return error::kInvalidArguments; 1317 return error::kInvalidArguments;
1318 } 1318 }
1319 uint8_t* mem = 1319 uint8_t* mem =
1320 GetSharedMemoryAs<uint8_t*>(c.data_shm_id, c.data_shm_offset, size); 1320 GetSharedMemoryAs<uint8_t*>(c.data_shm_id, c.data_shm_offset, size);
1321 if (!mem) { 1321 if (!mem) {
1322 return error::kOutOfBounds; 1322 return error::kOutOfBounds;
1323 } 1323 }
1324 1324
1325 error::Error error = DoMapBufferRange(target, offset, size, access, mem, 1325 error::Error error =
1326 c.data_shm_id, c.data_shm_offset); 1326 DoMapBufferRange(target, offset, size, access, mem, c.data_shm_id,
1327 c.data_shm_offset, result);
1327 if (error != error::kNoError) { 1328 if (error != error::kNoError) {
1329 DCHECK(*result == 0);
1328 return error; 1330 return error;
1329 } 1331 }
1330 1332
1331 *result = 1;
1332 return error::kNoError; 1333 return error::kNoError;
1333 } 1334 }
1334 1335
1335 error::Error GLES2DecoderPassthroughImpl::HandleUnmapBuffer( 1336 error::Error GLES2DecoderPassthroughImpl::HandleUnmapBuffer(
1336 uint32_t immediate_data_size, 1337 uint32_t immediate_data_size,
1337 const volatile void* cmd_data) { 1338 const volatile void* cmd_data) {
1338 const volatile gles2::cmds::UnmapBuffer& c = 1339 const volatile gles2::cmds::UnmapBuffer& c =
1339 *static_cast<const volatile gles2::cmds::UnmapBuffer*>(cmd_data); 1340 *static_cast<const volatile gles2::cmds::UnmapBuffer*>(cmd_data);
1340 GLenum target = static_cast<GLenum>(c.target); 1341 GLenum target = static_cast<GLenum>(c.target);
1341 error::Error error = DoUnmapBuffer(target); 1342 error::Error error = DoUnmapBuffer(target);
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
2669 // TODO(geofflang): Handle PIXEL_UNPACK_BUFFER case. 2670 // TODO(geofflang): Handle PIXEL_UNPACK_BUFFER case.
2670 const void* data = GetSharedMemoryAs<const void*>( 2671 const void* data = GetSharedMemoryAs<const void*>(
2671 c.data_shm_id, c.data_shm_offset, image_size); 2672 c.data_shm_id, c.data_shm_offset, image_size);
2672 return DoCompressedTexSubImage3D( 2673 return DoCompressedTexSubImage3D(
2673 target, level, xoffset, yoffset, zoffset, width, height, depth, 2674 target, level, xoffset, yoffset, zoffset, width, height, depth,
2674 format, image_size, data); 2675 format, image_size, data);
2675 } 2676 }
2676 2677
2677 } // namespace gles2 2678 } // namespace gles2
2678 } // namespace gpu 2679 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698