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

Unified Diff: cc/resources/picture_pile_unittest.cc

Issue 692473003: cc: Translate the canvas to correctly detect solid colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test Created 6 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/resources/picture_pile.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile_unittest.cc
diff --git a/cc/resources/picture_pile_unittest.cc b/cc/resources/picture_pile_unittest.cc
index d6d75fad1cd4215a5d91d355452c0a0083e5be73..b49f683bd1bb26557fbd8e38277611ce5078af68 100644
--- a/cc/resources/picture_pile_unittest.cc
+++ b/cc/resources/picture_pile_unittest.cc
@@ -1432,5 +1432,26 @@ TEST_F(PicturePileTest, SolidRectangleIsSolid) {
EXPECT_FALSE(pile_.is_solid_color());
}
+TEST_F(PicturePileTest, NonSolidRectangleOnOffsetedLayerIsNonSolid) {
vmpstr 2014/10/29 21:41:58 Offset?
+ gfx::Rect tiling_rect(tiling_rect());
+ tiling_rect.Offset(gfx::Vector2d(10000, 0));
+ gfx::Size tiling_size(tiling_rect.x() + tiling_rect.width(),
vmpstr 2014/10/29 21:41:59 right, bottom? Also, why is the tiling size bigger
+ tiling_rect.y() + tiling_rect.height());
+ // |Setup()| will create pictures here that mess with the test, clear it!
+ pile_.Clear();
+
+ SkPaint paint;
+ paint.setColor(SK_ColorCYAN);
+
+ // Add a rect that doesn't cover the viewport completely, the solid state
+ // will be false.
+ gfx::Rect smallRect = tiling_rect;
+ smallRect.Inset(10, 10, 10, 10);
+ client_.add_draw_rect(smallRect, paint);
+ Region invalidation2(tiling_rect);
vmpstr 2014/10/29 21:41:59 just invalidation.
+ UpdateAndExpandInvalidation(&invalidation2, tiling_size, tiling_rect);
+ EXPECT_FALSE(pile_.is_solid_color());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/resources/picture_pile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698