From 22af73f2a5fd40fd9f991e35f7a216e924464cd4 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Thu, 26 Jan 2017 11:25:12 -0500 Subject: [PATCH] Rename GrFragmentProcessor::MulOutputByInputUnpremulColor to MakeInputPremulAndMulByOutput. Change-Id: I33d74ddb8a7836e8f1922a5ae73f0adb74d59db3 Reviewed-on: https://skia-review.googlesource.com/7609 Commit-Queue: Brian Salomon Reviewed-by: Greg Daniel --- include/gpu/GrFragmentProcessor.h | 9 +++++---- src/gpu/GrFragmentProcessor.cpp | 4 ++-- src/gpu/SkGpuDevice.cpp | 2 +- src/gpu/SkGr.cpp | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/gpu/GrFragmentProcessor.h b/include/gpu/GrFragmentProcessor.h index 0d41a26..2ed187d 100644 --- a/include/gpu/GrFragmentProcessor.h +++ b/include/gpu/GrFragmentProcessor.h @@ -35,11 +35,12 @@ public: static sk_sp MulOutputByInputAlpha(sk_sp); /** - * Similar to the above but it modulates the output r,g,b of the child processor by the input - * rgb and then multiplies all the components by the input alpha. This effectively modulates - * the child processor's premul color by a unpremul'ed input and produces a premul output + * This assumes that the input color to the returned processor will be unpremul and that the + * passed processor (which becomes the returned processor's child) produces a premul output. + * The result of the returned processor is a premul of its input color modulated by the child + * processor's premul output. */ - static sk_sp MulOutputByInputUnpremulColor(sk_sp); + static sk_sp MakeInputPremulAndMulByOutput(sk_sp); /** * Returns a parent fragment processor that adopts the passed fragment processor as a child. diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp index f294ac6..92d74eb 100644 --- a/src/gpu/GrFragmentProcessor.cpp +++ b/src/gpu/GrFragmentProcessor.cpp @@ -153,8 +153,8 @@ sk_sp GrFragmentProcessor::PremulInput(sk_sp GrFragmentProcessor::MulOutputByInputUnpremulColor( - sk_sp fp) { +sk_sp GrFragmentProcessor::MakeInputPremulAndMulByOutput( + sk_sp fp) { class PremulFragmentProcessor : public GrFragmentProcessor { public: diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index c5ade9e..f4ee544 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1192,7 +1192,7 @@ void SkGpuDevice::drawSpecial(const SkDraw& draw, std::move(colorSpaceXform), SkMatrix::I())); if (GrPixelConfigIsAlphaOnly(texture->config())) { - fp = GrFragmentProcessor::MulOutputByInputUnpremulColor(std::move(fp)); + fp = GrFragmentProcessor::MakeInputPremulAndMulByOutput(std::move(fp)); } else { fp = GrFragmentProcessor::MulOutputByInputAlpha(std::move(fp)); } diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index f7949e2..aef3c0d 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -646,7 +646,7 @@ bool SkPaintToGrPaintWithTexture(GrContext* context, sk_sp fpSeries[] = { std::move(shaderFP), std::move(fp) }; shaderFP = GrFragmentProcessor::RunInSeries(fpSeries, 2); } else { - shaderFP = GrFragmentProcessor::MulOutputByInputUnpremulColor(fp); + shaderFP = GrFragmentProcessor::MakeInputPremulAndMulByOutput(fp); } } else { shaderFP = GrFragmentProcessor::MulOutputByInputAlpha(fp); -- 2.7.4