OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The Android Open Source Project | 2 * Copyright 2011 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
11 #include "SkFlattenableBuffers.h" | 11 #include "SkFlattenableBuffers.h" |
12 #include "SkGpuBlurUtils.h" | 12 #include "SkGpuBlurUtils.h" |
13 #include "SkBlurImage_opts.h" | 13 #include "SkBlurImage_opts.h" |
14 #if SK_SUPPORT_GPU | 14 #if SK_SUPPORT_GPU |
15 #include "GrContext.h" | 15 #include "GrContext.h" |
16 #include "SkImageFilterUtils.h" | 16 #include "SkImageFilterUtils.h" |
17 #endif | 17 #endif |
18 | 18 |
19 SkBlurImageFilter::SkBlurImageFilter(SkFlattenableReadBuffer& buffer) | 19 SkBlurImageFilter::SkBlurImageFilter(SkFlattenableReadBuffer& buffer) |
20 : INHERITED(buffer) { | 20 : INHERITED(1, buffer) { |
21 fSigma.fWidth = buffer.readScalar(); | 21 fSigma.fWidth = buffer.readScalar(); |
22 fSigma.fHeight = buffer.readScalar(); | 22 fSigma.fHeight = buffer.readScalar(); |
23 buffer.validate(SkScalarIsFinite(fSigma.fWidth) && | 23 buffer.validate(SkScalarIsFinite(fSigma.fWidth) && |
24 SkScalarIsFinite(fSigma.fHeight) && | 24 SkScalarIsFinite(fSigma.fHeight) && |
25 (fSigma.fWidth >= 0) && | 25 (fSigma.fWidth >= 0) && |
26 (fSigma.fHeight >= 0)); | 26 (fSigma.fHeight >= 0)); |
27 } | 27 } |
28 | 28 |
29 SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX, | 29 SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX, |
30 SkScalar sigmaY, | 30 SkScalar sigmaY, |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 fSigma.width(), | 234 fSigma.width(), |
235 fSigma.height())); | 235 fSigma.height())); |
236 offset->fX += rect.fLeft; | 236 offset->fX += rect.fLeft; |
237 offset->fY += rect.fTop; | 237 offset->fY += rect.fTop; |
238 return SkImageFilterUtils::WrapTexture(tex, rect.width(), rect.height(), res
ult); | 238 return SkImageFilterUtils::WrapTexture(tex, rect.width(), rect.height(), res
ult); |
239 #else | 239 #else |
240 SkDEBUGFAIL("Should not call in GPU-less build"); | 240 SkDEBUGFAIL("Should not call in GPU-less build"); |
241 return false; | 241 return false; |
242 #endif | 242 #endif |
243 } | 243 } |
OLD | NEW |