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

Unified Diff: Source/core/rendering/InlineTextBox.h

Issue 699683002: Continue with InlineBox float->LayoutUnit migration. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nit 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 | « Source/core/rendering/InlineFlowBox.cpp ('k') | Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineTextBox.h
diff --git a/Source/core/rendering/InlineTextBox.h b/Source/core/rendering/InlineTextBox.h
index 34d76bd23737486127122db9841bf40a95ec0e3b..c01cb95d328857532e62c86a265322219b1b1227 100644
--- a/Source/core/rendering/InlineTextBox.h
+++ b/Source/core/rendering/InlineTextBox.h
@@ -23,6 +23,7 @@
#ifndef InlineTextBox_h
#define InlineTextBox_h
+#include "core/rendering/FloatToLayoutUnit.h"
#include "core/rendering/InlineBox.h"
#include "core/rendering/RenderText.h" // so textRenderer() can be inline
#include "platform/fonts/TextBlob.h"
@@ -97,19 +98,19 @@ public:
#endif
enum RotationDirection { Counterclockwise, Clockwise };
- static AffineTransform rotation(const FloatRect& boxRect, RotationDirection);
+ static AffineTransform rotation(const FloatRectWillBeLayoutRect& boxRect, RotationDirection);
public:
TextRun constructTextRunForInspector(RenderStyle*, const Font&) const;
- virtual FloatRect calculateBoundaries() const override { return FloatRect(x(), y(), width(), height()); }
+ virtual FloatRectWillBeLayoutRect calculateBoundaries() const override { return FloatRectWillBeLayoutRect(x(), y(), width(), height()); }
virtual LayoutRect localSelectionRect(int startPos, int endPos);
bool isSelected(int startPos, int endPos) const;
void selectionStartEnd(int& sPos, int& ePos) const;
// These functions both paint markers and update the DocumentMarker's renderedRect.
- virtual void paintDocumentMarker(GraphicsContext*, const FloatPoint& boxOrigin, DocumentMarker*, RenderStyle*, const Font&, bool grammar);
- virtual void paintTextMatchMarker(GraphicsContext*, const FloatPoint& boxOrigin, DocumentMarker*, RenderStyle*, const Font&);
+ virtual void paintDocumentMarker(GraphicsContext*, const FloatPointWillBeLayoutPoint& boxOrigin, DocumentMarker*, RenderStyle*, const Font&, bool grammar);
+ virtual void paintTextMatchMarker(GraphicsContext*, const FloatPointWillBeLayoutPoint& boxOrigin, DocumentMarker*, RenderStyle*, const Font&);
protected:
virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override;
@@ -125,7 +126,7 @@ public:
private:
virtual void clearTruncation() override final { m_truncation = cNoTruncation; }
- virtual float placeEllipsisBox(bool flowIsLTR, float visibleLeftEdge, float visibleRightEdge, float ellipsisWidth, float &truncatedWidth, bool& foundBox) override final;
+ virtual FloatWillBeLayoutUnit placeEllipsisBox(bool flowIsLTR, FloatWillBeLayoutUnit visibleLeftEdge, FloatWillBeLayoutUnit visibleRightEdge, FloatWillBeLayoutUnit ellipsisWidth, FloatWillBeLayoutUnit &truncatedWidth, bool& foundBox) override final;
public:
virtual bool isLineBreak() const override final;
@@ -144,16 +145,16 @@ public:
virtual int caretMinOffset() const override final;
virtual int caretMaxOffset() const override final;
- float textPos() const; // returns the x position relative to the left start of the text line.
+ FloatWillBeLayoutUnit textPos() const; // returns the x position relative to the left start of the text line.
public:
- virtual int offsetForPosition(float x, bool includePartialGlyphs = true) const;
- virtual float positionForOffset(int offset) const;
+ virtual int offsetForPosition(FloatWillBeLayoutUnit x, bool includePartialGlyphs = true) const;
+ virtual FloatWillBeLayoutUnit positionForOffset(int offset) const;
bool containsCaretOffset(int offset) const; // false for offset after line break
// Fills a vector with the pixel width of each character.
- void characterWidths(Vector<float>&) const;
+ void characterWidths(Vector<FloatWillBeLayoutUnit>&) const;
private:
InlineTextBox* m_prevTextBox; // The previous box that also uses our RenderObject
@@ -175,9 +176,9 @@ private:
DEFINE_INLINE_BOX_TYPE_CASTS(InlineTextBox);
-void alignSelectionRectToDevicePixels(FloatRect&);
+void alignSelectionRectToDevicePixels(FloatRectWillBeLayoutRect&);
-inline AffineTransform InlineTextBox::rotation(const FloatRect& boxRect, RotationDirection rotationDirection)
+inline AffineTransform InlineTextBox::rotation(const FloatRectWillBeLayoutRect& boxRect, RotationDirection rotationDirection)
{
return rotationDirection == Clockwise ? AffineTransform(0, 1, -1, 0, boxRect.x() + boxRect.maxY(), boxRect.maxY() - boxRect.x())
: AffineTransform(0, -1, 1, 0, boxRect.x() - boxRect.maxY(), boxRect.x() + boxRect.maxY());
« no previous file with comments | « Source/core/rendering/InlineFlowBox.cpp ('k') | Source/core/rendering/InlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698