From cb30bb2cb727e276792812c6390547dba474c831 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Sun, 12 Feb 2017 09:28:54 -0500 Subject: Remove GrFragmentProcessor::computeInvariantOutput Change-Id: If475730103052c6097eb91be06808fb723b70bf8 Reviewed-on: https://skia-review.googlesource.com/8330 Reviewed-by: Greg Daniel Commit-Queue: Brian Salomon --- src/gpu/GrFragmentProcessor.cpp | 47 ----------------------------------------- 1 file changed, 47 deletions(-) (limited to 'src/gpu/GrFragmentProcessor.cpp') diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp index 07bbe7bd1b..9ff426fa2f 100644 --- a/src/gpu/GrFragmentProcessor.cpp +++ b/src/gpu/GrFragmentProcessor.cpp @@ -7,7 +7,6 @@ #include "GrFragmentProcessor.h" #include "GrCoordTransform.h" -#include "GrInvariantOutput.h" #include "GrPipeline.h" #include "GrProcOptInfo.h" #include "glsl/GrGLSLFragmentProcessor.h" @@ -137,9 +136,6 @@ sk_sp GrFragmentProcessor::PremulInput(sk_sppremulFourChannelColor(); - } GrColor4f constantOutputForConstantInput(GrColor4f input) const override { return input.premul(); } @@ -195,38 +191,7 @@ sk_sp GrFragmentProcessor::MakeInputPremulAndMulByOutput( } return flags; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - // TODO: Add a helper to GrInvariantOutput that handles multiplying by color with flags? - if (!(inout->validFlags() & kA_GrColorComponentFlag)) { - inout->setToUnknown(); - return; - } - - GrInvariantOutput childOutput(GrColor_WHITE, kRGBA_GrColorComponentFlags); - this->childProcessor(0).computeInvariantOutput(&childOutput); - if (0 == GrColorUnpackA(inout->color()) || 0 == GrColorUnpackA(childOutput.color())) { - inout->mulByKnownFourComponents(0x0); - return; - } - GrColorComponentFlags commonFlags = childOutput.validFlags() & inout->validFlags(); - GrColor c0 = GrPremulColor(inout->color()); - GrColor c1 = childOutput.color(); - GrColor color = 0x0; - if (commonFlags & kR_GrColorComponentFlag) { - color |= SkMulDiv255Round(GrColorUnpackR(c0), GrColorUnpackR(c1)) << - GrColor_SHIFT_R; - } - if (commonFlags & kG_GrColorComponentFlag) { - color |= SkMulDiv255Round(GrColorUnpackG(c0), GrColorUnpackG(c1)) << - GrColor_SHIFT_G; - } - if (commonFlags & kB_GrColorComponentFlag) { - color |= SkMulDiv255Round(GrColorUnpackB(c0), GrColorUnpackB(c1)) << - GrColor_SHIFT_B; - } - inout->setToOther(commonFlags, color); - } GrColor4f constantOutputForConstantInput(GrColor4f input) const override { GrColor4f childColor = ConstantOutputForConstantInput(this->childProcessor(0), GrColor4f::OpaqueWhite()); @@ -310,11 +275,6 @@ sk_sp GrFragmentProcessor::OverrideInput(sk_sp().fColor; } - void onComputeInvariantOutput(GrInvariantOutput* inout) const override { - inout->setToOther(kRGBA_GrColorComponentFlags, fColor.toGrColor()); - this->childProcessor(0).computeInvariantOutput(inout); - } - GrColor4f constantOutputForConstantInput(GrColor4f) const override { return ConstantOutputForConstantInput(this->childProcessor(0), fColor); } @@ -324,8 +284,6 @@ sk_sp GrFragmentProcessor::OverrideInput(sk_spcomputeInvariantOutput(&childOut); return sk_sp(new ReplaceInputFragmentProcessor(std::move(fp), color)); } @@ -375,11 +333,6 @@ sk_sp GrFragmentProcessor::RunInSeries(sk_spnumChildProcessors(); ++i) { - this->childProcessor(i).computeInvariantOutput(inout); - } - } GrColor4f constantOutputForConstantInput(GrColor4f color) const override { int childCnt = this->numChildProcessors(); for (int i = 0; i < childCnt; ++i) { -- cgit v1.2.3