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

Unified Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGModelObject.cpp

Issue 2208463003: First step of PaintInvalidator implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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/layout/svg/LayoutSVGModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGModelObject.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGModelObject.cpp
index d79f02b59511e53229332f91924c7fd288ad2246..519e723a1ae9a2a3ea66265dfbe162275e9dc7d9 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGModelObject.cpp
@@ -36,6 +36,7 @@
#include "core/layout/svg/SVGLayoutSupport.h"
#include "core/layout/svg/SVGResourcesCache.h"
#include "core/paint/PaintLayer.h"
+#include "core/paint/SVGModelObjectPaintInvalidator.h"
#include "core/svg/SVGGraphicsElement.h"
namespace blink {
@@ -88,18 +89,9 @@ void LayoutSVGModelObject::willBeDestroyed()
LayoutObject::willBeDestroyed();
}
-PaintInvalidationReason LayoutSVGModelObject::getPaintInvalidationReason(const PaintInvalidationState& paintInvalidationState,
- const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRect& newBounds, const LayoutPoint& newLocation) const
+PaintInvalidationReason LayoutSVGModelObject::invalidatePaintIfNeeded(const PaintInvalidatorContext& context) const
{
- PaintInvalidationReason invalidationReason = LayoutObject::getPaintInvalidationReason(paintInvalidationState, oldBounds, oldLocation, newBounds, newLocation);
-
- // Disable incremental invalidation for SVG objects to prevent under-
- // invalidation. Unlike boxes, it is non-trivial (and rare) for SVG objects
- // to be able to be incrementally invalidated (e.g., on height changes).
- if (invalidationReason == PaintInvalidationIncremental)
- return PaintInvalidationFull;
-
- return invalidationReason;
+ return SVGModelObjectPaintInvalidator(*this, context).invalidatePaintIfNeeded();
}
void LayoutSVGModelObject::computeLayerHitTestRects(LayerHitTestRects& rects) const

Powered by Google App Engine
This is Rietveld 408576698