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

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

Issue 2705493003: Revert of Don't pixel-snap overflow clips in clip paint property nodes. (Closed)
Patch Set: Created 3 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
Index: third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
index 44474e5be734767a26b67bda27c7b6d2c520d930..7572412e0cda193cd19b2b31fd2e37897b65d3c9 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -247,16 +247,8 @@
#ifdef CHECK_CLIP_RECTS
#define CHECK_RECTS_EQ(expected, actual) \
- do { \
- bool matches = \
- (expected.isEmpty() && actual.isEmpty()) || expected == actual; \
- if (!matches) { \
- LOG(ERROR) << "Rects don't match for m_layer=" \
- << m_layer.layoutObject()->debugName() \
- << " expected=" << expected.toString() \
- << " actual=" << actual.toString(); \
- } \
- } while (false);
+ CHECK((expected.isEmpty() && actual.isEmpty()) || expected == actual) \
+ << "expected=" << expected.toString() << " actual=" << actual.toString()
#endif
void PaintLayerClipper::mapLocalToRootWithGeometryMapper(
@@ -278,7 +270,6 @@
rectToMap = LayoutRect(m_geometryMapper->sourceToDestinationRect(
localRect, layerTransform, rootTransform));
rectToMap.moveBy(-context.rootLayer->layoutObject()->paintOffset());
- rectToMap.move(context.subPixelAccumulation);
}
void PaintLayerClipper::calculateRectsWithGeometryMapper(
@@ -295,15 +286,16 @@
foregroundRect = ClipRect(LayoutRect(LayoutRect::infiniteIntRect()));
} else {
backgroundRect = clipRectWithGeometryMapper(context, false);
-
- backgroundRect.move(context.subPixelAccumulation);
- backgroundRect.intersect(paintDirtyRect);
-
applyOverflowClipToBackgroundRectWithGeometryMapper(context,
backgroundRect);
+ backgroundRect.move(
+ context.subPixelAccumulation); // TODO(chrishtr): is this needed?
+ backgroundRect.intersect(paintDirtyRect);
+
+ foregroundRect.move(
+ context.subPixelAccumulation); // TODO(chrishtr): is this needed?
foregroundRect = clipRectWithGeometryMapper(context, true);
- foregroundRect.move(context.subPixelAccumulation);
foregroundRect.intersect(paintDirtyRect);
}
LayoutPoint offset;
@@ -316,9 +308,9 @@
#ifdef CHECK_CLIP_RECTS
ClipRect testBackgroundRect, testForegroundRect;
LayoutRect testLayerBounds;
- PaintLayerClipper(m_layer, nullptr)
+ PaintLayerClipper(m_layer, false)
.calculateRects(context, paintDirtyRect, testLayerBounds,
- testBackgroundRect, testForegroundRect, offsetFromRoot);
+ testBackgroundRect, testForegroundRect);
CHECK_RECTS_EQ(testBackgroundRect, backgroundRect);
CHECK_RECTS_EQ(testForegroundRect, foregroundRect);
CHECK_RECTS_EQ(testLayerBounds, layerBounds);
@@ -513,7 +505,7 @@
ClipRect backgroundClipRect = clipRectWithGeometryMapper(context, false);
#ifdef CHECK_CLIP_RECTS
ClipRect testBackgroundClipRect =
- PaintLayerClipper(m_layer, nullptr).backgroundClipRect(context);
+ PaintLayerClipper(m_layer, false).backgroundClipRect(context);
CHECK_RECTS_EQ(testBackgroundClipRect, backgroundClipRect);
#endif
return backgroundClipRect;
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698