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 #include "SkImageFilterCacheKey.h" | 9 #include "SkImageFilterCacheKey.h" |
10 | 10 |
11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
12 #include "SkBitmapDevice.h" | 12 #include "SkBitmapDevice.h" |
13 #include "SkChecksum.h" | 13 #include "SkChecksum.h" |
14 #include "SkDevice.h" | 14 #include "SkDevice.h" |
| 15 #include "SkFuzzLogging.h" |
15 #include "SkLocalMatrixImageFilter.h" | 16 #include "SkLocalMatrixImageFilter.h" |
16 #include "SkMatrixImageFilter.h" | 17 #include "SkMatrixImageFilter.h" |
17 #include "SkOncePtr.h" | 18 #include "SkOncePtr.h" |
18 #include "SkReadBuffer.h" | 19 #include "SkReadBuffer.h" |
19 #include "SkRect.h" | 20 #include "SkRect.h" |
20 #include "SkSpecialImage.h" | 21 #include "SkSpecialImage.h" |
21 #include "SkSpecialSurface.h" | 22 #include "SkSpecialSurface.h" |
22 #include "SkTDynamicHash.h" | 23 #include "SkTDynamicHash.h" |
23 #include "SkTInternalLList.h" | 24 #include "SkTInternalLList.h" |
24 #include "SkValidationUtils.h" | 25 #include "SkValidationUtils.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 131 |
131 bool SkImageFilter::Common::unflatten(SkReadBuffer& buffer, int expectedCount) { | 132 bool SkImageFilter::Common::unflatten(SkReadBuffer& buffer, int expectedCount) { |
132 const int count = buffer.readInt(); | 133 const int count = buffer.readInt(); |
133 if (!buffer.validate(count >= 0)) { | 134 if (!buffer.validate(count >= 0)) { |
134 return false; | 135 return false; |
135 } | 136 } |
136 if (!buffer.validate(expectedCount < 0 || count == expectedCount)) { | 137 if (!buffer.validate(expectedCount < 0 || count == expectedCount)) { |
137 return false; | 138 return false; |
138 } | 139 } |
139 | 140 |
| 141 SkFUZZF(("allocInputs: %d\n", count)); |
140 this->allocInputs(count); | 142 this->allocInputs(count); |
141 for (int i = 0; i < count; i++) { | 143 for (int i = 0; i < count; i++) { |
142 if (buffer.readBool()) { | 144 if (buffer.readBool()) { |
143 fInputs[i] = sk_sp<SkImageFilter>(buffer.readImageFilter()); | 145 fInputs[i] = sk_sp<SkImageFilter>(buffer.readImageFilter()); |
144 } | 146 } |
145 if (!buffer.isValid()) { | 147 if (!buffer.isValid()) { |
146 return false; | 148 return false; |
147 } | 149 } |
148 } | 150 } |
149 SkRect rect; | 151 SkRect rect; |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 dev = SkBitmapDevice::Create(cinfo.fInfo, surfaceProps); | 826 dev = SkBitmapDevice::Create(cinfo.fInfo, surfaceProps); |
825 } | 827 } |
826 return dev; | 828 return dev; |
827 } | 829 } |
828 | 830 |
829 bool SkImageFilter::DeviceProxy::filterImage(const SkImageFilter* filter, const
SkBitmap& src, | 831 bool SkImageFilter::DeviceProxy::filterImage(const SkImageFilter* filter, const
SkBitmap& src, |
830 const SkImageFilter::Context& ctx, | 832 const SkImageFilter::Context& ctx, |
831 SkBitmap* result, SkIPoint* offset) { | 833 SkBitmap* result, SkIPoint* offset) { |
832 return fDevice->filterImage(filter, src, ctx, result, offset); | 834 return fDevice->filterImage(filter, src, ctx, result, offset); |
833 } | 835 } |
OLD | NEW |