diff options
Diffstat (limited to 'include/effects')
-rw-r--r-- | include/effects/SkOffsetImageFilter.h | 33 | ||||
-rwxr-xr-x | include/effects/SkTestImageFilters.h | 22 |
2 files changed, 33 insertions, 22 deletions
diff --git a/include/effects/SkOffsetImageFilter.h b/include/effects/SkOffsetImageFilter.h new file mode 100644 index 0000000000..74d6ebc191 --- /dev/null +++ b/include/effects/SkOffsetImageFilter.h @@ -0,0 +1,33 @@ +/* + * 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 SkOffsetImageFilter_DEFINED +#define SkOffsetImageFilter_DEFINED + +#include "SkSingleInputImageFilter.h" +#include "SkPoint.h" + +class SK_API SkOffsetImageFilter : public SkSingleInputImageFilter { +public: + SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter* input = NULL); + SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkOffsetImageFilter) + +protected: + SkOffsetImageFilter(SkFlattenableReadBuffer& buffer); + virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; + + virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, + SkBitmap* result, SkIPoint* loc) SK_OVERRIDE; + virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) SK_OVERRIDE; + +private: + SkVector fOffset; + + typedef SkSingleInputImageFilter INHERITED; +}; + +#endif diff --git a/include/effects/SkTestImageFilters.h b/include/effects/SkTestImageFilters.h index 7e2fb91dc9..2a3178e62c 100755 --- a/include/effects/SkTestImageFilters.h +++ b/include/effects/SkTestImageFilters.h @@ -4,28 +4,6 @@ #include "SkImageFilter.h" #include "SkPoint.h" -class SK_API SkOffsetImageFilter : public SkImageFilter { -public: - SkOffsetImageFilter(SkScalar dx, SkScalar dy) : INHERITED(0) { - fOffset.set(dx, dy); - } - - SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkOffsetImageFilter) - -protected: - SkOffsetImageFilter(SkFlattenableReadBuffer& buffer); - virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; - - virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, - SkBitmap* result, SkIPoint* loc) SK_OVERRIDE; - virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) SK_OVERRIDE; - -private: - SkVector fOffset; - - typedef SkImageFilter INHERITED; -}; - class SK_API SkComposeImageFilter : public SkImageFilter { public: SkComposeImageFilter(SkImageFilter* outer, SkImageFilter* inner) : INHERITED(outer, inner) {} |