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

Unified Diff: Source/core/layout/LayoutBlockFlowLine.cpp

Issue 1228633002: Remove unnecessary LayoutUnit -> float -> LayoutUnit conversions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | « no previous file | Source/core/layout/line/InlineFlowBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlockFlowLine.cpp
diff --git a/Source/core/layout/LayoutBlockFlowLine.cpp b/Source/core/layout/LayoutBlockFlowLine.cpp
index c2563764e98d71eb0fa3ef23a2397ac23cbc5493..1d189ddccab1d044d75a8423c348d63416da01e2 100644
--- a/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -625,7 +625,7 @@ BidiRun* LayoutBlockFlow::computeInlineDirectionPositionsForSegment(RootInlineBo
LayoutBox* layoutBox = toLayoutBox(r->m_object);
if (layoutBox->isRubyRun())
setMarginsForRubyRun(r, toLayoutRubyRun(layoutBox), previousObject, lineInfo);
- r->m_box->setLogicalWidth(logicalWidthForChild(*layoutBox).toFloat());
+ r->m_box->setLogicalWidth(logicalWidthForChild(*layoutBox));
totalLogicalWidth += marginStartForChild(*layoutBox) + marginEndForChild(*layoutBox);
needsWordSpacing = true;
}
@@ -661,7 +661,7 @@ void LayoutBlockFlow::computeBlockDirectionPositionsForLine(RootInlineBox* lineB
// Align positioned boxes with the top of the line box. This is
// a reasonable approximation of an appropriate y position.
if (r->m_object->isOutOfFlowPositioned())
- r->m_box->setLogicalTop(logicalHeight().toFloat());
+ r->m_box->setLogicalTop(logicalHeight());
// Position is used to properly position both replaced elements and
// to update the static normal flow x/y of positioned elements.
@@ -862,7 +862,7 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState,
adjustLinePositionForPagination(*lineBox, adjustment, layoutState.flowThread());
if (adjustment) {
LayoutUnit oldLineWidth = availableLogicalWidthForLine(oldLogicalHeight, layoutState.lineInfo().isFirstLine());
- lineBox->moveInBlockDirection(adjustment.toFloat());
+ lineBox->moveInBlockDirection(adjustment);
if (layoutState.usesPaintInvalidationBounds())
layoutState.updatePaintInvalidationRangeFromBox(lineBox);
@@ -992,7 +992,7 @@ void LayoutBlockFlow::linkToEndLineIfNeeded(LineLayoutState& layoutState)
}
if (delta) {
layoutState.updatePaintInvalidationRangeFromBox(line, delta);
- line->moveInBlockDirection(delta.toFloat());
+ line->moveInBlockDirection(delta);
}
if (Vector<LayoutBox*>* cleanLineFloats = line->floatsPtr()) {
for (auto* box : *cleanLineFloats) {
@@ -1496,8 +1496,8 @@ void LayoutBlockFlow::computeInlinePreferredLogicalWidths(LayoutUnit& minLogical
if (styleToUse.collapseWhiteSpace())
stripTrailingSpace(inlineMax, inlineMin, trailingSpaceChild);
- minLogicalWidth = std::max(minLogicalWidth, LayoutUnit::fromFloatCeil(inlineMin.toFloat()));
- maxLogicalWidth = std::max(maxLogicalWidth, LayoutUnit::fromFloatCeil(inlineMax.toFloat()));
+ minLogicalWidth = std::max(minLogicalWidth, inlineMin);
+ maxLogicalWidth = std::max(maxLogicalWidth, inlineMax);
}
void LayoutBlockFlow::layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidationLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge)
@@ -1658,7 +1658,7 @@ RootInlineBox* LayoutBlockFlow::determineStartPosition(LineLayoutState& layoutSt
}
layoutState.updatePaintInvalidationRangeFromBox(curr, paginationDelta);
- curr->moveInBlockDirection(paginationDelta.toFloat());
+ curr->moveInBlockDirection(paginationDelta);
}
}
@@ -1921,7 +1921,7 @@ void LayoutBlockFlow::deleteEllipsisLineBoxes()
curr->clearTruncation();
// Shift the line back where it belongs if we cannot accomodate an ellipsis.
- LayoutUnit logicalLeft = logicalLeftOffsetForLine(curr->lineTop(), firstLine).toFloat();
+ LayoutUnit logicalLeft = logicalLeftOffsetForLine(curr->lineTop(), firstLine);
LayoutUnit availableLogicalWidth = logicalRightOffsetForLine(curr->lineTop(), false) - logicalLeft;
LayoutUnit totalLogicalWidth = curr->logicalWidth();
updateLogicalWidthForAlignment(textAlign, curr, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
« no previous file with comments | « no previous file | Source/core/layout/line/InlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698