senorblanco@chromium.org | 44888c6 | 2012-08-20 19:23:24 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkColorFilterImageFilter_DEFINED |
| 9 | #define SkColorFilterImageFilter_DEFINED |
| 10 | |
senorblanco@chromium.org | 377c14a | 2013-02-04 22:57:21 +0000 | [diff] [blame] | 11 | #include "SkImageFilter.h" |
senorblanco@chromium.org | 44888c6 | 2012-08-20 19:23:24 +0000 | [diff] [blame] | 12 | |
| 13 | class SkColorFilter; |
| 14 | |
senorblanco@chromium.org | 377c14a | 2013-02-04 22:57:21 +0000 | [diff] [blame] | 15 | class SK_API SkColorFilterImageFilter : public SkImageFilter { |
senorblanco@chromium.org | 44888c6 | 2012-08-20 19:23:24 +0000 | [diff] [blame] | 16 | public: |
senorblanco@chromium.org | 194d775 | 2013-07-24 22:19:24 +0000 | [diff] [blame^] | 17 | static SkColorFilterImageFilter* Create(SkColorFilter* cf, |
| 18 | SkImageFilter* input = NULL, |
| 19 | const SkIRect* cropRect = NULL); |
senorblanco@chromium.org | 44888c6 | 2012-08-20 19:23:24 +0000 | [diff] [blame] | 20 | virtual ~SkColorFilterImageFilter(); |
| 21 | |
| 22 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterImageFilter) |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 23 | |
senorblanco@chromium.org | 44888c6 | 2012-08-20 19:23:24 +0000 | [diff] [blame] | 24 | protected: |
| 25 | SkColorFilterImageFilter(SkFlattenableReadBuffer& buffer); |
| 26 | virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 27 | |
senorblanco@chromium.org | 44888c6 | 2012-08-20 19:23:24 +0000 | [diff] [blame] | 28 | virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&, |
| 29 | SkBitmap* result, SkIPoint* loc) SK_OVERRIDE; |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 30 | |
sugoi@google.com | a1c511b | 2013-02-21 15:02:28 +0000 | [diff] [blame] | 31 | virtual bool asColorFilter(SkColorFilter**) const SK_OVERRIDE; |
senorblanco@chromium.org | 8d21f6c | 2012-10-12 19:14:06 +0000 | [diff] [blame] | 32 | |
senorblanco@chromium.org | 44888c6 | 2012-08-20 19:23:24 +0000 | [diff] [blame] | 33 | private: |
senorblanco@chromium.org | 194d775 | 2013-07-24 22:19:24 +0000 | [diff] [blame^] | 34 | SkColorFilterImageFilter(SkColorFilter* cf, |
| 35 | SkImageFilter* input, |
| 36 | const SkIRect* cropRect = NULL); |
senorblanco@chromium.org | 44888c6 | 2012-08-20 19:23:24 +0000 | [diff] [blame] | 37 | SkColorFilter* fColorFilter; |
rmistry@google.com | fbfcd56 | 2012-08-23 18:09:54 +0000 | [diff] [blame] | 38 | |
senorblanco@chromium.org | 377c14a | 2013-02-04 22:57:21 +0000 | [diff] [blame] | 39 | typedef SkImageFilter INHERITED; |
senorblanco@chromium.org | 44888c6 | 2012-08-20 19:23:24 +0000 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | #endif |