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

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

Issue 1409193007: gpu: Add CHROMIUM_schedule_ca_layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 5 years, 1 month 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/common/gles2_cmd_ids_autogen.h ('k') | mojo/gpu/mojo_gles2_impl_autogen.h » ('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.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index f25c65f0e1b42467433f4cc6e909577d710b9334..41a78d20a00a1d3abdfd06af8ceee78492902f04 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -61,6 +61,7 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/overlay_transform.h"
+#include "ui/gfx/transform.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_fence.h"
@@ -9410,6 +9411,48 @@ error::Error GLES2DecoderImpl::HandleScheduleOverlayPlaneCHROMIUM(
return error::kNoError;
}
+error::Error GLES2DecoderImpl::HandleScheduleCALayerCHROMIUM(
+ uint32 immediate_data_size,
+ const void* cmd_data) {
+ const gles2::cmds::ScheduleCALayerCHROMIUM& c =
+ *static_cast<const gles2::cmds::ScheduleCALayerCHROMIUM*>(cmd_data);
+ gl::GLImage* image = nullptr;
+ if (c.contents_texture_id) {
+ TextureRef* ref = texture_manager()->GetTexture(c.contents_texture_id);
+ if (!ref) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glScheduleCALayerCHROMIUM",
+ "unknown texture");
+ return error::kNoError;
+ }
+ Texture::ImageState image_state;
+ image = ref->texture()->GetLevelImage(ref->texture()->target(), 0,
+ &image_state);
+ if (!image || image_state != Texture::BOUND) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glScheduleCALayerCHROMIUM",
+ "unsupported texture format");
+ return error::kNoError;
+ }
+ }
+
+ const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset,
+ 22 * sizeof(GLfloat));
+ if (!mem) {
+ return error::kOutOfBounds;
+ }
+ gfx::RectF contents_rect(mem[0], mem[1], mem[2], mem[3]);
+ gfx::SizeF bounds_size(mem[4], mem[5]);
+ gfx::Transform transform(mem[6], mem[10], mem[14], mem[18],
+ mem[7], mem[11], mem[15], mem[19],
+ mem[8], mem[12], mem[16], mem[20],
+ mem[9], mem[13], mem[17], mem[21]);
+ if (!surface_->ScheduleCALayer(image, contents_rect, c.opacity,
+ c.background_color, bounds_size, transform)) {
+ LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM",
+ "failed to schedule CALayer");
+ }
+ return error::kNoError;
+}
+
error::Error GLES2DecoderImpl::GetAttribLocationHelper(
GLuint client_id, uint32 location_shm_id, uint32 location_shm_offset,
const std::string& name_str) {
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_ids_autogen.h ('k') | mojo/gpu/mojo_gles2_impl_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698