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
// 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);
fBindlessTextureSupport = false;
fUsesPrecisionModifiers = false;
fCanUseAnyFunctionInShader = true;
- fForceHighPrecisionNDSTransform = false;
fCanUseMinAndAbsTogether = true;
fMustForceNegatedAtanParamToFloat = false;
fVersionDeclString = nullptr;
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"));
// 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; }
bool fBindlessTextureSupport : 1;
bool fUsesPrecisionModifiers : 1;
bool fCanUseAnyFunctionInShader : 1;
- bool fForceHighPrecisionNDSTransform : 1;
// Used for specific driver bug work arounds
bool fCanUseMinAndAbsTogether : 1;
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) {