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

Unified Diff: cc/resources/picture_layer_tiling_unittest.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/resources/picture_layer_tiling_set.cc ('k') | cc/resources/picture_pile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_layer_tiling_unittest.cc
diff --git a/cc/resources/picture_layer_tiling_unittest.cc b/cc/resources/picture_layer_tiling_unittest.cc
index fccd3c86284a34c42357315f6d919b44b2a9d1ab..d4a877862164b4fa6a3ddd6bcabc04d3a380987c 100644
--- a/cc/resources/picture_layer_tiling_unittest.cc
+++ b/cc/resources/picture_layer_tiling_unittest.cc
@@ -691,10 +691,11 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) {
tiling->ComputeTilePriorityRects(viewport, 1.f, 1.0, Occlusion());
tiling->UpdateAllTilePrioritiesForTesting();
- gfx::Rect soon_rect = viewport;
- soon_rect.Inset(-312.f, -312.f, -312.f, -312.f);
- gfx::Rect soon_rect_in_content_space =
- gfx::ToEnclosedRect(gfx::ScaleRect(soon_rect, 0.25f));
+ // Compute the soon border.
+ float inset = PictureLayerTiling::CalculateSoonBorderDistance(
+ viewport_in_content_space, 1.0f / 0.25f);
+ gfx::Rect soon_rect_in_content_space = viewport_in_content_space;
+ soon_rect_in_content_space.Inset(-inset, -inset);
// Sanity checks.
for (int i = 0; i < 47; ++i) {
@@ -763,10 +764,11 @@ TEST(PictureLayerTilingTest, ViewportDistanceWithScale) {
gfx::ToEnclosedRect(gfx::ScaleRect(viewport, 0.25f));
gfx::Rect skewport = tiling->ComputeSkewport(2.0, viewport_in_content_space);
- soon_rect = viewport;
- soon_rect.Inset(-312.f, -312.f, -312.f, -312.f);
- soon_rect_in_content_space =
- gfx::ToEnclosedRect(gfx::ScaleRect(soon_rect, 0.25f));
+ // Compute the soon border.
+ inset = PictureLayerTiling::CalculateSoonBorderDistance(
+ viewport_in_content_space, 1.0f / 0.25f);
+ soon_rect_in_content_space = viewport_in_content_space;
+ soon_rect_in_content_space.Inset(-inset, -inset);
EXPECT_EQ(0, skewport.x());
EXPECT_EQ(10, skewport.y());
« no previous file with comments | « cc/resources/picture_layer_tiling_set.cc ('k') | cc/resources/picture_pile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698