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

Unified Diff: src/gpu/GrFontScaler.h

Issue 1238473004: Cleanup of GrFontDescKey (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 | « src/core/SkDescriptor.h ('k') | src/gpu/GrFontScaler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrFontScaler.h
diff --git a/src/gpu/GrFontScaler.h b/src/gpu/GrFontScaler.h
index 5e769905d012134b879427435c24058573f6032e..644c8b719e3cccec7e770c254b0dacf47aee1bf5 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();
« no previous file with comments | « src/core/SkDescriptor.h ('k') | src/gpu/GrFontScaler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698