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

Unified Diff: src/gpu/GrFontScaler.cpp

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/gpu/GrFontScaler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrFontScaler.cpp
diff --git a/src/gpu/GrFontScaler.cpp b/src/gpu/GrFontScaler.cpp
index ed1970e262a65308490bb248babc9595adc53758..364944eef9359bd4cc99189582c96916eb2864f0 100644
--- a/src/gpu/GrFontScaler.cpp
+++ b/src/gpu/GrFontScaler.cpp
@@ -15,41 +15,6 @@
///////////////////////////////////////////////////////////////////////////////
-GrFontDescKey::GrFontDescKey(const SkDescriptor& desc) : fHash(desc.getChecksum()) {
- size_t size = desc.getLength();
- if (size <= sizeof(fStorage)) {
- fDesc = GrTCast<SkDescriptor*>(fStorage);
- } else {
- fDesc = SkDescriptor::Alloc(size);
- }
- memcpy(fDesc, &desc, size);
-}
-
-GrFontDescKey::~GrFontDescKey() {
- if (fDesc != GrTCast<SkDescriptor*>(fStorage)) {
- SkDescriptor::Free(fDesc);
- }
-}
-
-bool GrFontDescKey::lt(const GrFontDescKey& rh) const {
- const SkDescriptor* srcDesc = (&rh)->fDesc;
- size_t lenLH = fDesc->getLength();
- size_t lenRH = srcDesc->getLength();
- int cmp = memcmp(fDesc, srcDesc, SkTMin<size_t>(lenLH, lenRH));
- if (0 == cmp) {
- return lenLH < lenRH;
- } else {
- return cmp < 0;
- }
-}
-
-bool GrFontDescKey::eq(const GrFontDescKey& rh) const {
- const SkDescriptor* srcDesc = (&rh)->fDesc;
- return fDesc->equals(*srcDesc);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
GrFontScaler::GrFontScaler(SkGlyphCache* strike) {
fStrike = strike;
fKey = NULL;
« no previous file with comments | « src/gpu/GrFontScaler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698