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

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

Issue 1154853007: Move toClipPath to SVGGeometryElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Draft 3 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/svg/SVGGeometryElement.h » ('j') | Source/core/svg/SVGUseElement.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/LayoutSVGResourceClipper.cpp
diff --git a/Source/core/layout/svg/LayoutSVGResourceClipper.cpp b/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
index ec02b32ca3ee31a74c68aaade1fea311cab625bf..46976cf95f8d18d2e8d4c51620adcd95f89d30c3 100644
--- a/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
+++ b/Source/core/layout/svg/LayoutSVGResourceClipper.cpp
@@ -32,6 +32,7 @@
#include "core/paint/CompositingRecorder.h"
#include "core/paint/PaintInfo.h"
#include "core/paint/TransformRecorder.h"
+#include "core/svg/SVGGeometryElement.h"
#include "core/svg/SVGUseElement.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/graphics/paint/ClipPathDisplayItem.h"
@@ -94,14 +95,20 @@ bool LayoutSVGResourceClipper::tryPathOnlyClipping(const LayoutObject& layoutObj
if (clipPath.isEmpty()) {
// First clip shape.
- styled->toClipPath(clipPath);
+ if (isSVGGeometryElement(styled))
+ toSVGGeometryElement(styled)->toClipPath(clipPath);
+ else if (isSVGUseElement(styled))
+ toSVGUseElement(styled)->toClipPath(clipPath);
continue;
}
if (RuntimeEnabledFeatures::pathOpsSVGClippingEnabled()) {
// Attempt to generate a combined clip path, fall back to masking if not possible.
Path subPath;
- styled->toClipPath(subPath);
+ if (isSVGGeometryElement(styled))
+ toSVGGeometryElement(styled)->toClipPath(clipPath);
+ else if (isSVGUseElement(styled))
+ toSVGUseElement(styled)->toClipPath(clipPath);
if (!clipPath.unionPath(subPath))
return false;
} else {
« no previous file with comments | « no previous file | Source/core/svg/SVGGeometryElement.h » ('j') | Source/core/svg/SVGUseElement.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698