Index: include/effects/SkTransformImageFilter.h |
diff --git a/include/effects/SkTransformImageFilter.h b/include/effects/SkTransformImageFilter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7740bb5796d521bd2bcf5dce48f61fdcc9874f72 |
--- /dev/null |
+++ b/include/effects/SkTransformImageFilter.h |
@@ -0,0 +1,58 @@ |
+/* |
+ * Copyright 2014 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 SkTransformImageFilter_DEFINED |
+#define SkTransformImageFilter_DEFINED |
+ |
+#include "SkImageFilter.h" |
+#include "SkScalar.h" |
+#include "SkSize.h" |
+#include "SkPoint.h" |
+#include "SkPaint.h" |
+ |
+/*! \class SkTransformImageFilter |
+ Matrix transformation image filter. This filter draws its source |
+ input transformed by the given matrix. |
+ */ |
+ |
+class SK_API SkTransformImageFilter : public SkImageFilter { |
reed1
2014/03/25 16:04:04
bikeshed: SkMatrixImageFilter -- since it takes a
|
+public: |
+ /** Construct a 2D transformation image filter. |
+ * @param transform The matrix to apply when drawing the src bitmap |
+ * @param filterLevel The quality of filtering to apply when scaling. |
+ * @param input The input image filter. If NULL, the src bitmap |
+ * passed to filterImage() is used instead. |
+ */ |
+ |
+ static SkTransformImageFilter* Create(const SkMatrix& transform, |
+ SkPaint::FilterLevel, |
+ SkImageFilter* input = NULL); |
+ virtual ~SkTransformImageFilter(); |
+ |
+ virtual void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; |
+ |
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTransformImageFilter) |
+ |
+protected: |
+ SkTransformImageFilter(const SkMatrix& transform, |
+ SkPaint::FilterLevel, |
+ SkImageFilter* input = NULL); |
+ SkTransformImageFilter(SkReadBuffer& buffer); |
+ virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
+ |
+ virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
+ SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE; |
+ virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, |
+ SkIRect* dst) const SK_OVERRIDE; |
+ |
+private: |
+ SkMatrix fTransform; |
+ SkPaint::FilterLevel fFilterLevel; |
+ typedef SkImageFilter INHERITED; |
+}; |
+ |
+#endif |