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

Unified Diff: include/effects/SkXfermodeImageFilter.h

Issue 16125008: Implement SkXfermode image filter (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add new case to xfermodeimagefilter GM; revert changes to arithmode GM Created 7 years, 7 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 | « include/core/SkXfermode.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « include/core/SkXfermode.h ('k') | src/core/SkXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698