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

Unified Diff: cc/resources/picture_pile_unittest.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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') | cc/resources/pixel_buffer_raster_worker_pool.cc » ('j') | 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..98415ca3969e3a2b76a778802eecd09da7a177e9 100644
--- a/cc/resources/picture_pile_unittest.cc
+++ b/cc/resources/picture_pile_unittest.cc
@@ -1432,5 +1432,29 @@ TEST_F(PicturePileTest, SolidRectangleIsSolid) {
EXPECT_FALSE(pile_.is_solid_color());
}
+TEST_F(PicturePileTest, NonSolidRectangleOnOffsettedLayerIsNonSolid) {
+ gfx::Rect visible_rect(tiling_rect());
+ visible_rect.Offset(gfx::Vector2d(1000, 1000));
+ // The picture pile requires that the tiling completely encompass the viewport
+ // to make this test work correctly since the recorded viewport is an
+ // intersection of the tile size and viewport rect. This is possibly a flaw
+ // in |PicturePile|.
+ gfx::Size tiling_size(visible_rect.right(), visible_rect.bottom());
+ // |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 = visible_rect;
+ smallRect.Inset(10, 10, 10, 10);
+ client_.add_draw_rect(smallRect, paint);
+ Region invalidation(visible_rect);
+ UpdateAndExpandInvalidation(&invalidation, tiling_size, visible_rect);
+ EXPECT_FALSE(pile_.is_solid_color());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/resources/picture_pile.cc ('k') | cc/resources/pixel_buffer_raster_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698