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

Unified Diff: include/core/SkXfermode.h

Issue 13097006: Add interface to SkXfermode to return a GrEffect and blend coeffs. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Add SkGpuDevice.cpp Created 7 years, 9 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 | « no previous file | src/core/SkXfermode.cpp » ('j') | src/core/SkXfermode.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkXfermode.h
===================================================================
--- include/core/SkXfermode.h (revision 8410)
+++ include/core/SkXfermode.h (working copy)
@@ -13,6 +13,8 @@
#include "SkFlattenable.h"
#include "SkColor.h"
+class GrContext;
+class GrEffectRef;
class SkString;
/** \class SkXfermode
@@ -74,7 +76,7 @@
/**
* The same as calling xfermode->asCoeff(..), except that this also checks
- * if the xfermode is NULL, and if so, treats its as kSrcOver_Mode.
+ * if the xfermode is NULL, and if so, treats it as kSrcOver_Mode.
*/
static bool AsCoeff(const SkXfermode*, Coeff* src, Coeff* dst);
@@ -136,7 +138,7 @@
/**
* The same as calling xfermode->asMode(mode), except that this also checks
- * if the xfermode is NULL, and if so, treats its as kSrcOver_Mode.
+ * if the xfermode is NULL, and if so, treats it as kSrcOver_Mode.
*/
static bool AsMode(const SkXfermode*, Mode* mode);
@@ -181,6 +183,21 @@
return AsMode(xfer, mode);
}
+ /** A subclass may implement this factory function to work with the GPU backend. It is legal
robertphillips 2013/03/27 18:12:09 will -> with
bsalomon 2013/03/27 18:39:42 Done.
+ to call this will 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 before this function
+ is called then the xfermode may optionally allocate an effect to return and the caller will
+ install it and own a ref to it. If the function returns true then the src and dst coeffs
+ will be applied to the draw.
+ */
+ virtual bool asNewEffect(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);
+
SkDEVCODE(virtual void toString(SkString* str) const = 0;)
SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
protected:
« no previous file with comments | « no previous file | src/core/SkXfermode.cpp » ('j') | src/core/SkXfermode.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698