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" |
(...skipping 19 matching lines...) Expand all Loading... |
30 buffer.validate(SkScalarIsFinite(fSigma.fWidth) && | 30 buffer.validate(SkScalarIsFinite(fSigma.fWidth) && |
31 SkScalarIsFinite(fSigma.fHeight) && | 31 SkScalarIsFinite(fSigma.fHeight) && |
32 (fSigma.fWidth >= 0) && | 32 (fSigma.fWidth >= 0) && |
33 (fSigma.fHeight >= 0)); | 33 (fSigma.fHeight >= 0)); |
34 } | 34 } |
35 | 35 |
36 SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX, | 36 SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX, |
37 SkScalar sigmaY, | 37 SkScalar sigmaY, |
38 SkImageFilter* input, | 38 SkImageFilter* input, |
39 const CropRect* cropRect) | 39 const CropRect* cropRect) |
40 : INHERITED(input, cropRect), fSigma(SkSize::Make(sigmaX, sigmaY)) { | 40 : INHERITED(1, &input, cropRect), fSigma(SkSize::Make(sigmaX, sigmaY)) { |
41 SkASSERT(sigmaX >= 0 && sigmaY >= 0); | 41 SkASSERT(sigmaX >= 0 && sigmaY >= 0); |
42 } | 42 } |
43 | 43 |
44 void SkBlurImageFilter::flatten(SkWriteBuffer& buffer) const { | 44 void SkBlurImageFilter::flatten(SkWriteBuffer& buffer) const { |
45 this->INHERITED::flatten(buffer); | 45 this->INHERITED::flatten(buffer); |
46 buffer.writeScalar(fSigma.fWidth); | 46 buffer.writeScalar(fSigma.fWidth); |
47 buffer.writeScalar(fSigma.fHeight); | 47 buffer.writeScalar(fSigma.fHeight); |
48 } | 48 } |
49 | 49 |
50 enum BlurDirection { | 50 enum BlurDirection { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 true, | 282 true, |
283 sigma.x(), | 283 sigma.x(), |
284 sigma.y())); | 284 sigma.y())); |
285 WrapTexture(tex, rect.width(), rect.height(), result); | 285 WrapTexture(tex, rect.width(), rect.height(), result); |
286 return true; | 286 return true; |
287 #else | 287 #else |
288 SkDEBUGFAIL("Should not call in GPU-less build"); | 288 SkDEBUGFAIL("Should not call in GPU-less build"); |
289 return false; | 289 return false; |
290 #endif | 290 #endif |
291 } | 291 } |
OLD | NEW |