From f89f594219da597c20b749fee195977052c6f709 Mon Sep 17 00:00:00 2001 From: achaulk Date: Wed, 10 Jun 2015 10:01:35 -0700 Subject: cc: Rework overlays to not use the ResourceProvider and pass texture size Instead of querying the ResourceProvider, the size & overlay flag are stored in the quads directly. This eliminates the lookups that were otherwise required CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel TBR=jam (approved interface change) Review URL: https://codereview.chromium.org/1142343008 Cr-Commit-Position: refs/heads/master@{#333748} --- cc/quads/stream_video_draw_quad.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cc/quads/stream_video_draw_quad.h') diff --git a/cc/quads/stream_video_draw_quad.h b/cc/quads/stream_video_draw_quad.h index faffd20..519c353 100644 --- a/cc/quads/stream_video_draw_quad.h +++ b/cc/quads/stream_video_draw_quad.h @@ -21,6 +21,8 @@ class CC_EXPORT StreamVideoDrawQuad : public DrawQuad { const gfx::Rect& opaque_rect, const gfx::Rect& visible_rect, unsigned resource_id, + gfx::Size resource_size_in_pixels, + bool allow_overlay, const gfx::Transform& matrix); void SetAll(const SharedQuadState* shared_quad_state, @@ -29,13 +31,29 @@ class CC_EXPORT StreamVideoDrawQuad : public DrawQuad { const gfx::Rect& visible_rect, bool needs_blending, unsigned resource_id, + gfx::Size resource_size_in_pixels, + bool allow_overlay, const gfx::Transform& matrix); gfx::Transform matrix; + struct OverlayResources { + OverlayResources(); + + gfx::Size size_in_pixels[Resources::kMaxResourceIdCount]; + bool allow_overlay[Resources::kMaxResourceIdCount]; + }; + OverlayResources overlay_resources; + static const StreamVideoDrawQuad* MaterialCast(const DrawQuad*); ResourceId resource_id() const { return resources.ids[kResourceIdIndex]; } + const gfx::Size& resource_size_in_pixels() const { + return overlay_resources.size_in_pixels[kResourceIdIndex]; + } + bool allow_overlay() const { + return overlay_resources.allow_overlay[kResourceIdIndex]; + } private: static const size_t kResourceIdIndex = 0; -- cgit v1.1