summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/core/paint
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/WebKit/Source/core/paint')
-rw-r--r--third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp2
-rw-r--r--third_party/WebKit/Source/core/paint/PaintLayer.cpp41
-rw-r--r--third_party/WebKit/Source/core/paint/PaintLayer.h16
-rw-r--r--third_party/WebKit/Source/core/paint/SVGContainerPainter.cpp4
4 files changed, 18 insertions, 45 deletions
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
index 7ed559e..5175913 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
@@ -28,7 +28,7 @@ static LayoutRect scrollControlPaintInvalidationRect(const IntRect& scrollContro
{
LayoutRect paintInvalidationRect(scrollControlRect);
if (!paintInvalidationRect.isEmpty())
- PaintLayer::mapRectToPaintInvalidationBacking(&box, &paintInvalidationState.paintInvalidationContainer(), paintInvalidationRect, &paintInvalidationState);
+ paintInvalidationState.mapLocalRectToPaintInvalidationBacking(paintInvalidationRect);
return paintInvalidationRect;
}
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 1657234..c96f42c 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -543,20 +543,9 @@ void PaintLayer::clearPaginationRecursive()
child->clearPaginationRecursive();
}
-LayoutPoint PaintLayer::positionFromPaintInvalidationBacking(const LayoutObject* layoutObject, const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState)
+void PaintLayer::mapPointInPaintInvalidationContainerToBacking(const LayoutBoxModelObject& paintInvalidationContainer, FloatPoint& point)
{
- FloatPoint point = layoutObject->localToAncestorPoint(FloatPoint(), paintInvalidationContainer, 0, 0, paintInvalidationState);
-
- // FIXME: Eventually we are going to unify coordinates in GraphicsLayer space.
- if (paintInvalidationContainer && paintInvalidationContainer->layer()->groupedMapping())
- mapPointInPaintInvalidationContainerToBacking(paintInvalidationContainer, point);
-
- return LayoutPoint(point);
-}
-
-void PaintLayer::mapPointInPaintInvalidationContainerToBacking(const LayoutBoxModelObject* paintInvalidationContainer, FloatPoint& point)
-{
- PaintLayer* paintInvalidationLayer = paintInvalidationContainer->layer();
+ PaintLayer* paintInvalidationLayer = paintInvalidationContainer.layer();
if (!paintInvalidationLayer->groupedMapping()) {
point.move(paintInvalidationLayer->compositedLayerMapping()->contentOffsetInCompositingLayer());
return;
@@ -568,14 +557,14 @@ void PaintLayer::mapPointInPaintInvalidationContainerToBacking(const LayoutBoxMo
// |paintInvalidationContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the
// transformed ancestor.
- point = paintInvalidationContainer->localToAncestorPoint(point, transformedAncestor);
+ point = paintInvalidationContainer.localToAncestorPoint(point, transformedAncestor);
point.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTransformedAncestor());
}
-void PaintLayer::mapRectInPaintInvalidationContainerToBacking(const LayoutBoxModelObject* paintInvalidationContainer, LayoutRect& rect)
+void PaintLayer::mapRectInPaintInvalidationContainerToBacking(const LayoutBoxModelObject& paintInvalidationContainer, LayoutRect& rect)
{
- PaintLayer* paintInvalidationLayer = paintInvalidationContainer->layer();
+ PaintLayer* paintInvalidationLayer = paintInvalidationContainer.layer();
if (!paintInvalidationLayer->groupedMapping()) {
rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffsetInCompositingLayer());
return;
@@ -587,15 +576,15 @@ void PaintLayer::mapRectInPaintInvalidationContainerToBacking(const LayoutBoxMod
// |paintInvalidationContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the
// transformed ancestor.
- rect = LayoutRect(paintInvalidationContainer->localToAncestorQuad(FloatRect(rect), transformedAncestor).boundingBox());
+ rect = LayoutRect(paintInvalidationContainer.localToAncestorQuad(FloatRect(rect), transformedAncestor).boundingBox());
rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTransformedAncestor());
}
-void PaintLayer::mapRectToPaintInvalidationBacking(const LayoutObject* layoutObject, const LayoutBoxModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState)
+void PaintLayer::mapRectToPaintInvalidationBacking(const LayoutObject& layoutObject, const LayoutBoxModelObject& paintInvalidationContainer, LayoutRect& rect)
{
- if (!paintInvalidationContainer->layer()->groupedMapping()) {
- layoutObject->mapToVisibleRectInAncestorSpace(paintInvalidationContainer, rect, paintInvalidationState);
+ if (!paintInvalidationContainer.layer()->groupedMapping()) {
+ layoutObject.mapToVisibleRectInAncestorSpace(&paintInvalidationContainer, rect);
return;
}
@@ -603,21 +592,11 @@ void PaintLayer::mapRectToPaintInvalidationBacking(const LayoutObject* layoutObj
// layer. This is because all layers that squash together need to issue paint invalidations w.r.t. a single container that is
// an ancestor of all of them, in order to properly take into account any local transforms etc.
// FIXME: remove this special-case code that works around the paint invalidation code structure.
- layoutObject->mapToVisibleRectInAncestorSpace(paintInvalidationContainer, rect, paintInvalidationState);
+ layoutObject.mapToVisibleRectInAncestorSpace(&paintInvalidationContainer, rect);
mapRectInPaintInvalidationContainerToBacking(paintInvalidationContainer, rect);
}
-LayoutRect PaintLayer::computePaintInvalidationRect(const LayoutObject& layoutObject, const PaintLayer* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState)
-{
- if (!paintInvalidationContainer->groupedMapping())
- return layoutObject.computePaintInvalidationRect(*paintInvalidationContainer->layoutObject(), paintInvalidationState);
-
- LayoutRect rect = layoutObject.clippedOverflowRectForPaintInvalidation(paintInvalidationContainer->layoutObject(), paintInvalidationState);
- mapRectInPaintInvalidationContainerToBacking(paintInvalidationContainer->layoutObject(), rect);
- return rect;
-}
-
void PaintLayer::dirtyVisibleContentStatus()
{
compositor()->setNeedsUpdateDescendantDependentFlags();
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.h b/third_party/WebKit/Source/core/paint/PaintLayer.h
index 2cbff35..26d5c27 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.h
@@ -438,20 +438,12 @@ public:
bool hasCompositedClippingMask() const;
bool needsCompositedScrolling() const { return m_scrollableArea && m_scrollableArea->needsCompositedScrolling(); }
- // Computes the position of the given layout object in the space of |paintInvalidationContainer|.
- // FIXME: invert the logic to have paint invalidation containers take care of painting objects into them, rather than the reverse.
- // This will allow us to clean up this static method messiness.
- static LayoutPoint positionFromPaintInvalidationBacking(const LayoutObject*, const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0);
-
- static void mapPointInPaintInvalidationContainerToBacking(const LayoutBoxModelObject* paintInvalidationContainer, FloatPoint&);
- static void mapRectInPaintInvalidationContainerToBacking(const LayoutBoxModelObject* paintInvalidationContainer, LayoutRect&);
+ static void mapPointInPaintInvalidationContainerToBacking(const LayoutBoxModelObject& paintInvalidationContainer, FloatPoint&);
+ static void mapRectInPaintInvalidationContainerToBacking(const LayoutBoxModelObject& paintInvalidationContainer, LayoutRect&);
// Adjusts the given rect (in the coordinate space of the LayoutObject) to the coordinate space of |paintInvalidationContainer|'s GraphicsLayer backing.
- static void mapRectToPaintInvalidationBacking(const LayoutObject*, const LayoutBoxModelObject* paintInvalidationContainer, LayoutRect&, const PaintInvalidationState* = 0);
-
- // Computes the bounding paint invalidation rect for |layoutObject|, in the coordinate space of |paintInvalidationContainer|'s GraphicsLayer backing.
- // TODO(jchaffraix): |paintInvalidationContainer| should be a reference.
- static LayoutRect computePaintInvalidationRect(const LayoutObject&, const PaintLayer* paintInvalidationContainer, const PaintInvalidationState* = 0);
+ // Should use PaintInvalidationState::mapRectToPaintInvalidationBacking() instead if PaintInvalidationState is available.
+ static void mapRectToPaintInvalidationBacking(const LayoutObject&, const LayoutBoxModelObject& paintInvalidationContainer, LayoutRect&);
bool paintsWithTransparency(GlobalPaintFlags globalPaintFlags) const
{
diff --git a/third_party/WebKit/Source/core/paint/SVGContainerPainter.cpp b/third_party/WebKit/Source/core/paint/SVGContainerPainter.cpp
index 94e198a..6ff1ca7 100644
--- a/third_party/WebKit/Source/core/paint/SVGContainerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGContainerPainter.cpp
@@ -24,7 +24,9 @@ void SVGContainerPainter::paint(const PaintInfo& paintInfo)
return;
FloatRect boundingBox = m_layoutSVGContainer.paintInvalidationRectInLocalSVGCoordinates();
- if (!paintInfo.cullRect().intersectsCullRect(m_layoutSVGContainer.localToSVGParentTransform(), boundingBox))
+ // LayoutSVGHiddenContainer's paint invalidation rect is always empty but we need to paint its descendants.
+ if (!m_layoutSVGContainer.isSVGHiddenContainer()
+ && !paintInfo.cullRect().intersectsCullRect(m_layoutSVGContainer.localToSVGParentTransform(), boundingBox))
return;
// Spec: An empty viewBox on the <svg> element disables rendering.