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

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

Issue 2379203002: implement getBufferSubDataAsync prototype (Closed)
Patch Set: small clarification Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | third_party/WebKit/Source/modules/webgl/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
index a816afde06a61f6b5cee4255fd243948bffdd7f1..b88c2657ffaa876fe2359f4c532581034043df5f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
@@ -369,6 +369,39 @@ error::Error GLES2DecoderPassthroughImpl::HandleGetAttribLocation(
return error::kNoError;
}
+error::Error GLES2DecoderPassthroughImpl::HandleGetBufferSubDataAsyncCHROMIUM(
+ uint32_t immediate_data_size,
+ const volatile void* cmd_data) {
+ const volatile gles2::cmds::GetBufferSubDataAsyncCHROMIUM& c =
+ *static_cast<const volatile gles2::cmds::GetBufferSubDataAsyncCHROMIUM*>(
+ cmd_data);
+ GLenum target = static_cast<GLenum>(c.target);
+ GLintptr offset = static_cast<GLintptr>(c.offset);
+ GLsizeiptr size = static_cast<GLsizeiptr>(c.size);
+ uint32_t data_shm_id = static_cast<uint32_t>(c.data_shm_id);
+
+ int8_t* mem =
+ GetSharedMemoryAs<int8_t*>(data_shm_id, c.data_shm_offset, size);
+ if (!mem) {
+ return error::kOutOfBounds;
+ }
+
+ void* ptr = nullptr;
+ error::Error error =
+ DoMapBufferRange(target, offset, size, GL_MAP_READ_BIT, &ptr);
+ if (error != error::kNoError) {
+ return error;
+ }
+ memcpy(mem, ptr, size);
+ error = DoUnmapBuffer(target);
+ if (error != error::kNoError) {
+ return error;
+ }
+
+ return error::kNoError;
+}
+
+
error::Error GLES2DecoderPassthroughImpl::HandleGetFragDataLocation(
uint32_t immediate_data_size,
const volatile void* cmd_data) {
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | third_party/WebKit/Source/modules/webgl/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698