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

Unified Diff: Source/core/layout/svg/SVGLayoutSupport.cpp

Issue 1165393005: Add helper for computing outset for 'outline' (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | Source/core/paint/InlinePainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/SVGLayoutSupport.cpp
diff --git a/Source/core/layout/svg/SVGLayoutSupport.cpp b/Source/core/layout/svg/SVGLayoutSupport.cpp
index ebe2d4b4b9c09d03420c04b86c1ea7e746e98f9f..a9990940b01643e0e91b10b41d89d671623a2fac 100644
--- a/Source/core/layout/svg/SVGLayoutSupport.cpp
+++ b/Source/core/layout/svg/SVGLayoutSupport.cpp
@@ -51,26 +51,15 @@ static inline LayoutRect enclosingIntRectIfNotEmpty(const FloatRect& rect)
return LayoutRect(enclosingIntRect(rect));
}
-static void inflateWithOutlineIfNeeded(FloatRect& paintInvalidationRect, const ComputedStyle& style)
-{
- if (!style.hasOutline())
- return;
- int outlineSize = 0;
- if (style.outlineStyleIsAuto())
- outlineSize = GraphicsContext::focusRingOutsetExtent(style.outlineOffset(), style.outlineWidth());
- else
- outlineSize = style.outlineSize();
- paintInvalidationRect.inflate(outlineSize);
-}
-
LayoutRect SVGLayoutSupport::clippedOverflowRectForPaintInvalidation(const LayoutObject& object, const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState)
{
// Return early for any cases where we don't actually paint
- if (object.style()->visibility() != VISIBLE && !object.enclosingLayer()->hasVisibleContent())
+ if (object.styleRef().visibility() != VISIBLE && !object.enclosingLayer()->hasVisibleContent())
return LayoutRect();
FloatRect paintInvalidationRect = object.paintInvalidationRectInLocalCoordinates();
- inflateWithOutlineIfNeeded(paintInvalidationRect, object.styleRef());
+ if (int outlineOutset = object.styleRef().outlineOutset())
+ paintInvalidationRect.inflate(outlineOutset);
if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer)) {
// Compute accumulated SVG transform and apply to local paint rect.
« no previous file with comments | « no previous file | Source/core/paint/InlinePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698