diff options
author | herb <herb@google.com> | 2015-02-27 07:22:48 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-27 07:22:48 -0800 |
commit | e70de9e4f0b7bf73f7cd1a20dbabcb233ffbb7f1 (patch) | |
tree | 5a0d85a81aafd177425ee74cae31324bacd2054b /src/core/SkGlyph.h | |
parent | 574290f61a47bd1ce1f9e2d941533bda9c8f03fe (diff) |
Make the glyph array entries inline.
Perf Reports
bin/c --match nytimes --config 8888
desk_nytimes.skp_1_mpd 1.41ms -> 1.38ms 0.98x
desk_nytimes.skp_1 1.94ms -> 1.87ms 0.97x
bin/c --match nytimes --config gpu
desk_nytimes.skp_1_mpd 1.63ms -> 1.59ms 0.97x
desk_nytimes.skp_1 1.56ms -> 1.5ms 0.97x
Here are results from mac instruments:
--match nytimes --config gpu --samples 10000 --skps /Users/herb/src/skia/skps
Inline:
Total Samples Running Time Self Symbol Name
94335 94335.0ms 98.3% 0.0 start
2365 2365.0ms 2.4% 2365.0 SkGlyphCache::getGlyphIDMetrics(unsigned short, int, int)
975 975.0ms 1.0% 975.0 SkGlyphCache::lookupMetrics(unsigned int, SkGlyphCache::MetricsType)
Clean:
Total Samples Running Time Self Symbol Name
96833 96833.0ms 97.3% 0.0 start
3418 3418.0ms 3.4% 3418.0 SkGlyphCache::getGlyphIDMetrics(unsigned short, int, int)
1961 1961.0ms 1.9% 1961.0 SkGlyphCache::lookupMetrics(unsigned int, SkGlyphCache::MetricsType)
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/4c08f16b252a55e438a61f26e5581394ed177da1
Committed: https://skia.googlesource.com/skia/+/b4c29ac173e6f8844327338687248b98bc94132d
Review URL: https://codereview.chromium.org/885903002
Diffstat (limited to 'src/core/SkGlyph.h')
-rw-r--r-- | src/core/SkGlyph.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/SkGlyph.h b/src/core/SkGlyph.h index 25aaed77a6..48b9815a03 100644 --- a/src/core/SkGlyph.h +++ b/src/core/SkGlyph.h @@ -53,6 +53,10 @@ class SkGlyph { this->initCommon(glyph.fID); } + void initGlyphFromCombinedID(uint32_t combined_id) { + this->initCommon(combined_id); + } + /** * Compute the rowbytes for the specified width and mask-format. */ @@ -106,7 +110,6 @@ class SkGlyph { */ void zeroMetrics(); - void toMask(SkMask* mask) const; private: @@ -120,8 +123,9 @@ class SkGlyph { fMaskFormat = MASK_FORMAT_UNKNOWN; fForceBW = 0; } + static unsigned ID2Code(uint32_t id) { - return (id & kCodeMask); + return id & kCodeMask; } static unsigned ID2SubX(uint32_t id) { @@ -142,6 +146,7 @@ class SkGlyph { } static uint32_t MakeID(unsigned code) { + SkASSERT(code <= kCodeMask); return code; } @@ -150,8 +155,8 @@ class SkGlyph { x = FixedToSub(x); y = FixedToSub(y); return (x << (kSubShift + kSubShiftX)) | - (y << (kSubShift + kSubShiftY)) | - code; + (y << (kSubShift + kSubShiftY)) | + code; } // FIXME - This is needed because the Android frame work directly |