Add color filters to gpu path.
git-svn-id: http://skia.googlecode.com/svn/trunk@1297 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrDrawTarget.h b/gpu/include/GrDrawTarget.h
index 6c92071..e8f1793 100644
--- a/gpu/include/GrDrawTarget.h
+++ b/gpu/include/GrDrawTarget.h
@@ -26,6 +26,8 @@
#include "GrTexture.h"
#include "GrStencil.h"
+#include "SkXfermode.h"
+
class GrTexture;
class GrClipIterator;
class GrVertexBuffer;
@@ -131,6 +133,9 @@
// all DrState members should default to something
// valid by the memset
memset(this, 0, sizeof(DrState));
+ // This is an exception to our memset, since it will
+ // result in no change.
+ fColorFilterXfermode = SkXfermode::kDstIn_Mode;
GrAssert((intptr_t)(void*)NULL == 0LL);
GrAssert(fStencilSettings.isDisabled());
}
@@ -144,6 +149,8 @@
GrRenderTarget* fRenderTarget;
GrColor fColor;
DrawFace fDrawFace;
+ GrColor fColorFilterColor;
+ SkXfermode::Mode fColorFilterXfermode;
GrStencilSettings fStencilSettings;
GrMatrix fViewMatrix;
@@ -312,6 +319,11 @@
void setColor(GrColor);
/**
+ * Add a color filter that can be represented by a color and a mode.
+ */
+ void setColorFilter(GrColor, SkXfermode::Mode);
+
+ /**
* Sets the color to be used for the next draw to be
* (r,g,b,a) = (alpha, alpha, alpha, alpha).
*