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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp

Issue 2822653003: [SPInvalidation] Micro-optimize PaintLayerClipper::calculateRects (Closed)
Patch Set: none Created 3 years, 8 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 | « third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
index e48f33ae934423c768249d9cea73a6cb5cde6a18..b41fdfe7a6fe4a8136acae8051010c5ab92bc452 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
@@ -63,17 +63,18 @@ TEST_P(PaintLayerClipperTest, LayoutSVGRoot) {
target_paint_layer->Clipper(option).CalculateRects(
context, LayoutRect(LayoutRect::InfiniteIntRect()), layer_bounds,
background_rect, foreground_rect);
- // TODO(chrishtr): investigate why these differences exist.
+
+ EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)),
+ background_rect.Rect());
if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) {
- EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)),
- background_rect.Rect());
- EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)),
+ EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 199.75, 299.66)),
foreground_rect.Rect());
} else {
- EXPECT_EQ(LayoutRect(FloatRect(8, 8, 200, 300)), background_rect.Rect());
+ // TODO(chrishtr): this is off by 0.25px because
+ // LayoutSVGRoot::OverflowClipRect incorrectly does pixel-snapping.
EXPECT_EQ(LayoutRect(FloatRect(8, 8, 200, 300)), foreground_rect.Rect());
}
- EXPECT_EQ(LayoutRect(8, 8, 200, 300), layer_bounds);
+ EXPECT_EQ(LayoutRect(FloatRect(8.25, 8.35, 200, 300)), layer_bounds);
}
TEST_P(PaintLayerClipperTest, ControlClip) {
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698