Index: include/effects/SkXfermodeImageFilter.h |
diff --git a/include/effects/SkBlendImageFilter.h b/include/effects/SkXfermodeImageFilter.h |
similarity index 50% |
copy from include/effects/SkBlendImageFilter.h |
copy to include/effects/SkXfermodeImageFilter.h |
index a2dc847494276eceeed20626eba8cfda440e0609..ec7ce87046a9e2edc7dea4c57327ff220c28c202 100644 |
--- a/include/effects/SkBlendImageFilter.h |
+++ b/include/effects/SkXfermodeImageFilter.h |
@@ -1,30 +1,31 @@ |
/* |
- * Copyright 2012 The Android Open Source Project |
+ * Copyright 2013 The Android Open Source Project |
* |
* Use of this source code is governed by a BSD-style license that can be |
* found in the LICENSE file. |
*/ |
-#ifndef SkBlendImageFilter_DEFINED |
-#define SkBlendImageFilter_DEFINED |
+#ifndef SkXfermodeImageFilter_DEFINED |
+#define SkXfermodeImageFilter_DEFINED |
#include "SkImageFilter.h" |
-#include "SkBitmap.h" |
-class SK_API SkBlendImageFilter : public SkImageFilter { |
+class SkBitmap; |
+class SkXfermode; |
+ |
+class SK_API SkXfermodeImageFilter : public SkImageFilter { |
+ /** |
+ * This filter takes an xfermode, and uses it to composite the foreground |
+ * over the background. If foreground or background is NULL, the input |
+ * bitmap (src) is used instead. |
+ */ |
+ |
public: |
- enum Mode { |
- kNormal_Mode, |
- kMultiply_Mode, |
- kScreen_Mode, |
- kDarken_Mode, |
- kLighten_Mode, |
- }; |
- SkBlendImageFilter(Mode mode, SkImageFilter* background, SkImageFilter* foreground = NULL); |
+ SkXfermodeImageFilter(SkXfermode* mode, SkImageFilter* background, SkImageFilter* foreground = NULL); |
- ~SkBlendImageFilter(); |
+ virtual ~SkXfermodeImageFilter(); |
- SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBlendImageFilter) |
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkXfermodeImageFilter) |
virtual bool onFilterImage(Proxy* proxy, |
const SkBitmap& src, |
@@ -37,14 +38,12 @@ public: |
#endif |
protected: |
- explicit SkBlendImageFilter(SkFlattenableReadBuffer& buffer); |
+ explicit SkXfermodeImageFilter(SkFlattenableReadBuffer& buffer); |
virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
private: |
- Mode fMode; |
+ SkXfermode* fMode; |
typedef SkImageFilter INHERITED; |
- SkImageFilter* getBackgroundInput() { return getInput(0); } |
- SkImageFilter* getForegroundInput() { return getInput(1); } |
}; |
#endif |