Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: include/gpu/GrFragmentProcessor.h

Issue 1347943003: Replace GrExtractAlphaFragmentProcessor with DstIn compose processor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update comment Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/effects/GrExtractAlphaFragmentProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrFragmentProcessor.h
diff --git a/include/gpu/GrFragmentProcessor.h b/include/gpu/GrFragmentProcessor.h
index a5e0d98c4d3fa490df3e04092d2fa9e11a85b970..4b0e1e12d0568a5d6a213a863012dcbc126eea58 100644
--- a/include/gpu/GrFragmentProcessor.h
+++ b/include/gpu/GrFragmentProcessor.h
@@ -23,6 +23,16 @@ class GrProcessorKeyBuilder;
*/
class GrFragmentProcessor : public GrProcessor {
public:
+ /**
+ * In many instances (e.g. SkShader::asFragmentProcessor() implementations) it is desirable to
+ * only consider the input color's alpha. However, there is a competing desire to have reusable
+ * GrFragmentProcessor subclasses that can be used in other scenarios where the entire input
+ * color is considered. This function exists to filter the input color and pass it to a FP. It
+ * does so by returning a parent FP that multiplies the passed in FPs output by the parent's
+ * input alpha. The passed in FP will not receive an input color.
+ */
+ static const GrFragmentProcessor* MulOuputByInputAlpha(const GrFragmentProcessor*);
+
GrFragmentProcessor()
: INHERITED()
, fUsesLocalCoords(false)
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/effects/GrExtractAlphaFragmentProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698