From e42180022720f2fcfd3c634cad855506a7940591 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Wed, 15 Nov 2017 18:27:09 -0700 Subject: Fix precision caps and rrect/ellipse effect precisions Replaces all the complex precision caps with a single flag that says whether "float" == fp32. Updates the ellipse and rrect effects to use float coords, and use the scale workaround when float != fp32. Bug: skia:7190 Change-Id: Ieccff9f38acd05e5cec78fe90d01a5da901a9307 Reviewed-on: https://skia-review.googlesource.com/70961 Commit-Queue: Chris Dalton Reviewed-by: Ethan Nicholas Reviewed-by: Brian Salomon --- src/sksl/SkSLCPP.h | 2 +- src/sksl/SkSLIRGenerator.cpp | 2 +- src/sksl/SkSLUtil.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sksl') diff --git a/src/sksl/SkSLCPP.h b/src/sksl/SkSLCPP.h index d67990820b..612a200f28 100644 --- a/src/sksl/SkSLCPP.h +++ b/src/sksl/SkSLCPP.h @@ -18,7 +18,7 @@ using std::abs; // macros to make sk_Caps. work from C++ code #define sk_Caps (*args.fShaderCaps) -#define floatPrecisionVaries floatPrecisionVaries() +#define floatIs32Bits floatIs32Bits() // functions to make GLSL constructors work from C++ code inline SkPoint float2(float xy) { return SkPoint::Make(xy, xy); } diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp index 18b36a4b0f..cfa3049a2c 100644 --- a/src/sksl/SkSLIRGenerator.cpp +++ b/src/sksl/SkSLIRGenerator.cpp @@ -140,7 +140,7 @@ static void fill_caps(const SKSL_CAPS_CLASS& caps, CAP(mustEnableSpecificAdvBlendEqs); CAP(mustDeclareFragmentShaderOutput); CAP(canUseAnyFunctionInShader); - CAP(floatPrecisionVaries); + CAP(floatIs32Bits); CAP(integerSupport); #undef CAP } diff --git a/src/sksl/SkSLUtil.h b/src/sksl/SkSLUtil.h index a8be7ef72f..1d9d53f6e8 100644 --- a/src/sksl/SkSLUtil.h +++ b/src/sksl/SkSLUtil.h @@ -135,8 +135,8 @@ public: return false; } - bool floatPrecisionVaries() const { - return false; + bool floatIs32Bits() const { + return true; } bool integerSupport() const { -- cgit v1.2.3