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 <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
7a8d08db55
commit
0cace8ed86
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user