Index: include/effects/SkTileImageFilter.h |
diff --git a/include/effects/SkTileImageFilter.h b/include/effects/SkTileImageFilter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f11a75a38b123e0ba93bc64e09fafa0275a3bc47 |
--- /dev/null |
+++ b/include/effects/SkTileImageFilter.h |
@@ -0,0 +1,40 @@ |
+/* |
+ * Copyright 2013 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#ifndef SkTileImageFilter_DEFINED |
+#define SkTileImageFilter_DEFINED |
+ |
+#include "SkImageFilter.h" |
+ |
+class SkTileImageFilter : public SkImageFilter { |
+ typedef SkImageFilter INHERITED; |
+ |
+public: |
+ /** Tile image filter constructor |
+ @param srcRect Defines the pixels to tile |
+ @param dstRect Defines the pixels where tiles are drawn |
+ @param input Input from which the subregion defined by srcRect will be tiled |
+ */ |
+ SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, SkImageFilter* input) |
+ : INHERITED(input), fSrcRect(srcRect), fDstRect(dstRect) {} |
+ |
+ virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const SkMatrix& ctm, |
+ SkBitmap* dst, SkIPoint* offset) SK_OVERRIDE; |
+ |
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTileImageFilter) |
+ |
+protected: |
+ explicit SkTileImageFilter(SkFlattenableReadBuffer& buffer); |
+ |
+ virtual void flatten(SkFlattenableWriteBuffer& buffer) const SK_OVERRIDE; |
+ |
+private: |
+ SkRect fSrcRect; |
+ SkRect fDstRect; |
+}; |
+ |
+#endif |