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

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

Issue 2701523003: Don't pixel-snap overflow clips in clip paint property nodes. (Closed)
Patch Set: none 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 96fe94dd115a0cc4288aa04e12de721f860e13bf..4ccfc42bf08430bf43c814a9617e140299688a95 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -249,8 +249,16 @@ LayoutRect PaintLayerClipper::localClipRect(
#ifdef CHECK_CLIP_RECTS
#define CHECK_RECTS_EQ(expected, actual) \
- CHECK((expected.isEmpty() && actual.isEmpty()) || expected == actual) \
- << "expected=" << expected.toString() << " actual=" << actual.toString()
+ do { \
chrishtr 2017/02/16 21:44:28 I adjusted this to not assert, in order to get bet
+ 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);
#endif
void PaintLayerClipper::mapLocalToRootWithGeometryMapper(
@@ -272,6 +280,7 @@ void PaintLayerClipper::mapLocalToRootWithGeometryMapper(
rectToMap = LayoutRect(m_geometryMapper->sourceToDestinationRect(
localRect, layerTransform, rootTransform));
rectToMap.moveBy(-context.rootLayer->layoutObject()->paintOffset());
+ rectToMap.move(context.subPixelAccumulation);
chrishtr 2017/02/16 21:44:28 This is exercised by the layout test fast/sub-pixe
}
void PaintLayerClipper::calculateRectsWithGeometryMapper(
@@ -288,16 +297,15 @@ void PaintLayerClipper::calculateRectsWithGeometryMapper(
foregroundRect = ClipRect(LayoutRect(LayoutRect::infiniteIntRect()));
} else {
backgroundRect = clipRectWithGeometryMapper(context, false);
- applyOverflowClipToBackgroundRectWithGeometryMapper(context,
- backgroundRect);
- backgroundRect.move(
- context.subPixelAccumulation); // TODO(chrishtr): is this needed?
chrishtr 2017/02/16 21:44:28 Confirmed that it is needed.
+ backgroundRect.move(context.subPixelAccumulation);
backgroundRect.intersect(paintDirtyRect);
- foregroundRect.move(
- context.subPixelAccumulation); // TODO(chrishtr): is this needed?
+ applyOverflowClipToBackgroundRectWithGeometryMapper(context,
+ backgroundRect);
+
foregroundRect = clipRectWithGeometryMapper(context, true);
+ foregroundRect.move(context.subPixelAccumulation);
chrishtr 2017/02/16 21:44:28 I moved this above new line 309 for consistency wi
foregroundRect.intersect(paintDirtyRect);
}
LayoutPoint offset;
@@ -310,9 +318,9 @@ void PaintLayerClipper::calculateRectsWithGeometryMapper(
#ifdef CHECK_CLIP_RECTS
ClipRect testBackgroundRect, testForegroundRect;
LayoutRect testLayerBounds;
- PaintLayerClipper(m_layer, false)
+ PaintLayerClipper(m_layer, nullptr)
.calculateRects(context, paintDirtyRect, testLayerBounds,
- testBackgroundRect, testForegroundRect);
+ testBackgroundRect, testForegroundRect, offsetFromRoot);
CHECK_RECTS_EQ(testBackgroundRect, backgroundRect);
CHECK_RECTS_EQ(testForegroundRect, foregroundRect);
CHECK_RECTS_EQ(testLayerBounds, layerBounds);
@@ -510,7 +518,7 @@ ClipRect PaintLayerClipper::backgroundClipRect(
ClipRect backgroundClipRect = clipRectWithGeometryMapper(context, false);
#ifdef CHECK_CLIP_RECTS
ClipRect testBackgroundClipRect =
- PaintLayerClipper(m_layer, false).backgroundClipRect(context);
+ PaintLayerClipper(m_layer, nullptr).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