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

Unified Diff: Source/core/rendering/shapes/ShapeOutsideInfo.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/ShapeOutsideInfo.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/shapes/ShapeOutsideInfo.cpp
diff --git a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
index 2ca83f7274dcdceff437f1e32d00bc82f1d65f2e..efe973ed8852af3d53020b42c8a26dbf23ac24db 100644
--- a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
@@ -35,17 +35,17 @@
#include "core/rendering/RenderBox.h"
namespace WebCore {
-bool ShapeOutsideInfo::isEnabledFor(const RenderBox* box)
+bool ShapeOutsideInfo::isEnabledFor(const RenderBox& box)
{
- ShapeValue* shapeValue = box->style()->shapeOutside();
- if (!box->isFloating() || !shapeValue)
+ ShapeValue* shapeValue = box.style()->shapeOutside();
+ if (!box.isFloating() || !shapeValue)
return false;
switch (shapeValue->type()) {
case ShapeValue::Shape:
return shapeValue->shape();
case ShapeValue::Image:
- return shapeValue->isImageValid() && checkShapeImageOrigin(box->document(), *(shapeValue->image()->cachedImage()));
+ return shapeValue->isImageValid() && checkShapeImageOrigin(box.document(), *(shapeValue->image()->cachedImage()));
case ShapeValue::Box:
return true;
case ShapeValue::Outside:
@@ -55,9 +55,9 @@ bool ShapeOutsideInfo::isEnabledFor(const RenderBox* box)
return false;
}
-void ShapeOutsideInfo::updateDeltasForContainingBlockLine(const RenderBlockFlow* containingBlock, const FloatingObject* floatingObject, LayoutUnit lineTop, LayoutUnit lineHeight)
+void ShapeOutsideInfo::updateDeltasForContainingBlockLine(const RenderBlockFlow& containingBlock, const FloatingObject& floatingObject, LayoutUnit lineTop, LayoutUnit lineHeight)
{
- LayoutUnit borderBoxTop = containingBlock->logicalTopForFloat(floatingObject) + std::max(LayoutUnit(), containingBlock->marginBeforeForChild(m_renderer));
+ LayoutUnit borderBoxTop = containingBlock.logicalTopForFloat(&floatingObject) + std::max(LayoutUnit(), containingBlock.marginBeforeForChild(&m_renderer));
LayoutUnit borderBoxLineTop = lineTop - borderBoxTop;
if (isShapeDirty() || m_borderBoxLineTop != borderBoxLineTop || m_lineHeight != lineHeight) {
@@ -65,15 +65,15 @@ void ShapeOutsideInfo::updateDeltasForContainingBlockLine(const RenderBlockFlow*
m_referenceBoxLineTop = borderBoxLineTop - logicalTopOffset();
m_lineHeight = lineHeight;
- LayoutUnit floatMarginBoxWidth = containingBlock->logicalWidthForFloat(floatingObject);
+ LayoutUnit floatMarginBoxWidth = containingBlock.logicalWidthForFloat(&floatingObject);
if (lineOverlapsShapeBounds()) {
SegmentList segments = computeSegmentsForLine(borderBoxLineTop, lineHeight);
if (segments.size()) {
- LayoutUnit rawLeftMarginBoxDelta = segments.first().logicalLeft + containingBlock->marginStartForChild(m_renderer);
+ LayoutUnit rawLeftMarginBoxDelta = segments.first().logicalLeft + containingBlock.marginStartForChild(&m_renderer);
m_leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMarginBoxDelta, LayoutUnit(), floatMarginBoxWidth);
- LayoutUnit rawRightMarginBoxDelta = segments.last().logicalRight - containingBlock->logicalWidthForChild(m_renderer) - containingBlock->marginEndForChild(m_renderer);
+ LayoutUnit rawRightMarginBoxDelta = segments.last().logicalRight - containingBlock.logicalWidthForChild(&m_renderer) - containingBlock.marginEndForChild(&m_renderer);
m_rightMarginBoxDelta = clampTo<LayoutUnit>(rawRightMarginBoxDelta, -floatMarginBoxWidth, LayoutUnit());
m_lineOverlapsShape = true;
return;
@@ -91,7 +91,7 @@ void ShapeOutsideInfo::updateDeltasForContainingBlockLine(const RenderBlockFlow*
ShapeValue* ShapeOutsideInfo::shapeValue() const
{
- return m_renderer->style()->shapeOutside();
+ return m_renderer.style()->shapeOutside();
}
}
« no previous file with comments | « Source/core/rendering/shapes/ShapeOutsideInfo.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698