diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-06 20:29:39 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-06 20:29:39 +0000 |
commit | 9daf96afb34313842d8d2c4abca73d954d2e9005 (patch) | |
tree | c98c97499454dc89c600ffaea8ca8242fca9a926 /include/effects | |
parent | 7b53706a7d596a2d8dce6cfe5b543264e5a37239 (diff) |
Break out SkOffsetImageFilter into its own file, and derive it from
SkSingleInputImageFilter, to make it DAG-friendly.
Review URL: https://codereview.appspot.com/6822086
git-svn-id: http://skia.googlecode.com/svn/trunk@6315 2bbb7eff-a529-9590-31e7-b0007b416f81
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) {} |