OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkEmbossMaskFilter.h" | 10 #include "SkEmbossMaskFilter.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 const SkMatrix& matrix, SkIPoint* margin) co
nst { | 82 const SkMatrix& matrix, SkIPoint* margin) co
nst { |
83 SkScalar sigma = matrix.mapRadius(fBlurSigma); | 83 SkScalar sigma = matrix.mapRadius(fBlurSigma); |
84 | 84 |
85 if (!SkBlurMask::BoxBlur(dst, src, sigma, SkBlurMask::kInner_Style, | 85 if (!SkBlurMask::BoxBlur(dst, src, sigma, SkBlurMask::kInner_Style, |
86 SkBlurMask::kLow_Quality)) { | 86 SkBlurMask::kLow_Quality)) { |
87 return false; | 87 return false; |
88 } | 88 } |
89 | 89 |
90 dst->fFormat = SkMask::k3D_Format; | 90 dst->fFormat = SkMask::k3D_Format; |
91 if (margin) { | 91 if (margin) { |
92 margin->set(SkScalarCeil(3*sigma), SkScalarCeil(3*sigma)); | 92 margin->set(SkScalarCeilToInt(3*sigma), SkScalarCeilToInt(3*sigma)); |
93 } | 93 } |
94 | 94 |
95 if (src.fImage == NULL) { | 95 if (src.fImage == NULL) { |
96 return true; | 96 return true; |
97 } | 97 } |
98 | 98 |
99 // create a larger buffer for the other two channels (should force fBlur to
do this for us) | 99 // create a larger buffer for the other two channels (should force fBlur to
do this for us) |
100 | 100 |
101 { | 101 { |
102 uint8_t* alphaPlane = dst->fImage; | 102 uint8_t* alphaPlane = dst->fImage; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 str->append(") "); | 162 str->append(") "); |
163 | 163 |
164 str->appendf("ambient: %d specular: %d ", | 164 str->appendf("ambient: %d specular: %d ", |
165 fLight.fAmbient, fLight.fSpecular); | 165 fLight.fAmbient, fLight.fSpecular); |
166 | 166 |
167 str->append("blurSigma: "); | 167 str->append("blurSigma: "); |
168 str->appendScalar(fBlurSigma); | 168 str->appendScalar(fBlurSigma); |
169 str->append(")"); | 169 str->append(")"); |
170 } | 170 } |
171 #endif | 171 #endif |
OLD | NEW |