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

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

Issue 974903003: [S.P.] Merge getContentPicture into createContentPicture. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: reverse if condition Created 5 years, 10 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 | « Source/core/layout/svg/LayoutSVGResourceMasker.h ('k') | Source/core/paint/SVGMaskPainter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/LayoutSVGResourceMasker.cpp
diff --git a/Source/core/layout/svg/LayoutSVGResourceMasker.cpp b/Source/core/layout/svg/LayoutSVGResourceMasker.cpp
index 0cb26dd53c50e2dd0b254cf4ae2e152d73b874ec..8fd467b791b744dce117ab5ac57f170d699e25e9 100644
--- a/Source/core/layout/svg/LayoutSVGResourceMasker.cpp
+++ b/Source/core/layout/svg/LayoutSVGResourceMasker.cpp
@@ -52,8 +52,19 @@ void LayoutSVGResourceMasker::removeClientFromCache(LayoutObject* client, bool m
markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidation : ParentOnlyInvalidation);
}
-PassRefPtr<const SkPicture> LayoutSVGResourceMasker::createContentPicture()
+PassRefPtr<const SkPicture> LayoutSVGResourceMasker::createContentPicture(AffineTransform& contentTransformation, const FloatRect& targetBoundingBox)
{
+ SVGUnitTypes::SVGUnitType contentUnits = toSVGMaskElement(element())->maskContentUnits()->currentValue()->enumValue();
+ if (contentUnits == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
+ contentTransformation.translate(targetBoundingBox.x(), targetBoundingBox.y());
+ contentTransformation.scaleNonUniform(targetBoundingBox.width(), targetBoundingBox.height());
+ }
+
+ if (m_maskContentPicture)
+ return m_maskContentPicture;
+
+ SubtreeContentTransformScope contentTransformScope(contentTransformation);
+
// Using strokeBoundingBox (instead of paintInvalidationRectInLocalCoordinates) to avoid the intersection
// with local clips/mask, which may yield incorrect results when mixing objectBoundingBox and
// userSpaceOnUse units (http://crbug.com/294900).
@@ -82,22 +93,7 @@ PassRefPtr<const SkPicture> LayoutSVGResourceMasker::createContentPicture()
if (displayItemList)
displayItemList->replay(&context);
- return context.endRecording();
-}
-
-PassRefPtr<const SkPicture> LayoutSVGResourceMasker::getContentPicture(AffineTransform& contentTransformation, const FloatRect& targetBoundingBox)
-{
- SVGUnitTypes::SVGUnitType contentUnits = toSVGMaskElement(element())->maskContentUnits()->currentValue()->enumValue();
- if (contentUnits == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
- contentTransformation.translate(targetBoundingBox.x(), targetBoundingBox.y());
- contentTransformation.scaleNonUniform(targetBoundingBox.width(), targetBoundingBox.height());
- }
-
- if (!m_maskContentPicture) {
- SubtreeContentTransformScope contentTransformScope(contentTransformation);
- m_maskContentPicture = createContentPicture();
- }
-
+ m_maskContentPicture = context.endRecording();
return m_maskContentPicture;
}
« no previous file with comments | « Source/core/layout/svg/LayoutSVGResourceMasker.h ('k') | Source/core/paint/SVGMaskPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698