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

Unified Diff: src/gpu/text/GrBatchFontCache.h

Issue 2129913004: Use sRGB pixel config for ARGB masks (color emoji) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Avoid static cache of wrong value Created 4 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 | « no previous file | src/gpu/text/GrBatchFontCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrBatchFontCache.h
diff --git a/src/gpu/text/GrBatchFontCache.h b/src/gpu/text/GrBatchFontCache.h
index 42612fe8b67b0d0caea9eed3445ccb6683a15dcf..2aa67ddebee22bbfe821a66b4b803f500fd75a01 100644
--- a/src/gpu/text/GrBatchFontCache.h
+++ b/src/gpu/text/GrBatchFontCache.h
@@ -186,15 +186,18 @@ public:
void setAtlasSizes_ForTesting(const GrBatchAtlasConfig configs[3]);
private:
- static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format) {
- static const GrPixelConfig kPixelConfigs[] = {
- kAlpha_8_GrPixelConfig,
- kRGB_565_GrPixelConfig,
- kSkia8888_GrPixelConfig
- };
- static_assert(SK_ARRAY_COUNT(kPixelConfigs) == kMaskFormatCount, "array_size_mismatch");
-
- return kPixelConfigs[format];
+ static GrPixelConfig MaskFormatToPixelConfig(GrMaskFormat format, const GrCaps& caps) {
+ switch (format) {
Brian Osman 2016/07/07 20:42:34 First version of this change was failing on ANGLE
+ case kA8_GrMaskFormat:
+ return kAlpha_8_GrPixelConfig;
+ case kA565_GrMaskFormat:
+ return kRGB_565_GrPixelConfig;
+ case kARGB_GrMaskFormat:
+ return caps.srgbSupport() ? kSkiaGamma8888_GrPixelConfig : kSkia8888_GrPixelConfig;
+ default:
+ SkDEBUGFAIL("unsupported GrMaskFormat");
+ return kAlpha_8_GrPixelConfig;
+ }
}
// There is a 1:1 mapping between GrMaskFormats and atlas indices
« no previous file with comments | « no previous file | src/gpu/text/GrBatchFontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698