aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Scroggo <Scroggo@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-11 14:05:25 +0000
committerGravatar Scroggo <Scroggo@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-11 14:05:25 +0000
commit97c88c255cff3dbb8343c5d090526fdbedad6dd6 (patch)
tree018288372381d57dfd8eef285be5d7354067e926 /src
parent0faac1e8579088a39f38d02ff675f14d7deb608d (diff)
Add color filters to gpu path.
git-svn-id: http://skia.googlecode.com/svn/trunk@1297 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/gpu/SkGpuDevice.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 8818dc0b06..563dde74e2 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -22,6 +22,7 @@
#include "SkGpuDeviceFactory.h"
#include "SkGrTexturePixelRef.h"
+#include "SkColorFilter.h"
#include "SkDrawProcs.h"
#include "SkGlyphCache.h"
#include "SkUtils.h"
@@ -368,6 +369,15 @@ bool SkGpuDevice::skPaint2GrPaintNoShader(const SkPaint& skPaint,
grPaint->fColor = SkGr::SkColor2GrColor(skPaint.getColor());
grPaint->setTexture(NULL);
}
+ SkColorFilter* colorFilter = skPaint.getColorFilter();
+ SkColor color;
+ SkXfermode::Mode filterMode;
+ if (colorFilter != NULL && colorFilter->asColorMode(&color, &filterMode)) {
+ grPaint->fColorFilterColor = SkGr::SkColor2GrColor(color);
+ grPaint->fColorFilterXfermode = filterMode;
+ } else {
+ grPaint->resetColorFilter();
+ }
return true;
}