diff options
Diffstat (limited to 'src/gpu/GrCoordTransform.cpp')
-rw-r--r-- | src/gpu/GrCoordTransform.cpp | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/src/gpu/GrCoordTransform.cpp b/src/gpu/GrCoordTransform.cpp index b22f3258fc..79d9e98b76 100644 --- a/src/gpu/GrCoordTransform.cpp +++ b/src/gpu/GrCoordTransform.cpp @@ -6,53 +6,11 @@ */ #include "GrCoordTransform.h" -#include "GrCaps.h" -#include "GrContext.h" -#include "GrGpu.h" #include "GrResourceProvider.h" #include "GrTextureProxy.h" -static GrSLPrecision compute_precision(const GrShaderCaps* caps, - int width, int height, - GrSamplerParams::FilterMode filter) { - // Always start at kDefault. Then if precisions differ we see if the precision needs to be - // increased. Our rule is that we want at least 4 subpixel values in the representation for - // coords between 0 to 1 when bi- or tri-lerping and 1 value when nearest filtering. Note that - // this still might not be enough when drawing with repeat or mirror-repeat modes but that case - // can be arbitrarily bad. - int subPixelThresh = filter > GrSamplerParams::kNone_FilterMode ? 4 : 1; - GrSLPrecision precision = kDefault_GrSLPrecision; - if (caps) { - if (caps->floatPrecisionVaries()) { - int maxD = SkTMax(width, height); - const GrShaderCaps::PrecisionInfo* info; - info = &caps->getFloatShaderPrecisionInfo(kFragment_GrShaderType, precision); - do { - SkASSERT(info->supported()); - // Make sure there is at least 2 bits of subpixel precision in the range of - // texture coords from 0.5 to 1.0. - if ((2 << info->fBits) / maxD > subPixelThresh) { - break; - } - if (kHigh_GrSLPrecision == precision) { - break; - } - GrSLPrecision nextP = static_cast<GrSLPrecision>(precision + 1); - info = &caps->getFloatShaderPrecisionInfo(kFragment_GrShaderType, nextP); - if (!info->supported()) { - break; - } - precision = nextP; - } while (true); - } - } - - return precision; -} - void GrCoordTransform::reset(GrResourceProvider* resourceProvider, const SkMatrix& m, - GrTextureProxy* proxy, - GrSamplerParams::FilterMode filter, bool normalize) { + GrTextureProxy* proxy, bool normalize) { SkASSERT(proxy); SkASSERT(!fInProcessor); @@ -63,10 +21,4 @@ void GrCoordTransform::reset(GrResourceProvider* resourceProvider, const SkMatri fTexture = proxy->instantiate(resourceProvider); fNormalize = normalize; fReverseY = kBottomLeft_GrSurfaceOrigin == proxy->origin(); - - const GrCaps* caps = resourceProvider->caps(); - fPrecision = compute_precision(caps->shaderCaps(), - proxy->worstCaseWidth(*caps), - proxy->worstCaseHeight(*caps), filter); } - |