OLD | NEW |
(Empty) | |
| 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 #include "SkBitmap.h" |
| 9 #include "SkComposeImageFilter.h" |
| 10 #include "SkFlattenableBuffers.h" |
| 11 |
| 12 SkComposeImageFilter::~SkComposeImageFilter() { |
| 13 } |
| 14 |
| 15 bool SkComposeImageFilter::onFilterImage(Proxy* proxy, |
| 16 const SkBitmap& src, |
| 17 const SkMatrix& ctm, |
| 18 SkBitmap* result, |
| 19 SkIPoint* loc) { |
| 20 SkImageFilter* outer = getInput(0); |
| 21 SkImageFilter* inner = getInput(1); |
| 22 |
| 23 if (!outer && !inner) { |
| 24 return false; |
| 25 } |
| 26 |
| 27 if (!outer || !inner) { |
| 28 return (outer ? outer : inner)->filterImage(proxy, src, ctm, result, loc
); |
| 29 } |
| 30 |
| 31 SkBitmap tmp; |
| 32 return inner->filterImage(proxy, src, ctm, &tmp, loc) && |
| 33 outer->filterImage(proxy, tmp, ctm, result, loc); |
| 34 } |
| 35 |
| 36 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src, |
| 37 const SkMatrix& ctm, |
| 38 SkIRect* dst) { |
| 39 SkImageFilter* outer = getInput(0); |
| 40 SkImageFilter* inner = getInput(1); |
| 41 |
| 42 if (!outer && !inner) { |
| 43 return false; |
| 44 } |
| 45 |
| 46 if (!outer || !inner) { |
| 47 return (outer ? outer : inner)->filterBounds(src, ctm, dst); |
| 48 } |
| 49 |
| 50 SkIRect tmp; |
| 51 return inner->filterBounds(src, ctm, &tmp) && |
| 52 outer->filterBounds(tmp, ctm, dst); |
| 53 } |
| 54 |
| 55 SkComposeImageFilter::SkComposeImageFilter(SkFlattenableReadBuffer& buffer) : IN
HERITED(buffer) { |
| 56 } |
OLD | NEW |