diff options
author | jvanverth <jvanverth@google.com> | 2015-03-18 15:14:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-18 15:14:05 -0700 |
commit | 1a5041e446bda33e7f5e18f0df8d0be77c0a2349 (patch) | |
tree | 3e7f1d9118570e5d5b80632e7b121b59f3c5b2de /src/gpu/GrFontCache.cpp | |
parent | 8dc58edd71c11f232860724dfa3b566895478034 (diff) |
Revert of Ensure that we use different glyph entries for regular and df text. (patchset #2 id:20001 of https://codereview.chromium.org/1020593003/)
Reason for revert:
Bad glyphs in dftext GM.
Original issue's description:
> Ensure that we use different glyph entries for regular and df text.
>
> Currently if we switch between regular text and df text while using
> the same GrContext, they may use the same entry in the Ganesh font cache,
> which is incorrect. This change ensures that they will have different entries.
>
> Committed: https://skia.googlesource.com/skia/+/8dc58edd71c11f232860724dfa3b566895478034
TBR=joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1011403005
Diffstat (limited to 'src/gpu/GrFontCache.cpp')
-rw-r--r-- | src/gpu/GrFontCache.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gpu/GrFontCache.cpp b/src/gpu/GrFontCache.cpp index 5952366406..f5c1c22a3d 100644 --- a/src/gpu/GrFontCache.cpp +++ b/src/gpu/GrFontCache.cpp @@ -258,7 +258,7 @@ GrTextStrike::~GrTextStrike() { GrGlyph* GrTextStrike::generateGlyph(GrGlyph::PackedID packed, GrFontScaler* scaler) { SkIRect bounds; - if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(packed)) { + if (fUseDistanceField) { if (!scaler->getPackedGlyphDFBounds(packed, &bounds)) { return NULL; } @@ -290,9 +290,7 @@ void GrTextStrike::removePlot(const GrPlot* plot) { bool GrTextStrike::glyphTooLargeForAtlas(GrGlyph* glyph) { int width = glyph->fBounds.width(); int height = glyph->fBounds.height(); - bool useDistanceField = - (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(glyph->fPackedID)); - int pad = useDistanceField ? 2 * SK_DistanceFieldPad : 0; + int pad = fUseDistanceField ? 2 * SK_DistanceFieldPad : 0; int plotWidth = (kA8_GrMaskFormat == glyph->fMaskFormat) ? GR_FONT_ATLAS_A8_PLOT_WIDTH : GR_FONT_ATLAS_PLOT_WIDTH; if (width + pad > plotWidth) { @@ -323,7 +321,7 @@ bool GrTextStrike::addGlyphToAtlas(GrGlyph* glyph, GrFontScaler* scaler) { size_t size = glyph->fBounds.area() * bytesPerPixel; GrAutoMalloc<1024> storage(size); - if (GrGlyph::kDistance_MaskStyle == GrGlyph::UnpackMaskStyle(glyph->fPackedID)) { + if (fUseDistanceField) { if (!scaler->getPackedGlyphDFImage(glyph->fPackedID, glyph->width(), glyph->height(), storage.get())) { |