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

Unified Diff: include/core/SkXfermode.h

Issue 1334293003: Create fragment processor for performing input color blend with child processor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix 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 | « include/core/SkColorFilter.h ('k') | include/effects/SkColorCubeFilter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkXfermode.h
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index 0b8f936bed2c1f6ef951e303a3e9685f574a952d..a438c5b4ca550144abc66fd30c5e1fcd67406a65 100644
--- a/include/core/SkXfermode.h
+++ b/include/core/SkXfermode.h
@@ -194,15 +194,15 @@ public:
*/
static bool IsOpaque(const SkXfermode* xfer, SrcColorOpacity opacityType);
- /** Implemented by a subclass to support use as an image filter in the GPU backend. When used as
- an image filter the xfer mode blends the source color against a background texture rather
- than the destination. It is implemented as a fragment processor. This can be called with
- both params set to NULL to query whether it would succeed. Otherwise, both params are
- required. Upon success the function returns true and the caller owns a ref to the fragment
- parameter. Upon failure false is returned and the processor param is not written to.
+ /** Used to do in-shader blending between two colors computed in the shader via a
+ GrFragmentProcessor. The input to the returned FP is the src color. The dst color is
+ provided by the dst param which becomes a child FP of the returned FP. If the params are
+ null then this is just a query of whether the SkXfermode could support this functionality.
+ It is legal for the function to succeed but return a null output. This indicates that
+ the output of the blend is simply the src color.
*/
- virtual bool asFragmentProcessor(GrFragmentProcessor**, GrProcessorDataManager*,
- GrTexture* background) const;
+ virtual bool asFragmentProcessor(const GrFragmentProcessor** output, GrProcessorDataManager*,
+ const GrFragmentProcessor* dst) const;
/** A subclass may implement this factory function to work with the GPU backend. It is legal
to call this with xpf NULL to simply test the return value. If xpf is non-NULL then the
@@ -226,7 +226,7 @@ protected:
SkXfermode() {}
/** The default implementation of xfer32/xfer16/xferA8 in turn call this
method, 1 color at a time (upscaled to a SkPMColor). The default
- implmentation of this method just returns dst. If performance is
+ implementation of this method just returns dst. If performance is
important, your subclass should override xfer32/xfer16/xferA8 directly.
This method will not be called directly by the client, so it need not
« no previous file with comments | « include/core/SkColorFilter.h ('k') | include/effects/SkColorCubeFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698