diff options
author | joshualitt <joshualitt@chromium.org> | 2015-04-27 09:36:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-27 09:36:55 -0700 |
commit | f0c000df552a3ab51da6cd4997f5878825dec97e (patch) | |
tree | 45eaeaa42e9b1472e347056a6b7e489dfb28611e /src/gpu | |
parent | 261c3ad7fde95748da92550735decc949dc73bf2 (diff) |
fix a bug in scrolling BitmapText gpu cached textblobs
BUG=skia:
Review URL: https://codereview.chromium.org/1103243002
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/GrAtlasTextContext.cpp | 15 | ||||
-rw-r--r-- | src/gpu/GrAtlasTextContext.h | 4 | ||||
-rw-r--r-- | src/gpu/GrTextBlobCache.cpp | 5 |
3 files changed, 1 insertions, 23 deletions
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp index 56ad9d2d99..8e4b6635a3 100644 --- a/src/gpu/GrAtlasTextContext.cpp +++ b/src/gpu/GrAtlasTextContext.cpp @@ -307,23 +307,10 @@ bool GrAtlasTextContext::MustRegenerateBlob(SkScalar* outTransX, SkScalar* outTr viewMatrix.getSkewY() * (x - blob.fX) + viewMatrix.getScaleY() * (y - blob.fY) - blob.fViewMatrix.getTranslateY(); - if (SkScalarFraction(transX) > SK_ScalarNearlyZero || - SkScalarFraction(transY) > SK_ScalarNearlyZero) { + if (!SkScalarIsInt(transX) || !SkScalarIsInt(transY) ) { return true; } -#ifdef SK_DEBUG - static const SkScalar kMinDiscernableTranslation = 0.0625; - // As a safeguard when debugging, we store the total error across all translations and print - // if the error becomes discernable. This is pretty unlikely to occur given the tight - // bounds above on translation - blob.fTotalXError += SkScalarAbs(SkScalarFraction(transX)); - blob.fTotalYError += SkScalarAbs(SkScalarFraction(transY)); - if (blob.fTotalXError > kMinDiscernableTranslation || - blob.fTotalYError > kMinDiscernableTranslation) { - SkDebugf("Exceeding error threshold for bitmap text translation"); - } -#endif (*outTransX) = transX; (*outTransY) = transY; } else if (blob.hasDistanceField()) { diff --git a/src/gpu/GrAtlasTextContext.h b/src/gpu/GrAtlasTextContext.h index 1a24e809a3..c0b8b00071 100644 --- a/src/gpu/GrAtlasTextContext.h +++ b/src/gpu/GrAtlasTextContext.h @@ -193,10 +193,6 @@ private: SkTArray<BigGlyph> fBigGlyphs; Key fKey; SkMatrix fViewMatrix; -#ifdef SK_DEBUG - mutable SkScalar fTotalXError; - mutable SkScalar fTotalYError; -#endif SkColor fPaintColor; SkScalar fX; SkScalar fY; diff --git a/src/gpu/GrTextBlobCache.cpp b/src/gpu/GrTextBlobCache.cpp index d2153bdc2c..d66f432efb 100644 --- a/src/gpu/GrTextBlobCache.cpp +++ b/src/gpu/GrTextBlobCache.cpp @@ -36,11 +36,6 @@ GrAtlasTextContext::BitmapTextBlob* GrTextBlobCache::createBlob(int glyphCount, } cacheBlob->fRunCount = runCount; cacheBlob->fPool = &fPool; - -#ifdef SK_DEBUG - cacheBlob->fTotalXError = 0; - cacheBlob->fTotalYError = 0; -#endif return cacheBlob; } |