Calculate inverse scale for distance field text in vertex shader
authorjvanverth <jvanverth@google.com>
Tue, 7 Apr 2015 16:06:00 +0000 (09:06 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 7 Apr 2015 16:06:00 +0000 (09:06 -0700)
commitbb4a1cf0e66c98c723f04f473a3221b2a4d8ece1
tree32326eb6636e2326baf8ce910bd454798426fce1
parent0ea6d7150eb661f51f736ec32ce6fe3fd9922e97
Calculate inverse scale for distance field text in vertex shader

This is for the uniform scale case only. Using the dFdx() function on certain
Mali GPUs causes issues because the precision is too low, so we have to
compute 1/scale from the view matrix instead.

BUG=skia:3528

Committed: https://skia.googlesource.com/skia/+/5b143038cb47763974d2750ed78d436eb6c38bea

Review URL: https://codereview.chromium.org/1029423003
src/gpu/GrDistanceFieldTextContext.cpp
src/gpu/effects/GrDistanceFieldTextureEffect.cpp
src/gpu/effects/GrDistanceFieldTextureEffect.h