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

Unified Diff: src/gpu/effects/GrBitmapTextGeoProc.cpp

Issue 1276383003: fixup precision with configurable atlas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add asserts Created 5 years, 4 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/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrBitmapTextGeoProc.cpp
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 9496dbffc33540c3d64d35e1112a28d3d8a524ca..d83cf5595a3e665ca7b00460eb76eb2bcfc819bd 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -31,15 +31,15 @@ public:
// compute numbers to be hardcoded to convert texture coordinates from int to float
SkASSERT(cte.numTextures() == 1);
GrTexture* atlas = cte.textureAccess(0).getTexture();
- SkASSERT(atlas);
+ SkASSERT(atlas && SkIsPow2(atlas->width()) && SkIsPow2(atlas->height()));
SkScalar recipWidth = 1.0f / atlas->width();
SkScalar recipHeight = 1.0f / atlas->height();
GrGLVertToFrag v(kVec2f_GrSLType);
pb->addVarying("TextureCoords", &v);
vsBuilder->codeAppendf("%s = vec2(%.*f, %.*f) * %s;", v.vsOut(),
- SK_FLT_DECIMAL_DIG, recipWidth,
- SK_FLT_DECIMAL_DIG, recipHeight,
+ GR_SIGNIFICANT_POW2_DECIMAL_DIG, recipWidth,
+ GR_SIGNIFICANT_POW2_DECIMAL_DIG, recipHeight,
cte.inTextureCoords()->fName);
// Setup pass through color
« no previous file with comments | « no previous file | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698