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

Unified Diff: Source/core/rendering/svg/RenderSVGResourcePattern.cpp

Issue 638933002: Introduce SVGPaintServer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Extra sure about manual shadow-restore. Created 6 years, 2 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: Source/core/rendering/svg/RenderSVGResourcePattern.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResourcePattern.cpp b/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
index 19a1a1b5493cdd1cb7610193540cf9d432094001..adac1c24274e5a4ebb50c5f8e7692ced936e3abf 100644
--- a/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
@@ -19,11 +19,10 @@
*/
#include "config.h"
-
#include "core/rendering/svg/RenderSVGResourcePattern.h"
#include "core/dom/ElementTraversal.h"
-#include "core/rendering/svg/SVGRenderSupport.h"
+#include "core/paint/SVGPaintServer.h"
#include "core/rendering/svg/SVGRenderingContext.h"
#include "core/svg/SVGFitToViewBox.h"
#include "platform/graphics/GraphicsContext.h"
@@ -112,11 +111,10 @@ PatternData* RenderSVGResourcePattern::buildPattern(RenderObject* object, const
return m_patternMap.set(object, patternData.release()).storedValue->value.get();
}
-bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle* style, GraphicsContext* context, RenderSVGResourceModeFlags resourceMode)
+bool RenderSVGResourcePattern::preparePaintServer(RenderObject* object, RenderStyle* style, RenderSVGResourceModeFlags resourceMode, SVGPaintServer& paintServer)
{
ASSERT(object);
ASSERT(style);
- ASSERT(context);
clearInvalidationMask();
@@ -147,24 +145,10 @@ bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle*
AffineTransform computedPatternSpaceTransform = computeResourceSpaceTransform(object, patternData->transform, svgStyle, resourceMode);
patternData->pattern->setPatternSpaceTransform(computedPatternSpaceTransform);
- // Draw pattern
- context->save();
-
- if (resourceMode & ApplyToFillMode)
- context->setFillPattern(patternData->pattern);
- else if (resourceMode & ApplyToStrokeMode)
- context->setStrokePattern(patternData->pattern);
-
- updateGraphicsContext(context, style, *object, resourceMode);
+ paintServer.setPattern(patternData->pattern);
return true;
}
-void RenderSVGResourcePattern::postApplyResource(GraphicsContext* context)
-{
- ASSERT(context);
- context->restore();
-}
-
static inline FloatRect calculatePatternBoundaries(const PatternAttributes& attributes,
const FloatRect& objectBoundingBox,
const SVGPatternElement* patternElement)

Powered by Google App Engine
This is Rietveld 408576698