aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDeviceImageFilterProxy.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkDeviceImageFilterProxy.h')
-rw-r--r--src/core/SkDeviceImageFilterProxy.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/core/SkDeviceImageFilterProxy.h b/src/core/SkDeviceImageFilterProxy.h
new file mode 100644
index 0000000000..98a120cd0d
--- /dev/null
+++ b/src/core/SkDeviceImageFilterProxy.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2012 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 SkDeviceImageFilterProxy_DEFINED
+#define SkDeviceImageFilterProxy_DEFINED
+
+#include "SkImageFilter.h"
+
+class SkDeviceImageFilterProxy : public SkImageFilter::Proxy {
+public:
+ SkDeviceImageFilterProxy(SkDevice* device) : fDevice(device) {}
+
+ virtual SkDevice* createDevice(int w, int h) SK_OVERRIDE {
+ return fDevice->createCompatibleDevice(SkBitmap::kARGB_8888_Config,
+ w, h, false);
+ }
+ virtual bool canHandleImageFilter(SkImageFilter* filter) SK_OVERRIDE {
+ return fDevice->canHandleImageFilter(filter);
+ }
+ virtual bool filterImage(SkImageFilter* filter, const SkBitmap& src,
+ const SkMatrix& ctm,
+ SkBitmap* result, SkIPoint* offset) SK_OVERRIDE {
+ return fDevice->filterImage(filter, src, ctm, result, offset);
+ }
+
+private:
+ SkDevice* fDevice;
+};
+
+#endif