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

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

Issue 2849743002: Allow binding multiple textures to one DC Layer overlay. (Closed)
Patch Set: put texture id array in ScheduleDCLayer 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 side-by-side diff with in-line comments
Download patch
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 50e2cbfde3ae94b92d6e7f21fa4c578d7ff52216..2c0a0b77f9f86d1d14d39b077429fa31eb068411 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers.cc
@@ -1811,19 +1811,26 @@ error::Error GLES2DecoderPassthroughImpl::HandleScheduleDCLayerCHROMIUM(
const volatile gles2::cmds::ScheduleDCLayerCHROMIUM& c =
*static_cast<const volatile gles2::cmds::ScheduleDCLayerCHROMIUM*>(
cmd_data);
- const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset,
- 8 * sizeof(GLfloat));
+ unsigned int size;
+ const GLfloat* mem = GetSharedMemoryAndSizeAs<const GLfloat*>(
+ c.shm_id, c.shm_offset, 8 * sizeof(GLfloat), &size);
if (!mem) {
return error::kOutOfBounds;
}
- GLuint contents_texture_id = static_cast<GLint>(c.contents_texture_id);
+ const GLsizei num_textures = c.num_textures;
+ if (num_textures < 0 || (size - 8 * sizeof(GLfloat)) / sizeof(GLuint) <
+ static_cast<GLuint>(num_textures)) {
+ return error::kOutOfBounds;
+ }
+ const volatile GLuint* contents_texture_ids =
+ reinterpret_cast<const volatile GLuint*>(mem + 8);
const GLfloat* contents_rect = mem;
GLuint background_color = static_cast<GLuint>(c.background_color);
GLuint edge_aa_mask = static_cast<GLuint>(c.edge_aa_mask);
const GLfloat* bounds_rect = mem + 4;
- error::Error error =
- DoScheduleDCLayerCHROMIUM(contents_texture_id, contents_rect,
- background_color, edge_aa_mask, bounds_rect);
+ error::Error error = DoScheduleDCLayerCHROMIUM(
+ num_textures, contents_texture_ids, contents_rect, background_color,
+ edge_aa_mask, bounds_rect);
if (error != error::kNoError) {
return error;
}
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc ('k') | gpu/ipc/service/direct_composition_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698