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

Unified Diff: cc/font_atlas.h

Issue 11272042: improvements of the FPS counter in the HUDLayer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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 | cc/font_atlas.cc » ('j') | cc/font_atlas.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/font_atlas.h
diff --git a/cc/font_atlas.h b/cc/font_atlas.h
index f9baea14fc2b8963457cd728e3052c11c28bbb24..8bacdaac6714894337eb1cf2db379cd610fa8082 100644
--- a/cc/font_atlas.h
+++ b/cc/font_atlas.h
@@ -31,6 +31,9 @@ public:
}
~FontAtlas();
+ // Current font height.
+ int fontHeight() const { return m_fontHeight; }
+
// Draws multiple lines of text where each line of text is separated by '\n'.
// - Correct glyphs will be drawn for ASCII codes in the range 32-127; any characters
// outside that range will be displayed as a default rectangle glyph.
@@ -39,6 +42,9 @@ public:
// - Should only be called only on the impl thread.
void drawText(SkCanvas*, const SkPaint&, const std::string& text, const gfx::Point& destPosition, const IntSize& clip) const;
+ // Gives a text's width and height on the canvas.
+ IntSize textSize(const std::string& text);
+
// Draws the entire atlas at the specified position, just for debugging purposes.
void drawDebugAtlas(SkCanvas*, const gfx::Point& destPosition) const;
« no previous file with comments | « no previous file | cc/font_atlas.cc » ('j') | cc/font_atlas.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698