OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
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 "SkImageFilter.h" | 8 #include "SkImageFilter.h" |
9 | 9 |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 for (int i = 0; i < fInputCount; i++) { | 61 for (int i = 0; i < fInputCount; i++) { |
62 SkSafeUnref(fInputs[i]); | 62 SkSafeUnref(fInputs[i]); |
63 } | 63 } |
64 delete[] fInputs; | 64 delete[] fInputs; |
65 } | 65 } |
66 | 66 |
67 SkImageFilter::SkImageFilter(SkFlattenableReadBuffer& buffer) | 67 SkImageFilter::SkImageFilter(SkFlattenableReadBuffer& buffer) |
68 : fInputCount(buffer.readInt()), fInputs(new SkImageFilter*[fInputCount]) { | 68 : fInputCount(buffer.readInt()), fInputs(new SkImageFilter*[fInputCount]) { |
69 for (int i = 0; i < fInputCount; i++) { | 69 for (int i = 0; i < fInputCount; i++) { |
70 if (buffer.readBool()) { | 70 if (buffer.readBool()) { |
71 fInputs[i] = static_cast<SkImageFilter*>(buffer.readFlattenable()); | 71 fInputs[i] = buffer.readImageFilter(); |
72 } else { | 72 } else { |
73 fInputs[i] = NULL; | 73 fInputs[i] = NULL; |
74 } | 74 } |
75 } | 75 } |
76 #ifdef SK_CROP_RECT_IS_INT | 76 #ifdef SK_CROP_RECT_IS_INT |
77 buffer.readIRect(&fCropRect); | 77 buffer.readIRect(&fCropRect); |
78 #else | 78 #else |
79 buffer.readRect(&fCropRect.fRect); | 79 buffer.readRect(&fCropRect.fRect); |
80 fCropRect.fFlags = buffer.readUInt(); | 80 fCropRect.fFlags = buffer.readUInt(); |
81 #endif | 81 #endif |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 return true; | 206 return true; |
207 } | 207 } |
208 | 208 |
209 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*, const SkMatrix&) cons
t { | 209 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*, const SkMatrix&) cons
t { |
210 return false; | 210 return false; |
211 } | 211 } |
212 | 212 |
213 bool SkImageFilter::asColorFilter(SkColorFilter**) const { | 213 bool SkImageFilter::asColorFilter(SkColorFilter**) const { |
214 return false; | 214 return false; |
215 } | 215 } |
OLD | NEW |