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

Unified Diff: src/gpu/GrTextStrike.cpp

Issue 24751003: GrAtlas refactor: Replace GrMaskFormat usage in GrAtlas with GrPixelConfig. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix nits Created 7 years, 3 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/GrTextStrike.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextStrike.cpp
diff --git a/src/gpu/GrTextStrike.cpp b/src/gpu/GrTextStrike.cpp
index 5798e5f3505581dfcb75aad37e8570c534be12e3..d1f1861abdc94ff21a4a9b8f1dd9ee8f641ebe7a 100644
--- a/src/gpu/GrTextStrike.cpp
+++ b/src/gpu/GrTextStrike.cpp
@@ -41,15 +41,29 @@ GrFontCache::~GrFontCache() {
#endif
}
+static GrPixelConfig mask_format_to_pixel_config(GrMaskFormat format) {
+ switch (format) {
+ case kA8_GrMaskFormat:
+ return kAlpha_8_GrPixelConfig;
+ case kA565_GrMaskFormat:
+ return kRGB_565_GrPixelConfig;
+ case kA888_GrMaskFormat:
+ return kSkia8888_GrPixelConfig;
+ default:
+ SkDEBUGFAIL("unknown maskformat");
+ }
+ return kUnknown_GrPixelConfig;
+}
+
GrTextStrike* GrFontCache::generateStrike(GrFontScaler* scaler,
const Key& key) {
GrMaskFormat format = scaler->getMaskFormat();
+ GrPixelConfig config = mask_format_to_pixel_config(format);
if (NULL == fAtlasMgr[format]) {
- fAtlasMgr[format] = SkNEW_ARGS(GrAtlasMgr, (fGpu, format));
+ fAtlasMgr[format] = SkNEW_ARGS(GrAtlasMgr, (fGpu, config));
}
GrTextStrike* strike = SkNEW_ARGS(GrTextStrike,
- (this, scaler->getKey(),
- scaler->getMaskFormat(), fAtlasMgr[format]));
+ (this, scaler->getKey(), format, fAtlasMgr[format]));
fCache.insert(key, strike);
if (fHead) {
« no previous file with comments | « src/gpu/GrTextStrike.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698