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

Unified Diff: src/fonts/SkRandomScalerContext.cpp

Issue 1270793003: Add BW masks to random scaler context (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix 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 | « gm/textblobrandomfont.cpp ('k') | tests/TextBlobCacheTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/fonts/SkRandomScalerContext.cpp
diff --git a/src/fonts/SkRandomScalerContext.cpp b/src/fonts/SkRandomScalerContext.cpp
index 0693682faa707dcdcb9609d75a3b31bec79fd7bd..799e51df820e5b9803e6a1aa55786420bd9c5caa 100644
--- a/src/fonts/SkRandomScalerContext.cpp
+++ b/src/fonts/SkRandomScalerContext.cpp
@@ -63,7 +63,7 @@ void SkRandomScalerContext::generateMetrics(SkGlyph* glyph) {
// Here we will change the mask format of the glyph
// NOTE this is being overridden by the base class
SkMask::Format format;
- switch (glyph->getGlyphID() % 3) {
+ switch (glyph->getGlyphID() % 4) {
case 0:
format = SkMask::kLCD16_Format;
break;
@@ -73,6 +73,9 @@ void SkRandomScalerContext::generateMetrics(SkGlyph* glyph) {
case 2:
format = SkMask::kARGB32_Format;
break;
+ case 3:
+ format = SkMask::kBW_Format;
+ break;
}
fProxy->getMetrics(glyph);
@@ -132,7 +135,7 @@ void SkRandomScalerContext::generateMetrics(SkGlyph* glyph) {
void SkRandomScalerContext::generateImage(const SkGlyph& glyph) {
SkMask::Format format = (SkMask::Format)glyph.fMaskFormat;
- switch (glyph.getGlyphID() % 3) {
+ switch (glyph.getGlyphID() % 4) {
case 0:
format = SkMask::kLCD16_Format;
break;
@@ -142,6 +145,9 @@ void SkRandomScalerContext::generateImage(const SkGlyph& glyph) {
case 2:
format = SkMask::kARGB32_Format;
break;
+ case 3:
+ format = SkMask::kBW_Format;
+ break;
}
const_cast<SkGlyph&>(glyph).fMaskFormat = format;
« no previous file with comments | « gm/textblobrandomfont.cpp ('k') | tests/TextBlobCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698