commit-bot@chromium.org | 1c4c9ef | 2013-08-07 00:07:51 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 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 SkComposeImageFilter_DEFINED |
| 9 | #define SkComposeImageFilter_DEFINED |
| 10 | |
| 11 | #include "SkImageFilter.h" |
| 12 | |
| 13 | class SK_API SkComposeImageFilter : public SkImageFilter { |
| 14 | public: |
commit-bot@chromium.org | 1c4c9ef | 2013-08-07 00:07:51 +0000 | [diff] [blame] | 15 | virtual ~SkComposeImageFilter(); |
| 16 | |
reed | 9fa60da | 2014-08-21 07:59:51 -0700 | [diff] [blame] | 17 | static SkImageFilter* Create(SkImageFilter* outer, SkImageFilter* inner) { |
| 18 | if (NULL == outer) { |
| 19 | return SkSafeRef(inner); |
| 20 | } |
| 21 | if (NULL == inner) { |
| 22 | return SkRef(outer); |
| 23 | } |
senorblanco | 9ea3d57 | 2014-07-08 09:16:22 -0700 | [diff] [blame] | 24 | SkImageFilter* inputs[2] = { outer, inner }; |
halcanary | 385fe4d | 2015-08-26 13:07:48 -0700 | [diff] [blame] | 25 | return new SkComposeImageFilter(inputs); |
commit-bot@chromium.org | cac5fd5 | 2014-03-10 10:51:58 +0000 | [diff] [blame] | 26 | } |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 27 | void computeFastBounds(const SkRect& src, SkRect* dst) const override; |
commit-bot@chromium.org | cac5fd5 | 2014-03-10 10:51:58 +0000 | [diff] [blame] | 28 | |
robertphillips | f3f5bad | 2014-12-19 13:49:15 -0800 | [diff] [blame] | 29 | SK_TO_STRING_OVERRIDE() |
commit-bot@chromium.org | 1c4c9ef | 2013-08-07 00:07:51 +0000 | [diff] [blame] | 30 | SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeImageFilter) |
| 31 | |
| 32 | protected: |
reed | 9fa60da | 2014-08-21 07:59:51 -0700 | [diff] [blame] | 33 | explicit SkComposeImageFilter(SkImageFilter* inputs[2]) : INHERITED(2, inputs) { |
| 34 | SkASSERT(inputs[0]); |
| 35 | SkASSERT(inputs[1]); |
| 36 | } |
robertphillips | 48e7846 | 2016-02-17 13:57:16 -0800 | [diff] [blame^] | 37 | bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&, |
| 38 | SkBitmap* result, SkIPoint* loc) const override; |
senorblanco | d8ff5b3 | 2016-01-28 08:23:02 -0800 | [diff] [blame] | 39 | bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*, MapDirection) const override; |
commit-bot@chromium.org | 1c4c9ef | 2013-08-07 00:07:51 +0000 | [diff] [blame] | 40 | |
commit-bot@chromium.org | 1c4c9ef | 2013-08-07 00:07:51 +0000 | [diff] [blame] | 41 | private: |
| 42 | typedef SkImageFilter INHERITED; |
| 43 | }; |
| 44 | |
| 45 | #endif |