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; |