Merge fix for 552999 to m48(Always use high precision on NDS transform)
Original CL: https://codereview.chromium.org/1500393002
To fix the Chrome fillRect issue on Galaxy S6.
We should use high precision for position related calculation.
BUG=chromium:552999
NOTREECHECKS=true
NOTRY=true
NOPRESUBMIT=true
Review URL: https://codereview.chromium.org/1507603004
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 28401fe..441c6b0 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -564,9 +564,6 @@
// 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);
diff --git a/src/gpu/glsl/GrGLSLCaps.cpp b/src/gpu/glsl/GrGLSLCaps.cpp
index aed9888..0d3c05b 100755
--- a/src/gpu/glsl/GrGLSLCaps.cpp
+++ b/src/gpu/glsl/GrGLSLCaps.cpp
@@ -21,7 +21,6 @@
fBindlessTextureSupport = false;
fUsesPrecisionModifiers = false;
fCanUseAnyFunctionInShader = true;
- fForceHighPrecisionNDSTransform = false;
fCanUseMinAndAbsTogether = true;
fMustForceNegatedAtanParamToFloat = false;
fVersionDeclString = nullptr;
@@ -58,8 +57,6 @@
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"));
diff --git a/src/gpu/glsl/GrGLSLCaps.h b/src/gpu/glsl/GrGLSLCaps.h
index 68e91b6..d6e57a0 100755
--- a/src/gpu/glsl/GrGLSLCaps.h
+++ b/src/gpu/glsl/GrGLSLCaps.h
@@ -72,8 +72,6 @@
// 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; }
@@ -129,7 +127,6 @@
bool fBindlessTextureSupport : 1;
bool fUsesPrecisionModifiers : 1;
bool fCanUseAnyFunctionInShader : 1;
- bool fForceHighPrecisionNDSTransform : 1;
// Used for specific driver bug work arounds
bool fCanUseMinAndAbsTogether : 1;
diff --git a/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp b/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
index 1f68d0e..8eac876 100644
--- a/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
@@ -33,15 +33,10 @@
void GrGLSLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& posVar) {
SkASSERT(!fRtAdjustName);
- GrSLPrecision precision = kDefault_GrSLPrecision;
- if (fProgramBuilder->glslCaps()->forceHighPrecisionNDSTransform()) {
- precision = kHigh_GrSLPrecision;
- }
-
// setup RT Uniform
fProgramBuilder->fUniformHandles.fRTAdjustmentUni =
fProgramBuilder->addUniform(GrGLSLProgramBuilder::kVertex_Visibility,
- kVec4f_GrSLType, precision,
+ kVec4f_GrSLType, kHigh_GrSLPrecision,
fProgramBuilder->rtAdjustment(),
&fRtAdjustName);
if (this->getProgramBuilder()->desc().header().fSnapVerticesToPixelCenters) {