diff options
author | 2014-12-15 13:27:26 -0800 | |
---|---|---|
committer | 2014-12-15 13:27:26 -0800 | |
commit | 8893e5f030cb2f6c3bdf698c1767a244ae098a5c (patch) | |
tree | fffcf4764dec0e269a0abb9cb92aec5186aacea3 /include | |
parent | caaf8e611d4cf373218bae21371cf8cdb3c2c574 (diff) |
add paint::getFontBounds()
BUG=skia:
Review URL: https://codereview.chromium.org/804903006
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkPaint.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index 464c6b2470..68220f65c9 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -921,6 +921,14 @@ public: void getPosTextPath(const void* text, size_t length, const SkPoint pos[], SkPath* path) const; + /** + * Return a rectangle that represents the union of the bounds of all + * of the glyphs, but each one positioned at (0,0). This may be conservatively large, and + * will not take into account any hinting, but will respect any text-scale-x or text-skew-x + * on this paint. + */ + SkRect getFontBounds() const; + // returns true if the paint's settings (e.g. xfermode + alpha) resolve to // mean that we need not draw at all (e.g. SrcOver + 0-alpha) bool nothingToDraw() const; |