Always use high precision on NDS transform

To fix the Chrome fillRect issue on Galaxy S6.
We should use high precision for position related calculation.

BUG=chromium:552999

Review URL: https://codereview.chromium.org/1500393002
This commit is contained in:
joel.liang 2015-12-07 10:33:00 -08:00 committed by Commit bot
parent 0745653a67
commit 8e03b8af75
4 changed files with 1 additions and 15 deletions

View File

@ -588,9 +588,6 @@ void GrGLCaps::initGLSL(const GrGLContextInfo& ctxInfo) {
// from our GrTextureDomain processor.
glslCaps->fCanUseAnyFunctionInShader = kImagination_GrGLVendor != ctxInfo.vendor();
glslCaps->fForceHighPrecisionNDSTransform = kARM_GrGLVendor == ctxInfo.vendor() ||
kPowerVR54x_GrGLRenderer == ctxInfo.renderer();
glslCaps->fVersionDeclString = get_glsl_version_decl_string(standard, glslCaps->fGLSLGeneration,
fIsCoreProfile);

View File

@ -21,7 +21,6 @@ GrGLSLCaps::GrGLSLCaps(const GrContextOptions& options) {
fBindlessTextureSupport = false;
fUsesPrecisionModifiers = false;
fCanUseAnyFunctionInShader = true;
fForceHighPrecisionNDSTransform = false;
fCanUseMinAndAbsTogether = true;
fMustForceNegatedAtanParamToFloat = false;
fVersionDeclString = nullptr;
@ -59,8 +58,6 @@ SkString GrGLSLCaps::dump() const {
r.appendf("Bindless texture support: %s\n", (fBindlessTextureSupport ? "YES" : "NO"));
r.appendf("Uses precision modifiers: %s\n", (fUsesPrecisionModifiers ? "YES" : "NO"));
r.appendf("Can use any() function: %s\n", (fCanUseAnyFunctionInShader ? "YES" : "NO"));
r.appendf("Force high precision on NDS transform: %s\n", (fForceHighPrecisionNDSTransform ?
"YES" : "NO"));
r.appendf("Can use min() and abs() together: %s\n", (fCanUseMinAndAbsTogether ? "YES" : "NO"));
r.appendf("Must force negated atan param to float: %s\n", (fMustForceNegatedAtanParamToFloat ?
"YES" : "NO"));

View File

@ -72,8 +72,6 @@ public:
// Returns whether we can use the glsl funciton any() in our shader code.
bool canUseAnyFunctionInShader() const { return fCanUseAnyFunctionInShader; }
bool forceHighPrecisionNDSTransform() const { return fForceHighPrecisionNDSTransform; }
bool canUseMinAndAbsTogether() const { return fCanUseMinAndAbsTogether; }
bool mustForceNegatedAtanParamToFloat() const { return fMustForceNegatedAtanParamToFloat; }
@ -133,7 +131,6 @@ private:
bool fBindlessTextureSupport : 1;
bool fUsesPrecisionModifiers : 1;
bool fCanUseAnyFunctionInShader : 1;
bool fForceHighPrecisionNDSTransform : 1;
// Used for specific driver bug work arounds
bool fCanUseMinAndAbsTogether : 1;

View File

@ -18,13 +18,8 @@ GrGLSLVertexBuilder::GrGLSLVertexBuilder(GrGLSLProgramBuilder* program)
void GrGLSLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& posVar) {
SkASSERT(!fRtAdjustName);
GrSLPrecision precision = kDefault_GrSLPrecision;
if (fProgramBuilder->glslCaps()->forceHighPrecisionNDSTransform()) {
precision = kHigh_GrSLPrecision;
}
// setup RT Uniform
fProgramBuilder->addRTAdjustmentUniform(precision,
fProgramBuilder->addRTAdjustmentUniform(kHigh_GrSLPrecision,
fProgramBuilder->rtAdjustment(),
&fRtAdjustName);
if (this->getProgramBuilder()->desc().header().fSnapVerticesToPixelCenters) {