diff options
author | joshualitt <joshualitt@chromium.org> | 2015-07-17 06:19:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-17 06:19:19 -0700 |
commit | 73d5de5763b4813c87e523adf2002ab48d3f4278 (patch) | |
tree | d775c805c1579fc13c355a28b727630476c51201 /src/gpu/GrFontScaler.h | |
parent | 91110195a2eee170c11885da9d16f94b00a39f87 (diff) |
Cleanup of GrFontDescKey
BUG=skia:
Review URL: https://codereview.chromium.org/1238473004
Diffstat (limited to 'src/gpu/GrFontScaler.h')
-rw-r--r-- | src/gpu/GrFontScaler.h | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/gpu/GrFontScaler.h b/src/gpu/GrFontScaler.h index 5e769905d0..644c8b719e 100644 --- a/src/gpu/GrFontScaler.h +++ b/src/gpu/GrFontScaler.h @@ -21,33 +21,17 @@ class SkPath; */ class GrFontDescKey : public SkRefCnt { public: + explicit GrFontDescKey(const SkDescriptor& desc) : fDesc(desc), fHash(desc.getChecksum()) {} - - typedef uint32_t Hash; - - explicit GrFontDescKey(const SkDescriptor& desc); - virtual ~GrFontDescKey(); - - Hash getHash() const { return fHash; } - - bool operator<(const GrFontDescKey& rh) const { - return fHash < rh.fHash || (fHash == rh.fHash && this->lt(rh)); - } + uint32_t getHash() const { return fHash; } + bool operator==(const GrFontDescKey& rh) const { - return fHash == rh.fHash && this->eq(rh); + return fHash == rh.fHash && fDesc.getDesc()->equals(*rh.fDesc.getDesc()); } private: - // helper functions for comparisons - bool lt(const GrFontDescKey& rh) const; - bool eq(const GrFontDescKey& rh) const; - - SkDescriptor* fDesc; - enum { - kMaxStorageInts = 16 - }; - uint32_t fStorage[kMaxStorageInts]; - const Hash fHash; + SkAutoDescriptor fDesc; + uint32_t fHash; typedef SkRefCnt INHERITED; }; @@ -60,8 +44,6 @@ private: */ class GrFontScaler : public SkRefCnt { public: - - explicit GrFontScaler(SkGlyphCache* strike); virtual ~GrFontScaler(); |