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

Unified Diff: src/gpu/text/GrFontScaler.cpp

Issue 1988833003: Remove GrFontDescKey. (Closed) Base URL: https://chromium.googlesource.com/skia.git@fontscaler
Patch Set: spelling fix Created 4 years, 7 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/text/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/text/GrFontScaler.cpp
diff --git a/src/gpu/text/GrFontScaler.cpp b/src/gpu/text/GrFontScaler.cpp
index 0fb768e1dbd181707b20825fc7fe3949a8ccd927..796f4d46c05fdfa75b1f37fdf8b49eeb654f5b65 100644
--- a/src/gpu/text/GrFontScaler.cpp
+++ b/src/gpu/text/GrFontScaler.cpp
@@ -14,36 +14,9 @@
GrFontScaler::GrFontScaler(SkGlyphCache* strike) {
fStrike = strike;
- fKey = nullptr;
}
-GrFontScaler::~GrFontScaler() {
- SkSafeUnref(fKey);
-}
-
-GrMaskFormat GrFontScaler::getMaskFormat() const {
- SkMask::Format format = fStrike->getMaskFormat();
- switch (format) {
- case SkMask::kBW_Format:
- // fall through to kA8 -- we store BW glyphs in our 8-bit cache
- case SkMask::kA8_Format:
- return kA8_GrMaskFormat;
- case SkMask::kLCD16_Format:
- return kA565_GrMaskFormat;
- case SkMask::kARGB32_Format:
- return kARGB_GrMaskFormat;
- default:
- SkDEBUGFAIL("unsupported SkMask::Format");
- return kA8_GrMaskFormat;
- }
-}
-
-const GrFontDescKey* GrFontScaler::getKey() {
- if (nullptr == fKey) {
- fKey = new GrFontDescKey(fStrike->getDescriptor());
- }
- return fKey;
-}
+const SkDescriptor& GrFontScaler::getKey() { return fStrike->getDescriptor(); }
GrMaskFormat GrFontScaler::getPackedGlyphMaskFormat(const SkGlyph& glyph) const {
SkMask::Format format = static_cast<SkMask::Format>(glyph.fMaskFormat);
« no previous file with comments | « src/gpu/text/GrFontScaler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698