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

Unified Diff: cc/output/overlay_candidate.h

Issue 1380653003: Mac Overlays: Allow SolidColor and Tile quads to be candidates for overlays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@AllOrNothing2
Patch Set: Created 5 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 | « cc/output/gl_renderer_unittest.cc ('k') | cc/output/overlay_candidate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/overlay_candidate.h
diff --git a/cc/output/overlay_candidate.h b/cc/output/overlay_candidate.h
index aa42ba11f518b9a7f2b2e401f06d0c1cb7b766ce..980c1dc92be4360c6e34d06683445528d63707be 100644
--- a/cc/output/overlay_candidate.h
+++ b/cc/output/overlay_candidate.h
@@ -23,8 +23,10 @@ namespace cc {
class DrawQuad;
class IOSurfaceDrawQuad;
+class SolidColorDrawQuad;
class StreamVideoDrawQuad;
class TextureDrawQuad;
+class TileDrawQuad;
class ResourceProvider;
class CC_EXPORT OverlayCandidate {
@@ -58,11 +60,18 @@ class CC_EXPORT OverlayCandidate {
gfx::Rect clip_rect;
// If the quad is clipped after composition.
bool is_clipped;
- // True if the texture for this overlay should be the same one used by the
- // output surface's main overlay.
- bool use_output_surface_for_resource;
- // Texture resource to present in an overlay.
- unsigned resource_id;
+
+ enum {
+ HAS_RESOURCE, // Use |resource_id| for texture resource.
+ USE_OUTPUT_SURFACE, // Use the same texture as the output surface's main
+ // overlay.
+ SOLID_COLOR, // No resource, use |solid_color|.
+ } resource_type;
+ union {
+ unsigned resource_id; // When resource_type == HAS_RESOURCE.
+ SkColor solid_color; // When resource_type == SOLID_COLOR.
+ } resource;
+
// Stacking order of the overlay plane relative to the main surface,
// which is 0. Signed to allow for "underlays".
int plane_z_order;
@@ -81,6 +90,11 @@ class CC_EXPORT OverlayCandidate {
static bool FromIOSurfaceQuad(ResourceProvider* resource_provider,
const IOSurfaceDrawQuad* quad,
OverlayCandidate* candidate);
+ static bool FromTileQuad(ResourceProvider* resource_provider,
+ const TileDrawQuad* quad,
+ OverlayCandidate* candidate);
+ static bool FromSolidColorQuad(const SolidColorDrawQuad* quad,
+ OverlayCandidate* candidate);
};
typedef std::vector<OverlayCandidate> OverlayCandidateList;
« no previous file with comments | « cc/output/gl_renderer_unittest.cc ('k') | cc/output/overlay_candidate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698