From 0cace8ed86b6e6161bc9dd5870238458f85841be Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Thu, 3 Jan 2019 12:42:43 -0500 Subject: [PATCH] Make the RRectEffect's screen coords be Float4 (rather than Half4) For large screens Half4 can have insufficient precision to effectively address all of screen space. This was originally found and fixed in https://android-review.googlesource.com/c/platform/external/skia/+/859297 (fix CtsViewTestCases). Bug: b/122105577 Change-Id: I7a18cd9f8ea1fcf2340e456597760ca189d404e2 Reviewed-on: https://skia-review.googlesource.com/c/180926 Commit-Queue: Robert Phillips Reviewed-by: Greg Daniel --- src/gpu/effects/GrRRectEffect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp index 6478306e5d..5cd54b7cb5 100644 --- a/src/gpu/effects/GrRRectEffect.cpp +++ b/src/gpu/effects/GrRRectEffect.cpp @@ -157,7 +157,7 @@ void GLCircularRRectEffect::emitCode(EmitArgs& args) { // edges correspond to components x, y, z, and w, respectively. When a side of the rrect has // only rectangular corners, that side's value corresponds to the rect edge's value outset by // half a pixel. - fInnerRectUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, kHalf4_GrSLType, + fInnerRectUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, kFloat4_GrSLType, "innerRect", &rectName); // x is (r + .5) and y is 1/(r + .5) fRadiusPlusHalfUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, kHalf2_GrSLType, @@ -503,7 +503,7 @@ void GLEllipticalRRectEffect::emitCode(EmitArgs& args) { GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; const char *rectName; // The inner rect is the rrect bounds inset by the x/y radii - fInnerRectUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, kHalf4_GrSLType, + fInnerRectUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, kFloat4_GrSLType, "innerRect", &rectName); GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;