Rename GrFragmentProcessor::MulOutputByInputUnpremulColor to MakeInputPremulAndMulByO...
authorBrian Salomon <bsalomon@google.com>
Thu, 26 Jan 2017 16:25:12 +0000 (11:25 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Sat, 28 Jan 2017 21:26:34 +0000 (21:26 +0000)
Change-Id: I33d74ddb8a7836e8f1922a5ae73f0adb74d59db3
Reviewed-on: https://skia-review.googlesource.com/7609
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
include/gpu/GrFragmentProcessor.h
src/gpu/GrFragmentProcessor.cpp
src/gpu/SkGpuDevice.cpp
src/gpu/SkGr.cpp

index 0d41a26..2ed187d 100644 (file)
@@ -35,11 +35,12 @@ public:
     static sk_sp<GrFragmentProcessor> MulOutputByInputAlpha(sk_sp<GrFragmentProcessor>);
 
     /**
-     *  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<GrFragmentProcessor> MulOutputByInputUnpremulColor(sk_sp<GrFragmentProcessor>);
+    static sk_sp<GrFragmentProcessor> MakeInputPremulAndMulByOutput(sk_sp<GrFragmentProcessor>);
 
     /**
      *  Returns a parent fragment processor that adopts the passed fragment processor as a child.
index f294ac6..92d74eb 100644 (file)
@@ -153,8 +153,8 @@ sk_sp<GrFragmentProcessor> GrFragmentProcessor::PremulInput(sk_sp<GrFragmentProc
     return GrFragmentProcessor::RunInSeries(fpPipeline, 2);
 }
 
-sk_sp<GrFragmentProcessor> GrFragmentProcessor::MulOutputByInputUnpremulColor(
-    sk_sp<GrFragmentProcessor> fp) {
+sk_sp<GrFragmentProcessor> GrFragmentProcessor::MakeInputPremulAndMulByOutput(
+        sk_sp<GrFragmentProcessor> fp) {
 
     class PremulFragmentProcessor : public GrFragmentProcessor {
     public:
index c5ade9e..f4ee544 100644 (file)
@@ -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));
     }
index f7949e2..aef3c0d 100644 (file)
@@ -646,7 +646,7 @@ bool SkPaintToGrPaintWithTexture(GrContext* context,
             sk_sp<GrFragmentProcessor> 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);