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

Unified Diff: Source/core/rendering/shapes/ShapeInfo.cpp

Issue 178473024: Convert some Shape code to use references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased patch Created 6 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/rendering/shapes/ShapeInfo.h ('k') | Source/core/rendering/shapes/ShapeInsideInfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/shapes/ShapeInfo.cpp
diff --git a/Source/core/rendering/shapes/ShapeInfo.cpp b/Source/core/rendering/shapes/ShapeInfo.cpp
index 4824738b65fbc9bf25838ce139a4baad3bd0f153..58bac8ff41c688ca75693d28550de826bd7288a2 100644
--- a/Source/core/rendering/shapes/ShapeInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeInfo.cpp
@@ -58,15 +58,15 @@ static LayoutRect getShapeImageRect(const StyleImage& styleImage, const RenderBo
}
template<class RenderType>
-const Shape* ShapeInfo<RenderType>::computedShape() const
+const Shape& ShapeInfo<RenderType>::computedShape() const
{
if (Shape* shape = m_shape.get())
- return shape;
+ return *shape;
- WritingMode writingMode = m_renderer->style()->writingMode();
- Length margin = m_renderer->style()->shapeMargin();
- Length padding = m_renderer->style()->shapePadding();
- float shapeImageThreshold = m_renderer->style()->shapeImageThreshold();
+ WritingMode writingMode = m_renderer.style()->writingMode();
+ Length margin = m_renderer.style()->shapeMargin();
+ Length padding = m_renderer.style()->shapePadding();
+ float shapeImageThreshold = m_renderer.style()->shapeImageThreshold();
const ShapeValue* shapeValue = this->shapeValue();
ASSERT(shapeValue);
@@ -78,11 +78,11 @@ const Shape* ShapeInfo<RenderType>::computedShape() const
case ShapeValue::Image: {
ASSERT(shapeValue->image());
const StyleImage& styleImage = *(shapeValue->image());
- m_shape = Shape::createRasterShape(styleImage, shapeImageThreshold, getShapeImageRect(styleImage, m_renderer), m_referenceBoxLogicalSize, writingMode, margin, padding);
+ m_shape = Shape::createRasterShape(styleImage, shapeImageThreshold, getShapeImageRect(styleImage, &m_renderer), m_referenceBoxLogicalSize, writingMode, margin, padding);
break;
}
case ShapeValue::Box: {
- const RoundedRect& shapeRect = m_renderer->style()->getRoundedBorderFor(LayoutRect(LayoutPoint(), m_referenceBoxLogicalSize), m_renderer->view());
+ const RoundedRect& shapeRect = m_renderer.style()->getRoundedBorderFor(LayoutRect(LayoutPoint(), m_referenceBoxLogicalSize), m_renderer.view());
m_shape = Shape::createLayoutBoxShape(shapeRect, writingMode, margin, padding);
break;
}
@@ -92,7 +92,7 @@ const Shape* ShapeInfo<RenderType>::computedShape() const
}
ASSERT(m_shape);
- return m_shape.get();
+ return *m_shape;
}
template<class RenderType>
« no previous file with comments | « Source/core/rendering/shapes/ShapeInfo.h ('k') | Source/core/rendering/shapes/ShapeInsideInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698