OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkComposeImageFilter.h" | 9 #include "SkComposeImageFilter.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 return (outer ? outer : inner)->filterImage(proxy, src, ctm, result, off
set); | 29 return (outer ? outer : inner)->filterImage(proxy, src, ctm, result, off
set); |
30 } | 30 } |
31 | 31 |
32 SkBitmap tmp; | 32 SkBitmap tmp; |
33 return inner->filterImage(proxy, src, ctm, &tmp, offset) && | 33 return inner->filterImage(proxy, src, ctm, &tmp, offset) && |
34 outer->filterImage(proxy, tmp, ctm, result, offset); | 34 outer->filterImage(proxy, tmp, ctm, result, offset); |
35 } | 35 } |
36 | 36 |
37 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src, | 37 bool SkComposeImageFilter::onFilterBounds(const SkIRect& src, |
38 const SkMatrix& ctm, | 38 const SkMatrix& ctm, |
39 SkIRect* dst) { | 39 SkIRect* dst) const { |
40 SkImageFilter* outer = getInput(0); | 40 SkImageFilter* outer = getInput(0); |
41 SkImageFilter* inner = getInput(1); | 41 SkImageFilter* inner = getInput(1); |
42 | 42 |
43 if (!outer && !inner) { | 43 if (!outer && !inner) { |
44 return false; | 44 return false; |
45 } | 45 } |
46 | 46 |
47 if (!outer || !inner) { | 47 if (!outer || !inner) { |
48 return (outer ? outer : inner)->filterBounds(src, ctm, dst); | 48 return (outer ? outer : inner)->filterBounds(src, ctm, dst); |
49 } | 49 } |
50 | 50 |
51 SkIRect tmp; | 51 SkIRect tmp; |
52 return inner->filterBounds(src, ctm, &tmp) && | 52 return inner->filterBounds(src, ctm, &tmp) && |
53 outer->filterBounds(tmp, ctm, dst); | 53 outer->filterBounds(tmp, ctm, dst); |
54 } | 54 } |
55 | 55 |
56 SkComposeImageFilter::SkComposeImageFilter(SkReadBuffer& buffer) | 56 SkComposeImageFilter::SkComposeImageFilter(SkReadBuffer& buffer) |
57 : INHERITED(2, buffer) { | 57 : INHERITED(2, buffer) { |
58 } | 58 } |
OLD | NEW |