Replace ModulateRGBA effect with Xfermode using modulate blend.
This reduces our code size by reusing existing components to perform
the same blend, and generates a shader that should be conceptually
equivalent (although it gives the inliner a bit more work to do).
Change-Id: Ie2203f7613503476fa9d045aba58d9ef39f3ea26
Bug: skia:10457
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302264
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index ae1827e..3dfe6c2 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -8,7 +8,6 @@
#include "src/core/SkPathPriv.h"
#include "src/gpu/effects/GrConvexPolyEffect.h"
#include "src/gpu/effects/generated/GrAARectEffect.h"
-#include "src/gpu/effects/generated/GrModulateRGBAEffect.h"
#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
#include "src/gpu/glsl/GrGLSLProgramDataManager.h"
@@ -106,13 +105,15 @@
// skip the draw or omit the clip element.
if (!SkPathPriv::CheapComputeFirstDirection(path, &dir)) {
if (GrProcessorEdgeTypeIsInverseFill(type)) {
- return GrFPSuccess(GrModulateRGBAEffect::Make(std::move(inputFP), SK_PMColor4fWHITE));
+ return GrFPSuccess(
+ GrFragmentProcessor::ModulateRGBA(std::move(inputFP), SK_PMColor4fWHITE));
}
// This could use ConstColor instead of ModulateRGBA but it would trigger a debug print
// about a coverage processor not being compatible with the alpha-as-coverage optimization.
// We don't really care about this unlikely case so we just use ModulateRGBA to suppress
// the print.
- return GrFPSuccess(GrModulateRGBAEffect::Make(std::move(inputFP), SK_PMColor4fTRANSPARENT));
+ return GrFPSuccess(
+ GrFragmentProcessor::ModulateRGBA(std::move(inputFP), SK_PMColor4fTRANSPARENT));
}
SkScalar edges[3 * kMaxEdges];