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

Unified Diff: sky/engine/core/rendering/line/LineWidth.cpp

Issue 706953003: Delete unused methods/arguments from RenderBlockFlow. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/rendering/line/LineWidth.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/line/LineWidth.cpp
diff --git a/sky/engine/core/rendering/line/LineWidth.cpp b/sky/engine/core/rendering/line/LineWidth.cpp
index c33a9c5ba5fce821e910c8c7b76a6de9fcd34599..3b17cb3e4f9b5d1fbd2c64748667674904f0d579 100644
--- a/sky/engine/core/rendering/line/LineWidth.cpp
+++ b/sky/engine/core/rendering/line/LineWidth.cpp
@@ -43,19 +43,15 @@ LineWidth::LineWidth(RenderBlockFlow& block, bool isFirstLine, IndentTextOrNot s
, m_left(0)
, m_right(0)
, m_availableWidth(0)
- , m_isFirstLine(isFirstLine)
, m_shouldIndentText(shouldIndentText)
{
updateAvailableWidth();
}
-void LineWidth::updateAvailableWidth(LayoutUnit replacedHeight)
+void LineWidth::updateAvailableWidth()
{
- LayoutUnit height = m_block.logicalHeight();
- LayoutUnit logicalHeight = m_block.minLineHeightForReplacedRenderer(m_isFirstLine, replacedHeight);
- m_left = m_block.logicalLeftOffsetForLine(height, shouldIndentText(), logicalHeight).toFloat();
- m_right = m_block.logicalRightOffsetForLine(height, shouldIndentText(), logicalHeight).toFloat();
-
+ m_left = m_block.logicalLeftOffsetForLine(shouldIndentText()).toFloat();
+ m_right = m_block.logicalRightOffsetForLine(shouldIndentText()).toFloat();
computeAvailableWidthFromLeftAndRight();
}
@@ -65,13 +61,6 @@ void LineWidth::commit()
m_uncommittedWidth = 0;
}
-inline static float availableWidthAtOffset(const RenderBlockFlow& block, const LayoutUnit& offset, bool shouldIndentText, float& newLineLeft, float& newLineRight)
-{
- newLineLeft = block.logicalLeftOffsetForLine(offset, shouldIndentText).toFloat();
- newLineRight = block.logicalRightOffsetForLine(offset, shouldIndentText).toFloat();
- return std::max(0.0f, newLineRight - newLineLeft);
-}
-
void LineWidth::updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWidth, const float& newLineLeft, const float& newLineRight)
{
if (newLineWidth <= m_availableWidth)
@@ -100,7 +89,10 @@ void LineWidth::fitBelowFloats(bool isFirstLine)
if (floatLogicalBottom <= lastFloatLogicalBottom)
break;
- newLineWidth = availableWidthAtOffset(m_block, floatLogicalBottom, shouldIndentText(), newLineLeft, newLineRight);
+ newLineLeft = m_block.logicalLeftOffsetForLine(shouldIndentText()).toFloat();
+ newLineRight = m_block.logicalRightOffsetForLine(shouldIndentText()).toFloat();
+ newLineWidth = std::max(0.0f, newLineRight - newLineLeft);
+
lastFloatLogicalBottom = floatLogicalBottom;
if (newLineWidth >= m_uncommittedWidth)
« no previous file with comments | « sky/engine/core/rendering/line/LineWidth.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698