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

Unified Diff: Source/platform/fonts/Font.h

Issue 519373002: Return width from drawText to stop re-measure in Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updating Test Expectation file Created 6 years, 3 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 | « LayoutTests/fast/canvas/canvas-drawtext-width-return.html ('k') | Source/platform/fonts/Font.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/Font.h
diff --git a/Source/platform/fonts/Font.h b/Source/platform/fonts/Font.h
index 832ddad4cb2cd9070c65d9129c66064b09da4670..212811d27faf0979840c5bd447e60cda27a58f19 100644
--- a/Source/platform/fonts/Font.h
+++ b/Source/platform/fonts/Font.h
@@ -100,7 +100,7 @@ public:
void update(PassRefPtrWillBeRawPtr<FontSelector>) const;
enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontNotReady };
- void drawText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
+ float drawText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&) const;
float width(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
@@ -140,10 +140,10 @@ private:
// Returns the initial in-stream advance.
float getGlyphsAndAdvancesForSimpleText(const TextRunPaintInfo&, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const;
- void drawSimpleText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&) const;
+ float drawSimpleText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&) const;
void drawEmphasisMarksForSimpleText(GraphicsContext*, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&) const;
void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&, const FloatRect& textRect) const;
- void drawGlyphBuffer(GraphicsContext*, const TextRunPaintInfo&, const GlyphBuffer&, const FloatPoint&) const;
+ float drawGlyphBuffer(GraphicsContext*, const TextRunPaintInfo&, const GlyphBuffer&, const FloatPoint&) const;
void drawTextBlob(GraphicsContext*, const SkTextBlob*, const SkPoint& origin) const;
void drawEmphasisMarks(GraphicsContext*, const TextRunPaintInfo&, const GlyphBuffer&, const AtomicString&, const FloatPoint&) const;
float floatWidthForSimpleText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, IntRectExtent* glyphBounds = 0) const;
@@ -154,7 +154,7 @@ private:
// Returns the initial in-stream advance.
float getGlyphsAndAdvancesForComplexText(const TextRunPaintInfo&, GlyphBuffer&, ForTextEmphasisOrNot = NotForTextEmphasis) const;
- void drawComplexText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&) const;
+ float drawComplexText(GraphicsContext*, const TextRunPaintInfo&, const FloatPoint&) const;
void drawEmphasisMarksForComplexText(GraphicsContext*, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&) const;
float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts, IntRectExtent* glyphBounds) const;
int offsetForPositionForComplexText(const TextRun&, float position, bool includePartialGlyphs) const;
@@ -187,7 +187,7 @@ private:
return m_fontFallbackList && m_fontFallbackList->shouldSkipDrawing();
}
- PassTextBlobPtr buildTextBlob(const GlyphBuffer&, float initialAdvance, const FloatRect& bounds) const;
+ PassTextBlobPtr buildTextBlob(const GlyphBuffer&, float initialAdvance, const FloatRect& bounds, float& advance) const;
FontDescription m_fontDescription;
mutable RefPtr<FontFallbackList> m_fontFallbackList;
« no previous file with comments | « LayoutTests/fast/canvas/canvas-drawtext-width-return.html ('k') | Source/platform/fonts/Font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698