aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-11-15 18:27:09 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-16 19:29:56 +0000
commit47c8ed3c064f5176750f370b88119735163c0e8a (patch)
tree576fa3f0d64463f1d5c3b3b5e4872438c70688fc /tests
parent3bc00fe8100948e99deb3dea3f833fd026d39bd5 (diff)
Reland "Fix precision caps and rrect/ellipse effect precisions"
This is a reland of e42180022720f2fcfd3c634cad855506a7940591 Original change's description: > 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 <csmartdalton@google.com> > Reviewed-by: Ethan Nicholas <ethannicholas@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com Bug: skia:7190 Change-Id: I7ced37a64164b83d86f6a957c35e10ce9085aba0 Reviewed-on: https://skia-review.googlesource.com/72760 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ApplyGammaTest.cpp2
-rw-r--r--tests/SRGBReadWritePixelsTest.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/ApplyGammaTest.cpp b/tests/ApplyGammaTest.cpp
index f2049e7ccc..4147be7f41 100644
--- a/tests/ApplyGammaTest.cpp
+++ b/tests/ApplyGammaTest.cpp
@@ -105,7 +105,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ApplyGamma, reporter, ctxInfo) {
SkAutoTMalloc<uint32_t> read(kW * kH);
// We allow more error on GPUs with lower precision shader variables.
- float error = context->caps()->shaderCaps()->floatPrecisionVaries() ? 1.2f : 0.5f;
+ float error = context->caps()->shaderCaps()->halfIs32Bits() ? 0.5f : 1.2f;
for (auto toSRGB : { false, true }) {
sk_sp<SkSurface> dst(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, ii));
diff --git a/tests/SRGBReadWritePixelsTest.cpp b/tests/SRGBReadWritePixelsTest.cpp
index 6ebdcf7c20..b5d61c1850 100644
--- a/tests/SRGBReadWritePixelsTest.cpp
+++ b/tests/SRGBReadWritePixelsTest.cpp
@@ -184,14 +184,14 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) {
return;
}
- float error = context->caps()->shaderCaps()->floatPrecisionVaries() ? 1.2f : 0.5f;
+ float error = context->caps()->shaderCaps()->halfIs32Bits() ? 0.5f : 1.2f;
// Write srgba data and read as srgba and then as rgba
if (sContext->writePixels(iiSRGBA, origData, 0, 0, 0)) {
// For the all-srgba case, we allow a small error only for devices that have
// precision variation because the srgba data gets converted to linear and back in
// the shader.
- float smallError = context->caps()->shaderCaps()->floatPrecisionVaries() ? 1.f : 0.0f;
+ float smallError = context->caps()->shaderCaps()->halfIs32Bits() ? 0.0f : 1.f;
read_and_check_pixels(reporter, sContext.get(), origData, iiSRGBA,
check_srgb_to_linear_to_srgb_conversion, smallError,
"write/read srgba to srgba texture");