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

Unified Diff: src/core/SkGlyphCache.cpp

Issue 834103004: Remove distance field generation and storage from SkGlyphCache. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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/SkGlyphCache.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/core/SkGlyphCache.cpp
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index 17f42365fb69c35b4a524f8a43be94a51dd6ebd2..1cbfcd8e6e9fa235610a0c459b469a1e8a4ff718 100755
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -9,7 +9,6 @@
#include "SkGlyphCache.h"
#include "SkGlyphCache_Globals.h"
-#include "SkDistanceFieldGen.h"
#include "SkGraphics.h"
#include "SkLazyPtr.h"
#include "SkPaint.h"
@@ -365,45 +364,6 @@ const SkPath* SkGlyphCache::findPath(const SkGlyph& glyph) {
return glyph.fPath;
}
-const void* SkGlyphCache::findDistanceField(const SkGlyph& glyph) {
- if (glyph.fWidth > 0 && glyph.fWidth < kMaxGlyphWidth) {
- if (NULL == glyph.fDistanceField) {
- size_t size = SkComputeDistanceFieldSize(glyph.fWidth, glyph.fHeight);
- if (size == 0) {
- return NULL;
- }
- const void* image = this->findImage(glyph);
- // now generate the distance field
- if (image) {
- const_cast<SkGlyph&>(glyph).fDistanceField = fGlyphAlloc.alloc(size,
- SkChunkAlloc::kReturnNil_AllocFailType);
- if (glyph.fDistanceField) {
- SkMask::Format maskFormat = static_cast<SkMask::Format>(glyph.fMaskFormat);
- if (SkMask::kA8_Format == maskFormat) {
- // make the distance field from the image
- SkGenerateDistanceFieldFromA8Image((unsigned char*)glyph.fDistanceField,
- (unsigned char*)glyph.fImage,
- glyph.fWidth, glyph.fHeight,
- glyph.rowBytes());
- fMemoryUsed += size;
- } else if (SkMask::kBW_Format == maskFormat) {
- // make the distance field from the image
- SkGenerateDistanceFieldFromBWImage((unsigned char*)glyph.fDistanceField,
- (unsigned char*)glyph.fImage,
- glyph.fWidth, glyph.fHeight,
- glyph.rowBytes());
- fMemoryUsed += size;
- } else {
- fGlyphAlloc.unalloc(glyph.fDistanceField);
- const_cast<SkGlyph&>(glyph).fDistanceField = NULL;
- }
- }
- }
- }
- }
- return glyph.fDistanceField;
-}
-
///////////////////////////////////////////////////////////////////////////////
bool SkGlyphCache::getAuxProcData(void (*proc)(void*), void** dataPtr) const {
« no previous file with comments | « src/core/SkGlyphCache.h ('k') | src/gpu/GrFontScaler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698