aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-06-23 03:01:32 +0000
committerGravatar reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2009-06-23 03:01:32 +0000
commit845fdaca174f4675e9acc164b510e3a5ffa9053c (patch)
tree624a38d237525c47527cfabeaeff813916256c8c /include/core
parentc9c64229034f595a3dc9e193b2e531c809e1eaf7 (diff)
remove deprecated use of porterduff enum
git-svn-id: http://skia.googlecode.com/svn/trunk@235 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkCanvas.h12
-rw-r--r--include/core/SkColorFilter.h23
-rw-r--r--include/core/SkPorterDuff.h6
3 files changed, 23 insertions, 18 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index b5a6b58256..8fba6cf49d 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -22,10 +22,10 @@
#include "SkDeque.h"
#include "SkPaint.h"
#include "SkRefCnt.h"
-#include "SkPorterDuff.h"
#include "SkPath.h"
#include "SkRegion.h"
#include "SkScalarCompare.h"
+#include "SkXfermode.h"
class SkBounder;
class SkDevice;
@@ -315,7 +315,7 @@ public:
bool getClipBounds(SkRect* bounds, EdgeType et = kAA_EdgeType) const;
/** Fill the entire canvas' bitmap (restricted to the current clip) with the
- specified ARGB color, using the specified PorterDuff mode.
+ specified ARGB color, using the specified mode.
@param a the alpha component (0..255) of the color to fill the canvas
@param r the red component (0..255) of the color to fill the canvas
@param g the green component (0..255) of the color to fill the canvas
@@ -323,15 +323,15 @@ public:
@param mode the mode to apply the color in (defaults to SrcOver)
*/
void drawARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b,
- SkPorterDuff::Mode mode = SkPorterDuff::kSrcOver_Mode);
+ SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode);
/** Fill the entire canvas' bitmap (restricted to the current clip) with the
- specified color and porter-duff xfermode.
+ specified color and mode.
@param color the color to draw with
@param mode the mode to apply the color in (defaults to SrcOver)
*/
void drawColor(SkColor color,
- SkPorterDuff::Mode mode = SkPorterDuff::kSrcOver_Mode);
+ SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode);
/** Fill the entire canvas' bitmap (restricted to the current clip) with the
specified paint.
@@ -614,7 +614,7 @@ public:
@param xmode Used if both texs and colors are present. In this
case the colors are combined with the texture using mode,
before being drawn using the paint. If mode is null, then
- the porter-duff MULTIPLY mode is used.
+ kMultiply_Mode is used.
@param indices If not null, array of indices to reference into the
vertex (texs, colors) array.
@param indexCount number of entries in the indices array (if not null)
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index a1b3171fdd..3bdf815358 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -19,7 +19,7 @@
#include "SkColor.h"
#include "SkFlattenable.h"
-#include "SkPorterDuff.h"
+#include "SkXfermode.h"
class SkColorFilter : public SkFlattenable {
public:
@@ -58,25 +58,24 @@ public:
*/
virtual uint32_t getFlags() { return 0; }
- /** Create a colorfilter that uses the specified color and porter-duff mode.
- If porterDuffMode is DST, this function will return NULL (since that
+ /** Create a colorfilter that uses the specified color and mode.
+ If the Mode is DST, this function will return NULL (since that
mode will have no effect on the result).
- @param srcColor The source color used with the specified mode
- @param mode The porter-duff mode that is applied to each color in
+ @param c The source color used with the specified mode
+ @param mode The xfermode mode that is applied to each color in
the colorfilter's filterSpan[16,32] methods
- @return colorfilter object that applies the src color and porter-duff
- mode, or NULL if the mode will have no effect.
+ @return colorfilter object that applies the src color and mode,
+ or NULL if the mode will have no effect.
*/
- static SkColorFilter* CreatePorterDuffFilter(SkColor srcColor,
- SkPorterDuff::Mode mode);
+ static SkColorFilter* CreateModeFilter(SkColor c, SkXfermode::Mode mode);
/** Create a colorfilter that calls through to the specified procs to
filter the colors. The SkXfermodeProc parameter must be non-null, but
the SkXfermodeProc16 is optional, and may be null.
*/
- static SkColorFilter* CreatXfermodeProcFilter(SkColor srcColor,
- SkXfermodeProc proc,
- SkXfermodeProc16 proc16 = NULL);
+ static SkColorFilter* CreateProcFilter(SkColor srcColor,
+ SkXfermodeProc proc,
+ SkXfermodeProc16 proc16 = NULL);
/** Create a colorfilter that multiplies the RGB channels by one color, and
then adds a second color, pinning the result for each component to
diff --git a/include/core/SkPorterDuff.h b/include/core/SkPorterDuff.h
index 52021b1e7b..6f4ac20be3 100644
--- a/include/core/SkPorterDuff.h
+++ b/include/core/SkPorterDuff.h
@@ -18,6 +18,7 @@
#define SkPorterDuff_DEFINED
#include "SkColor.h"
+#include "SkXfermode.h"
class SkXfermode;
@@ -54,6 +55,7 @@ public:
kModeCount
};
+
/** Return an SkXfermode object for the specified mode.
*/
static SkXfermode* CreateXfermode(Mode mode);
@@ -76,6 +78,10 @@ public:
return false and ignore the mode parameter.
*/
static bool IsMode(SkXfermode*, Mode* mode);
+
+ /** Return the corersponding SkXfermode::Mode
+ */
+ static SkXfermode::Mode ToXfermodeMode(Mode);
};
#endif