diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-29 19:22:36 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-29 19:22:36 +0000 |
commit | 26e18b593ab65e4d92dfbce92579d8bc180d4c2c (patch) | |
tree | ddc5eddf771019decfe6a3401ea9b2da79dbc68a /include/core/SkXfermode.h | |
parent | e36f3baa78cbf4a7bab6e5f14702d6a4d259abde (diff) |
Add support for reading the dst pixel value in an effect. Use in a new effect for the kDarken xfer mode.
The current implementation is to always make a copy of the entire dst before the draw.
It will only succeed if the RT is also a texture.
Obviously, there is lots of room for improvement.
Review URL: https://codereview.chromium.org/13314002
git-svn-id: http://skia.googlecode.com/svn/trunk@8449 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkXfermode.h')
-rw-r--r-- | include/core/SkXfermode.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h index 0a0099f3e2..92e240b6c2 100644 --- a/include/core/SkXfermode.h +++ b/include/core/SkXfermode.h @@ -188,16 +188,24 @@ public: 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 then the src and dst coeffs - will be applied to the draw regardless of whether an effect was returned. + 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. */ - virtual bool asNewEffect(GrContext*, GrEffectRef** effect, Coeff* src, Coeff* dst) const; + virtual bool asNewEffectOrCoeff(GrContext*, + GrEffectRef** effect, + Coeff* src, + Coeff* dst) 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. */ - static bool AsNewEffect(SkXfermode*, GrContext*, GrEffectRef** effect, Coeff* src, Coeff* dst); + static bool AsNewEffectOrCoeff(SkXfermode*, + GrContext*, + GrEffectRef** effect, + Coeff* src, + Coeff* dst); SkDEVCODE(virtual void toString(SkString* str) const = 0;) SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |