diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-23 18:41:36 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-23 18:41:36 +0000 |
commit | 1a6382f5e76c051ffbbb60f3a68524dfe57cf798 (patch) | |
tree | ab824038d59a1f545919d6c55de24e13e3d9f7f8 /include | |
parent | d594dbec0407343b7ac13af9c4580ec5933ab060 (diff) |
Split up SkXfermode::asNewEffectOrCoeff() into asNewEffect(), asCoeff().
R=bsalomon@google.com
Review URL: https://codereview.chromium.org/37593002
git-svn-id: http://skia.googlecode.com/svn/trunk@11926 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkXfermode.h | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h index db9b0b05f2..5bf8a22517 100644 --- a/include/core/SkXfermode.h +++ b/include/core/SkXfermode.h @@ -192,25 +192,20 @@ public: } /** A subclass may implement this factory function to work with the GPU backend. It is legal - to call this with all but the context param NULL to simply test the return value. effect, - src, and dst must all be NULL or all non-NULL. If effect is non-NULL then the xfermode may - optionally allocate an effect to return and the caller as *effect. The caller will install - it and own a ref to it. Since the xfermode may or may not assign *effect, the caller should - set *effect to NULL beforehand. If the function returns true and *effect is NULL then the - src and dst coeffs will be applied to the draw. When *effect is non-NULL the coeffs are - ignored. background specifies the texture to use as the background for compositing, and - should be accessed in the effect's fragment shader. If NULL, the effect should request - access to destination color (setWillReadDstColor()), and use that in the fragment shader - (builder->dstColor()). + to call this with all params NULL to simply test the return value. If effect is non-NULL + then the xfermode may optionally allocate an effect to return and the caller as *effect. + The caller will install it and own a ref to it. Since the xfermode may or may not assign + *effect, the caller should set *effect to NULL beforehand. background specifies the + texture to use as the background for compositing, and should be accessed in the effect's + fragment shader. If NULL, the effect should request access to destination color + (setWillReadDstColor()), and use that in the fragment shader (builder->dstColor()). */ - virtual bool asNewEffectOrCoeff(GrEffectRef** effect, - Coeff* src, - Coeff* dst, - GrTexture* background = NULL) const; + virtual bool asNewEffect(GrEffectRef** effect, GrTexture* background = NULL) const; - /** - * The same as calling xfermode->asNewEffect(...), except that this also checks if the xfermode - * is NULL, and if so, treats it as kSrcOver_Mode. + /** Returns true if the xfermode can be expressed as coeffs (src, dst), or as an effect + (effect). This helper calls the asCoeff() and asNewEffect() virtuals. If the xfermode is + NULL, it is treated as kSrcOver_Mode. It is legal to call this with all params NULL to + simply test the return value. effect, src, and dst must all be NULL or all non-NULL. */ static bool AsNewEffectOrCoeff(SkXfermode*, GrEffectRef** effect, |