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

Unified Diff: src/gpu/GrTextStrike.cpp

Issue 224903012: Don't try to render color fonts using distance fields (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comments; windows compile error Created 6 years, 8 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/GrDistanceFieldTextContext.cpp ('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 8c2fa0bdd2ec1563f0dbc1593fb024a06d632593..65ead0f0bbf08268d7247e5c8cb95cbaeaa9aaaa 100644
--- a/src/gpu/GrTextStrike.cpp
+++ b/src/gpu/GrTextStrike.cpp
@@ -332,22 +332,9 @@ bool GrTextStrike::addGlyphToAtlas(GrGlyph* glyph, GrFontScaler* scaler) {
(unsigned char*)storage.get(),
width, height, DISTANCE_FIELD_RANGE);
} else {
- // TODO: Fix color emoji
- // for now, copy glyph into distance field storage
- // this is not correct, but it won't crash
- sk_bzero(dfStorage.get(), dfSize);
- unsigned char* ptr = (unsigned char*) storage.get();
- unsigned char* dfPtr = (unsigned char*) dfStorage.get();
- size_t dfStride = dfWidth*bytesPerPixel;
- dfPtr += DISTANCE_FIELD_RANGE*dfStride;
- dfPtr += DISTANCE_FIELD_RANGE*bytesPerPixel;
-
- for (int i = 0; i < height; ++i) {
- memcpy(dfPtr, ptr, stride);
-
- dfPtr += dfStride;
- ptr += stride;
- }
+ // distance fields should only be used to represent alpha masks
+ SkASSERT(false);
+ return false;
}
// copy to atlas
« no previous file with comments | « src/gpu/GrDistanceFieldTextContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698