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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 SkFlattenable* SkComposeImageFilter::CreateProc(SkReadBuffer& buffer) { |
| 57 Common common; |
| 58 if (!common.unflatten(buffer)) { |
| 59 return NULL; |
| 60 } |
| 61 switch (common.inputCount()) { |
| 62 case 1: |
| 63 return SkRef(common.inputs()[0]); |
| 64 case 2: |
| 65 return SkComposeImageFilter::Create(common.inputs()[0], common.input
s()[1]); |
| 66 default: |
| 67 return NULL; |
| 68 } |
| 69 } |
| 70 |
| 71 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
56 SkComposeImageFilter::SkComposeImageFilter(SkReadBuffer& buffer) | 72 SkComposeImageFilter::SkComposeImageFilter(SkReadBuffer& buffer) |
57 : INHERITED(2, buffer) { | 73 : INHERITED(2, buffer) { |
58 } | 74 } |
| 75 #endif |
OLD | NEW |