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

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

Issue 1713693002: Use unorm shorts for texture coordinates when rendering text. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix tabbing Created 4 years, 10 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/GrTest.cpp ('k') | 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 263676d353aee72e054bad65cbbca632f42eaaa0..18f12bdfa51d8c5ebd6dbbe83c5469c07b8e2445 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -31,16 +31,12 @@ public:
// compute numbers to be hardcoded to convert texture coordinates from int to float
SkASSERT(cte.numTextures() == 1);
- GrTexture* atlas = cte.textureAccess(0).getTexture();
+ SkDEBUGCODE(GrTexture* atlas = cte.textureAccess(0).getTexture());
SkASSERT(atlas && SkIsPow2(atlas->width()) && SkIsPow2(atlas->height()));
- SkScalar recipWidth = 1.0f / atlas->width();
- SkScalar recipHeight = 1.0f / atlas->height();
GrGLSLVertToFrag v(kVec2f_GrSLType);
- varyingHandler->addVarying("TextureCoords", &v);
- vertBuilder->codeAppendf("%s = vec2(%.*f, %.*f) * %s;", v.vsOut(),
- GR_SIGNIFICANT_POW2_DECIMAL_DIG, recipWidth,
- GR_SIGNIFICANT_POW2_DECIMAL_DIG, recipHeight,
+ varyingHandler->addVarying("TextureCoords", &v, kHigh_GrSLPrecision);
+ vertBuilder->codeAppendf("%s = %s;", v.vsOut(),
cte.inTextureCoords()->fName);
GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
@@ -150,7 +146,8 @@ GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture,
fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttribType));
}
fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords",
- kVec2s_GrVertexAttribType));
+ kVec2us_GrVertexAttribType,
+ kHigh_GrSLPrecision));
this->addTextureAccess(&fTextureAccess);
}
« no previous file with comments | « src/gpu/GrTest.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698