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

Unified Diff: cc/output/overlay_strategy_single_on_top.cc

Issue 208213003: Plumb overlay processing into DirectRenderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More plumbing Created 6 years, 9 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: cc/output/overlay_strategy_single_on_top.cc
diff --git a/cc/output/overlay_strategy_single_on_top.cc b/cc/output/overlay_strategy_single_on_top.cc
index 4c2064196ddbca9181d192cd94d51b6c4603f3f9..a53644b255693d68bbf6244828ea73aee5dc97e9 100644
--- a/cc/output/overlay_strategy_single_on_top.cc
+++ b/cc/output/overlay_strategy_single_on_top.cc
@@ -37,7 +37,10 @@ bool OverlayStrategySingleOnTop::Attempt(
return false;
// Simple quads only.
- if (!quad.quadTransform().IsIdentityOrTranslation() || quad.needs_blending ||
+ OverlayCandidate::OverlayTransform overlay_transform =
+ OverlayCandidate::GetOverlayTransform(quad.quadTransform(), quad.flipped);
+ if (overlay_transform == OverlayCandidate::INVALID ||
+ !quad.quadTransform().IsIdentityOrTranslation() || quad.needs_blending ||
quad.shared_quad_state->opacity != 1.f ||
quad.shared_quad_state->blend_mode != SkXfermode::kSrcOver_Mode ||
quad.premultiplied_alpha || quad.background_color != SK_ColorTRANSPARENT)
@@ -52,11 +55,9 @@ bool OverlayStrategySingleOnTop::Attempt(
// Add the overlay.
OverlayCandidate candidate;
- gfx::RectF float_rect(quad.rect);
- quad.quadTransform().TransformRect(&float_rect);
- candidate.transform =
- quad.flipped ? OverlayCandidate::FLIP_VERTICAL : OverlayCandidate::NONE;
- candidate.display_rect = gfx::ToNearestRect(float_rect);
+ candidate.transform = overlay_transform;
+ candidate.display_rect =
+ OverlayCandidate::GetOverlayRect(quad.quadTransform(), quad.rect);
candidate.uv_rect = BoundingRect(quad.uv_top_left, quad.uv_bottom_right);
candidate.format = RGBA_8888;
candidates.push_back(candidate);

Powered by Google App Engine
This is Rietveld 408576698