Revert "Replace GrColorMatrixFragmentProcessor with a runtime FP"
Triggered a perf regression, somehow.
This reverts commit 311010405ee192add88503632bc4de44b91e20c2.
Change-Id: Ic468d34c8ccd28aaaed2d3028ce9559115860844
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420816
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp
index 6a6fd2d..bc708d8 100644
--- a/src/gpu/GrSurfaceContext.cpp
+++ b/src/gpu/GrSurfaceContext.cpp
@@ -27,6 +27,7 @@
#include "src/gpu/GrSurfaceFillContext.h"
#include "src/gpu/SkGr.h"
#include "src/gpu/effects/GrBicubicEffect.h"
+#include "src/gpu/effects/generated/GrColorMatrixFragmentProcessor.h"
#define ASSERT_SINGLE_OWNER GR_ASSERT_SINGLE_OWNER(this->singleOwner())
#define RETURN_FALSE_IF_ABANDONED if (this->fContext->abandoned()) { return false; }
@@ -976,11 +977,11 @@
std::copy_n(baseM + 0, 5, yM + 15);
auto yFP = GrTextureEffect::Make(srcView, this->colorInfo().alphaType(), texMatrix);
- yFP = GrFragmentProcessor::ColorMatrix(std::move(yFP),
- yM,
- /*unpremulInput=*/false,
- /*clampRGBOutput=*/true,
- /*premulOutput=*/false);
+ yFP = GrColorMatrixFragmentProcessor::Make(std::move(yFP),
+ yM,
+ /*unpremulInput=*/false,
+ /*clampRGBOutput=*/true,
+ /*premulOutput=*/false);
yFC->fillWithFP(std::move(yFP));
if (!doSynchronousRead) {
yTransfer = yFC->transferPixels(GrColorType::kAlpha_8,
@@ -1001,11 +1002,11 @@
this->colorInfo().alphaType(),
texMatrix,
GrSamplerState::Filter::kLinear);
- uFP = GrFragmentProcessor::ColorMatrix(std::move(uFP),
- uM,
- /*unpremulInput=*/false,
- /*clampRGBOutput=*/true,
- /*premulOutput=*/false);
+ uFP = GrColorMatrixFragmentProcessor::Make(std::move(uFP),
+ uM,
+ /*unpremulInput=*/false,
+ /*clampRGBOutput=*/true,
+ /*premulOutput=*/false);
uFC->fillWithFP(std::move(uFP));
if (!doSynchronousRead) {
uTransfer = uFC->transferPixels(GrColorType::kAlpha_8,
@@ -1024,11 +1025,11 @@
this->colorInfo().alphaType(),
texMatrix,
GrSamplerState::Filter::kLinear);
- vFP = GrFragmentProcessor::ColorMatrix(std::move(vFP),
- vM,
- /*unpremulInput=*/false,
- /*clampRGBOutput=*/true,
- /*premulOutput=*/false);
+ vFP = GrColorMatrixFragmentProcessor::Make(std::move(vFP),
+ vM,
+ /*unpremulInput=*/false,
+ /*clampRGBOutput=*/true,
+ /*premulOutput=*/false);
vFC->fillWithFP(std::move(vFP));
if (!doSynchronousRead) {