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

Unified Diff: cc/test/layer_test_common.cc

Issue 913133004: cc: Make PaintedScrollbarLayer not use ContentsScalingLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Scale track opaque rect Created 5 years, 10 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/test/fake_painted_scrollbar_layer.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_test_common.cc
diff --git a/cc/test/layer_test_common.cc b/cc/test/layer_test_common.cc
index 7e835b892a59a1fe372672fad0dddd2dec52e13d..b6a0da6f6c9a605bdc096ce6c1922382db30898f 100644
--- a/cc/test/layer_test_common.cc
+++ b/cc/test/layer_test_common.cc
@@ -75,9 +75,17 @@ void LayerTestCommon::VerifyQuadsAreOccluded(const QuadList& quads,
// Quads that are fully occluded on one axis only should be shrunken.
for (const auto& quad : quads) {
- DCHECK(quad->quadTransform().IsIdentityOrIntegerTranslation());
gfx::Rect target_rect =
MathUtil::MapEnclosingClippedRect(quad->quadTransform(), quad->rect);
+ if (!quad->quadTransform().IsIdentityOrIntegerTranslation()) {
+ DCHECK(quad->quadTransform().IsPositiveScaleOrTranslation())
+ << quad->quadTransform().ToString();
+ gfx::RectF target_rectf =
+ MathUtil::MapClippedRect(quad->quadTransform(), quad->rect);
+ // Scale transforms allowed, as long as the final transformed rect
+ // ends up on integer boundaries for ease of testing.
+ DCHECK_EQ(target_rectf.ToString(), gfx::RectF(target_rect).ToString());
+ }
gfx::Rect target_visible_rect = MathUtil::MapEnclosingClippedRect(
quad->quadTransform(), quad->visible_rect);
« no previous file with comments | « cc/test/fake_painted_scrollbar_layer.h ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698