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

Unified Diff: Source/core/rendering/shapes/ShapeInsideInfo.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/ShapeInsideInfo.h ('k') | Source/core/rendering/shapes/ShapeOutsideInfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/shapes/ShapeInsideInfo.cpp
diff --git a/Source/core/rendering/shapes/ShapeInsideInfo.cpp b/Source/core/rendering/shapes/ShapeInsideInfo.cpp
index f912831f7f224878e5c5c969a600f00feed186cf..3da79e5c4df477d0fcde65160fb0adff04ac953d 100644
--- a/Source/core/rendering/shapes/ShapeInsideInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeInsideInfo.cpp
@@ -41,9 +41,9 @@ LineSegmentRange::LineSegmentRange(const InlineIterator& start, const InlineIter
{
}
-bool ShapeInsideInfo::isEnabledFor(const RenderBlock* renderer)
+bool ShapeInsideInfo::isEnabledFor(const RenderBlock& renderer)
{
- ShapeValue* shapeValue = renderer->style()->resolvedShapeInside();
+ ShapeValue* shapeValue = renderer.style()->resolvedShapeInside();
if (!shapeValue)
return false;
@@ -51,7 +51,7 @@ bool ShapeInsideInfo::isEnabledFor(const RenderBlock* renderer)
case ShapeValue::Shape:
return shapeValue->shape() && shapeValue->shape()->type() != BasicShape::BasicShapeInsetRectangleType && shapeValue->shape()->type() != BasicShape::BasicShapeInsetType;
case ShapeValue::Image:
- return shapeValue->isImageValid() && checkShapeImageOrigin(renderer->document(), *(shapeValue->image()->cachedImage()));
+ return shapeValue->isImageValid() && checkShapeImageOrigin(renderer.document(), *(shapeValue->image()->cachedImage()));
case ShapeValue::Box:
return true;
case ShapeValue::Outside:
@@ -87,12 +87,12 @@ bool ShapeInsideInfo::updateSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineH
bool ShapeInsideInfo::adjustLogicalLineTop(float minSegmentWidth)
{
- const Shape* shape = computedShape();
- if (!shape || m_lineHeight <= 0 || logicalLineTop() > shapeLogicalBottom())
+ const Shape& shape = computedShape();
+ if (m_lineHeight <= 0 || logicalLineTop() > shapeLogicalBottom())
return false;
LayoutUnit newLineTop;
- if (shape->firstIncludedIntervalLogicalTop(m_referenceBoxLineTop, FloatSize(minSegmentWidth, m_lineHeight), newLineTop)) {
+ if (shape.firstIncludedIntervalLogicalTop(m_referenceBoxLineTop, FloatSize(minSegmentWidth, m_lineHeight), newLineTop)) {
if (newLineTop > m_referenceBoxLineTop) {
m_referenceBoxLineTop = newLineTop;
return true;
@@ -104,16 +104,16 @@ bool ShapeInsideInfo::adjustLogicalLineTop(float minSegmentWidth)
ShapeValue* ShapeInsideInfo::shapeValue() const
{
- return m_renderer->style()->resolvedShapeInside();
+ return m_renderer.style()->resolvedShapeInside();
}
LayoutUnit ShapeInsideInfo::computeFirstFitPositionForFloat(const FloatSize& floatSize) const
{
- if (!computedShape() || !floatSize.width() || shapeLogicalBottom() < logicalLineTop())
+ if (!floatSize.width() || shapeLogicalBottom() < logicalLineTop())
return 0;
LayoutUnit firstFitPosition = 0;
- if (computedShape()->firstIncludedIntervalLogicalTop(m_referenceBoxLineTop, floatSize, firstFitPosition) && (m_referenceBoxLineTop <= firstFitPosition))
+ if (computedShape().firstIncludedIntervalLogicalTop(m_referenceBoxLineTop, floatSize, firstFitPosition) && (m_referenceBoxLineTop <= firstFitPosition))
return firstFitPosition;
return 0;
« no previous file with comments | « Source/core/rendering/shapes/ShapeInsideInfo.h ('k') | Source/core/rendering/shapes/ShapeOutsideInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698