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

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

Issue 661643005: Pass more const RenderObject& in the vicinity of paint-servers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: const RenderObject& 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 fc0061af93e123c9cb98f886ca55802abe1bc49b..a15d4f3813c225a06ade3659b7b2e4fbc96cb201 100644
--- a/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
+++ b/Source/core/rendering/svg/RenderSVGResourcePattern.cpp
@@ -50,10 +50,9 @@ void RenderSVGResourcePattern::removeClientFromCache(RenderObject* client, bool
markClientForInvalidation(client, markForInvalidation ? PaintInvalidation : ParentOnlyInvalidation);
}
-PatternData* RenderSVGResourcePattern::buildPattern(RenderObject* object, const SVGPatternElement* patternElement)
+PatternData* RenderSVGResourcePattern::buildPattern(const RenderObject& object, const SVGPatternElement* patternElement)
{
- ASSERT(object);
- PatternData* currentData = m_patternMap.get(object);
+ PatternData* currentData = m_patternMap.get(&object);
if (currentData && currentData->pattern)
return currentData;
@@ -72,7 +71,7 @@ PatternData* RenderSVGResourcePattern::buildPattern(RenderObject* object, const
return 0;
AffineTransform absoluteTransformIgnoringRotation;
- SVGRenderingContext::calculateDeviceSpaceTransformation(object, absoluteTransformIgnoringRotation);
+ SVGRenderingContext::calculateDeviceSpaceTransformation(&object, absoluteTransformIgnoringRotation);
// Ignore 2D rotation, as it doesn't affect the size of the tile.
SVGRenderingContext::clear2DRotation(absoluteTransformIgnoringRotation);
@@ -107,13 +106,11 @@ PatternData* RenderSVGResourcePattern::buildPattern(RenderObject* object, const
// Various calls above may trigger invalidations in some fringe cases (ImageBuffer allocation
// failures in the SVG image cache for example). To avoid having our PatternData deleted by
// removeAllClientsFromCache(), we only make it visible in the cache at the very end.
- return m_patternMap.set(object, patternData.release()).storedValue->value.get();
+ return m_patternMap.set(&object, patternData.release()).storedValue->value.get();
}
-SVGPaintServer RenderSVGResourcePattern::preparePaintServer(RenderObject* object)
+SVGPaintServer RenderSVGResourcePattern::preparePaintServer(const RenderObject& object)
{
- ASSERT(object);
-
clearInvalidationMask();
SVGPatternElement* patternElement = toSVGPatternElement(element());
@@ -130,7 +127,7 @@ SVGPaintServer RenderSVGResourcePattern::preparePaintServer(RenderObject* object
// Spec: When the geometry of the applicable element has no width or height and objectBoundingBox is specified,
// then the given effect (e.g. a gradient or a filter) will be ignored.
- FloatRect objectBoundingBox = object->objectBoundingBox();
+ FloatRect objectBoundingBox = object.objectBoundingBox();
if (m_attributes.patternUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX && objectBoundingBox.isEmpty())
return SVGPaintServer::invalid();
@@ -151,16 +148,15 @@ static inline FloatRect calculatePatternBoundaries(const PatternAttributes& attr
return SVGLengthContext::resolveRectangle(patternElement, attributes.patternUnits(), objectBoundingBox, attributes.x(), attributes.y(), attributes.width(), attributes.height());
}
-bool RenderSVGResourcePattern::buildTileImageTransform(RenderObject* renderer,
+bool RenderSVGResourcePattern::buildTileImageTransform(const RenderObject& renderer,
const PatternAttributes& attributes,
const SVGPatternElement* patternElement,
FloatRect& patternBoundaries,
AffineTransform& tileImageTransform) const
{
- ASSERT(renderer);
ASSERT(patternElement);
- FloatRect objectBoundingBox = renderer->objectBoundingBox();
+ FloatRect objectBoundingBox = renderer.objectBoundingBox();
patternBoundaries = calculatePatternBoundaries(attributes, objectBoundingBox, patternElement);
if (patternBoundaries.width() <= 0 || patternBoundaries.height() <= 0)
return false;
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourcePattern.h ('k') | Source/core/rendering/svg/RenderSVGResourceSolidColor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698