diff options
25 files changed, 231 insertions, 68 deletions
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index f0ea96c..32d1542 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -3542,15 +3542,22 @@ void GLRenderer::ScheduleCALayers(DrawingFrame* frame) { ca_layer_overlay.contents_rect.width(), ca_layer_overlay.contents_rect.height(), }; - GLfloat bounds_size[2] = { - ca_layer_overlay.bounds_size.width(), + GLuint edge_aa_mask = 0; + GLfloat bounds_rect[4] = { + 0, 0, ca_layer_overlay.bounds_size.width(), ca_layer_overlay.bounds_size.height(), }; + GLboolean is_clipped = GL_FALSE; + GLfloat clip_rect[4] = { + 0, 0, 0, 0, + }; + GLint sorting_context_id = 0; GLfloat transform[16]; ca_layer_overlay.transform.asColMajorf(transform); gl_->ScheduleCALayerCHROMIUM( texture_id, contents_rect, ca_layer_overlay.opacity, - ca_layer_overlay.background_color, bounds_size, transform); + ca_layer_overlay.background_color, edge_aa_mask, bounds_rect, + is_clipped, clip_rect, sorting_context_id, transform); } } diff --git a/content/common/gpu/image_transport_surface_overlay_mac.h b/content/common/gpu/image_transport_surface_overlay_mac.h index a84df2a..66ce211 100644 --- a/content/common/gpu/image_transport_surface_overlay_mac.h +++ b/content/common/gpu/image_transport_surface_overlay_mac.h @@ -52,7 +52,10 @@ class ImageTransportSurfaceOverlayMac : public gfx::GLSurface, const gfx::RectF& contents_rect, float opacity, unsigned background_color, - const gfx::SizeF& bounds_size, + unsigned edge_aa_mask, + const gfx::RectF& bounds_rect, + bool is_clipped, + const gfx::RectF& clip_rect, const gfx::Transform& transform) override; bool IsSurfaceless() const override; diff --git a/content/common/gpu/image_transport_surface_overlay_mac.mm b/content/common/gpu/image_transport_surface_overlay_mac.mm index 40d0df5..9b31d4e 100644 --- a/content/common/gpu/image_transport_surface_overlay_mac.mm +++ b/content/common/gpu/image_transport_surface_overlay_mac.mm @@ -760,7 +760,10 @@ bool ImageTransportSurfaceOverlayMac::ScheduleCALayer( const gfx::RectF& contents_rect, float opacity, unsigned background_color, - const gfx::SizeF& bounds_size, + unsigned edge_aa_mask, + const gfx::RectF& bounds_rect, + bool is_clipped, + const gfx::RectF& clip_rect, const gfx::Transform& transform) { // Extract the IOSurface, if this layer is not just a solid color. int io_surface_id = 0; @@ -784,7 +787,7 @@ bool ImageTransportSurfaceOverlayMac::ScheduleCALayer( pending_overlay_planes_.push_back(OverlayPlane::CreateWithTransform( next_ca_layer_z_order_++, io_surface_id, io_surface, contents_rect, - opacity, srgb_background_color, bounds_size, transform)); + opacity, srgb_background_color, bounds_rect.size(), transform)); return true; } diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_schedule_ca_layer.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_schedule_ca_layer.txt index f5949b9..0475c66 100644 --- a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_schedule_ca_layer.txt +++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_schedule_ca_layer.txt @@ -8,7 +8,7 @@ Name Strings Version - Last Modified Date: November 7, 2015 + Last Modified Date: December 16, 2015 Dependencies @@ -29,7 +29,11 @@ Issues New Tokens - None + Accepted by the <edge_aa_mask> parameter of glScheduleCALayerCHROMIUM: + GL_CA_LAYER_EDGE_LEFT_CHROMIUM 0x01 + GL_CA_LAYER_EDGE_RIGHT_CHROMIUM 0x02 + GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM 0x04 + GL_CA_LAYER_EDGE_TOP_CHROMIUM 0x08 New Procedures and Functions @@ -39,7 +43,10 @@ New Procedures and Functions const GLfloat* contents_rect, GLfloat opacity, GLuint background_color, - const GLfloat* bounds_size, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, const GLfloat* transform); Set the CALayer parameters to be presented at the time of the next call to @@ -53,8 +60,13 @@ New Procedures and Functions <opacity> specifies the opacity of the CALayer. <background_color> specifies the background color of the CALayer, as a 32-bit ARGB value. - <bounds_size> contains two values indicating the width and height of the - layer in pixels. + <edge_aa_mask> is a bitfield specifying which of the edges of the layer are + to have anti-aliasing. + <bounds_rect> contains four values indicating the x, y, width, and height of + the layer in pixels. + <is_clipped> indicates if the layer should be clipped. + <clip_rect> contains four values indicating the x, y, width, and height of + the rectangle to clip the layer to, if it is to be clipped. <transform> contains sixteen values indicating the row major order 4x4 transformation matrix to apply to the CALayer. @@ -65,3 +77,9 @@ Errors New State None. + +Revision History + + 12/16/2015 Add clipping and edge anti-aliasing. + 11/7/2015 Initial checkin + diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h index 51af9dc..201d529 100644 --- a/gpu/GLES2/gl2extchromium.h +++ b/gpu/GLES2/gl2extchromium.h @@ -809,13 +809,34 @@ typedef void(GL_APIENTRYP PFNGLSCHEDULEOVERLAYPLANECHROMIUMPROC)( #ifndef GL_CHROMIUM_schedule_ca_layer #define GL_CHROMIUM_schedule_ca_layer 1 + +#ifndef GL_CA_LAYER_EDGE_LEFT_CHROMIUM +#define GL_CA_LAYER_EDGE_LEFT_CHROMIUM 0x1 +#endif + +#ifndef GL_CA_LAYER_EDGE_RIGHT_CHROMIUM +#define GL_CA_LAYER_EDGE_RIGHT_CHROMIUM 0x2 +#endif + +#ifndef GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM +#define GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM 0x4 +#endif + +#ifndef GL_CA_LAYER_EDGE_TOP_CHROMIUM +#define GL_CA_LAYER_EDGE_TOP_CHROMIUM 0x8 +#endif + #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glScheduleCALayerCHROMIUM(GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, GLuint background_color, - const GLfloat* bounds_size, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform); #endif typedef void(GL_APIENTRYP PFNGLSCHEDULECALAYERCHROMIUMPROC)( @@ -823,7 +844,11 @@ typedef void(GL_APIENTRYP PFNGLSCHEDULECALAYERCHROMIUMPROC)( const GLfloat* contents_rect, GLfloat opacity, GLuint background_color, - const GLfloat* bounds_size, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform); #endif /* GL_CHROMIUM_schedule_ca_layer */ diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 41f7188..1cab6c8 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -4312,7 +4312,9 @@ _FUNCTION_INFO = { 'impl_func': False, 'client_test': False, 'cmd_args': 'GLuint contents_texture_id, GLfloat opacity, ' - 'GLuint background_color, GLuint shm_id, GLuint shm_offset', + 'GLuint background_color, GLuint edge_aa_mask, ' + 'GLboolean is_clipped, GLint sorting_context_id, ' + 'GLuint shm_id, GLuint shm_offset', 'extension': 'CHROMIUM_schedule_ca_layer', 'chromium': True, }, diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h index b8b4bd9..35f57ec 100644 --- a/gpu/command_buffer/client/gles2_c_lib_autogen.h +++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h @@ -1521,12 +1521,17 @@ void GL_APIENTRY GLES2ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order, void GL_APIENTRY GLES2ScheduleCALayerCHROMIUM(GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, - const GLuint background_color, - const GLfloat* bounds_size, + GLuint background_color, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform) { gles2::GetGLContext()->ScheduleCALayerCHROMIUM( contents_texture_id, contents_rect, opacity, background_color, - bounds_size, transform); + edge_aa_mask, bounds_rect, is_clipped, clip_rect, sorting_context_id, + transform); } void GL_APIENTRY GLES2CommitOverlayPlanesCHROMIUM() { gles2::GetGLContext()->CommitOverlayPlanesCHROMIUM(); diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h index e9043d1..605db93 100644 --- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h +++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h @@ -2846,12 +2846,16 @@ void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order, void ScheduleCALayerCHROMIUM(GLuint contents_texture_id, GLfloat opacity, GLuint background_color, + GLuint edge_aa_mask, + GLboolean is_clipped, + GLint sorting_context_id, GLuint shm_id, GLuint shm_offset) { gles2::cmds::ScheduleCALayerCHROMIUM* c = GetCmdSpace<gles2::cmds::ScheduleCALayerCHROMIUM>(); if (c) { - c->Init(contents_texture_id, opacity, background_color, shm_id, shm_offset); + c->Init(contents_texture_id, opacity, background_color, edge_aa_mask, + is_clipped, sorting_context_id, shm_id, shm_offset); } } diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index d5a05e9..6e7695e 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -4438,9 +4438,13 @@ void GLES2Implementation::ScheduleCALayerCHROMIUM(GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, GLuint background_color, - const GLfloat* bounds_size, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform) { - size_t shm_size = 22 * sizeof(GLfloat); + size_t shm_size = 28 * sizeof(GLfloat); ScopedTransferBufferPtr buffer(shm_size, helper_, transfer_buffer_); if (!buffer.valid() || buffer.size() < shm_size) { SetGLError(GL_OUT_OF_MEMORY, "GLES2::ScheduleCALayerCHROMIUM", @@ -4449,10 +4453,12 @@ void GLES2Implementation::ScheduleCALayerCHROMIUM(GLuint contents_texture_id, } GLfloat* mem = static_cast<GLfloat*>(buffer.address()); memcpy(mem + 0, contents_rect, 4 * sizeof(GLfloat)); - memcpy(mem + 4, bounds_size, 2 * sizeof(GLfloat)); - memcpy(mem + 6, transform, 16 * sizeof(GLfloat)); + memcpy(mem + 4, bounds_rect, 4 * sizeof(GLfloat)); + memcpy(mem + 8, clip_rect, 4 * sizeof(GLfloat)); + memcpy(mem + 12, transform, 16 * sizeof(GLfloat)); helper_->ScheduleCALayerCHROMIUM(contents_texture_id, opacity, - background_color, buffer.shm_id(), + background_color, edge_aa_mask, is_clipped, + sorting_context_id, buffer.shm_id(), buffer.offset()); } diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index eb1b63c..2e6c771 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h @@ -1058,8 +1058,12 @@ void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order, void ScheduleCALayerCHROMIUM(GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, - const GLuint background_color, - const GLfloat* bounds_size, + GLuint background_color, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform) override; void CommitOverlayPlanesCHROMIUM() override; diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h index 382a371..23b628b 100644 --- a/gpu/command_buffer/client/gles2_interface_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_autogen.h @@ -784,8 +784,12 @@ virtual void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order, virtual void ScheduleCALayerCHROMIUM(GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, - const GLuint background_color, - const GLfloat* bounds_size, + GLuint background_color, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform) = 0; virtual void CommitOverlayPlanesCHROMIUM() = 0; virtual void SwapInterval(GLint interval) = 0; diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h index 1bfac6a..8cc06fb 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h @@ -762,8 +762,12 @@ void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order, void ScheduleCALayerCHROMIUM(GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, - const GLuint background_color, - const GLfloat* bounds_size, + GLuint background_color, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform) override; void CommitOverlayPlanesCHROMIUM() override; void SwapInterval(GLint interval) override; diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h index 1bf1512..af5353b 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h @@ -1040,8 +1040,12 @@ void GLES2InterfaceStub::ScheduleCALayerCHROMIUM( GLuint /* contents_texture_id */, const GLfloat* /* contents_rect */, GLfloat /* opacity */, - const GLuint /* background_color */, - const GLfloat* /* bounds_size */, + GLuint /* background_color */, + GLuint /* edge_aa_mask */, + const GLfloat* /* bounds_rect */, + GLboolean /* is_clipped */, + const GLfloat* /* clip_rect */, + GLint /* sorting_context_id */, const GLfloat* /* transform */) {} void GLES2InterfaceStub::CommitOverlayPlanesCHROMIUM() {} void GLES2InterfaceStub::SwapInterval(GLint /* interval */) {} diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h index 9206943..ef07e9d 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h @@ -762,8 +762,12 @@ void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order, void ScheduleCALayerCHROMIUM(GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, - const GLuint background_color, - const GLfloat* bounds_size, + GLuint background_color, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform) override; void CommitOverlayPlanesCHROMIUM() override; void SwapInterval(GLint interval) override; diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h index c8dea68..3674646 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h @@ -2219,12 +2219,18 @@ void GLES2TraceImplementation::ScheduleCALayerCHROMIUM( GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, - const GLuint background_color, - const GLfloat* bounds_size, + GLuint background_color, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform) { TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::ScheduleCALayerCHROMIUM"); gl_->ScheduleCALayerCHROMIUM(contents_texture_id, contents_rect, opacity, - background_color, bounds_size, transform); + background_color, edge_aa_mask, bounds_rect, + is_clipped, clip_rect, sorting_context_id, + transform); } void GLES2TraceImplementation::CommitOverlayPlanesCHROMIUM() { diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt index ba5336a..fa982dd 100644 --- a/gpu/command_buffer/cmd_buffer_functions.txt +++ b/gpu/command_buffer/cmd_buffer_functions.txt @@ -314,7 +314,7 @@ GL_APICALL void GL_APIENTRY glWaitSyncTokenCHROMIUM (const GLbyte* sync_ GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei count, const GLenum* bufs); GL_APICALL void GL_APIENTRY glDiscardBackbufferCHROMIUM (void); GL_APICALL void GL_APIENTRY glScheduleOverlayPlaneCHROMIUM (GLint plane_z_order, GLenum plane_transform, GLuint overlay_texture_id, GLint bounds_x, GLint bounds_y, GLint bounds_width, GLint bounds_height, GLfloat uv_x, GLfloat uv_y, GLfloat uv_width, GLfloat uv_height); -GL_APICALL void GL_APIENTRY glScheduleCALayerCHROMIUM (GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, const GLuint background_color, const GLfloat* bounds_size, const GLfloat* transform); +GL_APICALL void GL_APIENTRY glScheduleCALayerCHROMIUM (GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, GLuint background_color, GLuint edge_aa_mask, const GLfloat* bounds_rect, GLboolean is_clipped, const GLfloat* clip_rect, GLint sorting_context_id, const GLfloat* transform); GL_APICALL void GL_APIENTRY glCommitOverlayPlanesCHROMIUM (void); GL_APICALL void GL_APIENTRY glSwapInterval (GLint interval); GL_APICALL void GL_APIENTRY glFlushDriverCachesCHROMIUM (void); diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index d866081..9b1a225 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h @@ -13925,12 +13925,18 @@ struct ScheduleCALayerCHROMIUM { void Init(GLuint _contents_texture_id, GLfloat _opacity, GLuint _background_color, + GLuint _edge_aa_mask, + GLboolean _is_clipped, + GLint _sorting_context_id, GLuint _shm_id, GLuint _shm_offset) { SetHeader(); contents_texture_id = _contents_texture_id; opacity = _opacity; background_color = _background_color; + edge_aa_mask = _edge_aa_mask; + is_clipped = _is_clipped; + sorting_context_id = _sorting_context_id; shm_id = _shm_id; shm_offset = _shm_offset; } @@ -13939,10 +13945,14 @@ struct ScheduleCALayerCHROMIUM { GLuint _contents_texture_id, GLfloat _opacity, GLuint _background_color, + GLuint _edge_aa_mask, + GLboolean _is_clipped, + GLint _sorting_context_id, GLuint _shm_id, GLuint _shm_offset) { - static_cast<ValueType*>(cmd)->Init(_contents_texture_id, _opacity, - _background_color, _shm_id, _shm_offset); + static_cast<ValueType*>(cmd) + ->Init(_contents_texture_id, _opacity, _background_color, _edge_aa_mask, + _is_clipped, _sorting_context_id, _shm_id, _shm_offset); return NextCmdAddress<ValueType>(cmd); } @@ -13950,12 +13960,15 @@ struct ScheduleCALayerCHROMIUM { uint32_t contents_texture_id; float opacity; uint32_t background_color; + uint32_t edge_aa_mask; + uint32_t is_clipped; + int32_t sorting_context_id; uint32_t shm_id; uint32_t shm_offset; }; -static_assert(sizeof(ScheduleCALayerCHROMIUM) == 24, - "size of ScheduleCALayerCHROMIUM should be 24"); +static_assert(sizeof(ScheduleCALayerCHROMIUM) == 36, + "size of ScheduleCALayerCHROMIUM should be 36"); static_assert(offsetof(ScheduleCALayerCHROMIUM, header) == 0, "offset of ScheduleCALayerCHROMIUM header should be 0"); static_assert( @@ -13966,10 +13979,17 @@ static_assert(offsetof(ScheduleCALayerCHROMIUM, opacity) == 8, static_assert( offsetof(ScheduleCALayerCHROMIUM, background_color) == 12, "offset of ScheduleCALayerCHROMIUM background_color should be 12"); -static_assert(offsetof(ScheduleCALayerCHROMIUM, shm_id) == 16, - "offset of ScheduleCALayerCHROMIUM shm_id should be 16"); -static_assert(offsetof(ScheduleCALayerCHROMIUM, shm_offset) == 20, - "offset of ScheduleCALayerCHROMIUM shm_offset should be 20"); +static_assert(offsetof(ScheduleCALayerCHROMIUM, edge_aa_mask) == 16, + "offset of ScheduleCALayerCHROMIUM edge_aa_mask should be 16"); +static_assert(offsetof(ScheduleCALayerCHROMIUM, is_clipped) == 20, + "offset of ScheduleCALayerCHROMIUM is_clipped should be 20"); +static_assert( + offsetof(ScheduleCALayerCHROMIUM, sorting_context_id) == 24, + "offset of ScheduleCALayerCHROMIUM sorting_context_id should be 24"); +static_assert(offsetof(ScheduleCALayerCHROMIUM, shm_id) == 28, + "offset of ScheduleCALayerCHROMIUM shm_id should be 28"); +static_assert(offsetof(ScheduleCALayerCHROMIUM, shm_offset) == 32, + "offset of ScheduleCALayerCHROMIUM shm_offset should be 32"); struct CommitOverlayPlanesCHROMIUM { typedef CommitOverlayPlanesCHROMIUM ValueType; diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h index 3428ea4..01847c9 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h @@ -4812,17 +4812,22 @@ TEST_F(GLES2FormatTest, ScheduleOverlayPlaneCHROMIUM) { TEST_F(GLES2FormatTest, ScheduleCALayerCHROMIUM) { cmds::ScheduleCALayerCHROMIUM& cmd = *GetBufferAs<cmds::ScheduleCALayerCHROMIUM>(); - void* next_cmd = cmd.Set(&cmd, static_cast<GLuint>(11), - static_cast<GLfloat>(12), static_cast<GLuint>(13), - static_cast<GLuint>(14), static_cast<GLuint>(15)); + void* next_cmd = + cmd.Set(&cmd, static_cast<GLuint>(11), static_cast<GLfloat>(12), + static_cast<GLuint>(13), static_cast<GLuint>(14), + static_cast<GLboolean>(15), static_cast<GLint>(16), + static_cast<GLuint>(17), static_cast<GLuint>(18)); EXPECT_EQ(static_cast<uint32_t>(cmds::ScheduleCALayerCHROMIUM::kCmdId), cmd.header.command); EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); EXPECT_EQ(static_cast<GLuint>(11), cmd.contents_texture_id); EXPECT_EQ(static_cast<GLfloat>(12), cmd.opacity); EXPECT_EQ(static_cast<GLuint>(13), cmd.background_color); - EXPECT_EQ(static_cast<GLuint>(14), cmd.shm_id); - EXPECT_EQ(static_cast<GLuint>(15), cmd.shm_offset); + EXPECT_EQ(static_cast<GLuint>(14), cmd.edge_aa_mask); + EXPECT_EQ(static_cast<GLboolean>(15), cmd.is_clipped); + EXPECT_EQ(static_cast<GLint>(16), cmd.sorting_context_id); + EXPECT_EQ(static_cast<GLuint>(17), cmd.shm_id); + EXPECT_EQ(static_cast<GLuint>(18), cmd.shm_offset); CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); } diff --git a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h index af31a51..622f75d 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h @@ -409,6 +409,9 @@ static const GLES2Util::EnumToString enum_to_string_table[] = { 0x0DE1, "GL_TEXTURE_2D", }, { + 0x1, "GL_CA_LAYER_EDGE_LEFT_CHROMIUM", + }, + { 0x10000000, "GL_MULTISAMPLE_BUFFER_BIT4_QCOM", }, { @@ -535,6 +538,9 @@ static const GLES2Util::EnumToString enum_to_string_table[] = { 0x1F03, "GL_EXTENSIONS", }, { + 0x2, "GL_CA_LAYER_EDGE_RIGHT_CHROMIUM", + }, + { 0x20000000, "GL_MULTISAMPLE_BUFFER_BIT5_QCOM", }, { @@ -607,6 +613,9 @@ static const GLES2Util::EnumToString enum_to_string_table[] = { 0x300E, "GL_CONTEXT_LOST", }, { + 0x4, "GL_CA_LAYER_EDGE_BOTTOM_CHROMIUM", + }, + { 0x40000000, "GL_MULTISAMPLE_BUFFER_BIT6_QCOM", }, { @@ -646,6 +655,9 @@ static const GLES2Util::EnumToString enum_to_string_table[] = { 0x78FC, "GL_RGB_YCBCR_420V_CHROMIUM", }, { + 0x8, "GL_CA_LAYER_EDGE_TOP_CHROMIUM", + }, + { 0x80000000, "GL_MULTISAMPLE_BUFFER_BIT7_QCOM", }, { diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 46211cc..866f46c 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -9558,18 +9558,21 @@ error::Error GLES2DecoderImpl::HandleScheduleCALayerCHROMIUM( } const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, - 22 * sizeof(GLfloat)); + 28 * 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]); + gfx::RectF bounds_rect(mem[4], mem[5], mem[6], mem[7]); + gfx::RectF clip_rect(mem[8], mem[9], mem[10], mem[11]); + gfx::Transform transform(mem[12], mem[16], mem[20], mem[24], + mem[13], mem[17], mem[21], mem[25], + mem[14], mem[18], mem[22], mem[26], + mem[15], mem[19], mem[23], mem[27]); if (!surface_->ScheduleCALayer(image, contents_rect, c.opacity, - c.background_color, bounds_size, transform)) { + c.background_color, c.edge_aa_mask, + bounds_rect, c.is_clipped ? true : false, + clip_rect, transform)) { LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM", "failed to schedule CALayer"); } diff --git a/mojo/gpu/mojo_gles2_impl_autogen.cc b/mojo/gpu/mojo_gles2_impl_autogen.cc index 6380a30..5818a65 100644 --- a/mojo/gpu/mojo_gles2_impl_autogen.cc +++ b/mojo/gpu/mojo_gles2_impl_autogen.cc @@ -1704,12 +1704,18 @@ void MojoGLES2Impl::ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order, void MojoGLES2Impl::ScheduleCALayerCHROMIUM(GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, - const GLuint background_color, - const GLfloat* bounds_size, + GLuint background_color, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform) { MojoGLES2MakeCurrent(context_); glScheduleCALayerCHROMIUM(contents_texture_id, contents_rect, opacity, - background_color, bounds_size, transform); + background_color, edge_aa_mask, bounds_rect, + is_clipped, clip_rect, sorting_context_id, + transform); } void MojoGLES2Impl::CommitOverlayPlanesCHROMIUM() { MojoGLES2MakeCurrent(context_); diff --git a/mojo/gpu/mojo_gles2_impl_autogen.h b/mojo/gpu/mojo_gles2_impl_autogen.h index ca855bc..4197089 100644 --- a/mojo/gpu/mojo_gles2_impl_autogen.h +++ b/mojo/gpu/mojo_gles2_impl_autogen.h @@ -787,8 +787,12 @@ class MojoGLES2Impl : public gpu::gles2::GLES2Interface { void ScheduleCALayerCHROMIUM(GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, - const GLuint background_color, - const GLfloat* bounds_size, + GLuint background_color, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform) override; void CommitOverlayPlanesCHROMIUM() override; void SwapInterval(GLint interval) override; diff --git a/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h b/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h index ba6a5e9..b2d8e24 100644 --- a/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h +++ b/mojo/public/c/gles2/gles2_call_visitor_chromium_extension_autogen.h @@ -378,14 +378,22 @@ VISIT_GL_CALL(ScheduleCALayerCHROMIUM, (GLuint contents_texture_id, const GLfloat* contents_rect, GLfloat opacity, - const GLuint background_color, - const GLfloat* bounds_size, + GLuint background_color, + GLuint edge_aa_mask, + const GLfloat* bounds_rect, + GLboolean is_clipped, + const GLfloat* clip_rect, + GLint sorting_context_id, const GLfloat* transform), (contents_texture_id, contents_rect, opacity, background_color, - bounds_size, + edge_aa_mask, + bounds_rect, + is_clipped, + clip_rect, + sorting_context_id, transform)) VISIT_GL_CALL(CommitOverlayPlanesCHROMIUM, void, (), ()) VISIT_GL_CALL(SwapInterval, void, (GLint interval), (interval)) diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc index 99e94ba..c534690 100644 --- a/ui/gl/gl_surface.cc +++ b/ui/gl/gl_surface.cc @@ -206,8 +206,11 @@ bool GLSurface::ScheduleCALayer(gl::GLImage* contents_image, const RectF& contents_rect, float opacity, unsigned background_color, - const SizeF& bounds_size, - const gfx::Transform& transform) { + unsigned edge_aa_mask, + const RectF& bounds_rect, + bool is_clipped, + const RectF& clip_rect, + const Transform& transform) { NOTIMPLEMENTED(); return false; } diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h index cf4b723..f91ef43 100644 --- a/ui/gl/gl_surface.h +++ b/ui/gl/gl_surface.h @@ -172,7 +172,10 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { const RectF& contents_rect, float opacity, unsigned background_color, - const SizeF& size, + unsigned edge_aa_mask, + const RectF& bounds_rect, + bool is_clipped, + const RectF& clip_rect, const Transform& transform); virtual bool IsSurfaceless() const; |