| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 SkMask::Format SkEmbossMaskFilter::getFormat() const { | 71 SkMask::Format SkEmbossMaskFilter::getFormat() const { |
| 72 return SkMask::k3D_Format; | 72 return SkMask::k3D_Format; |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool SkEmbossMaskFilter::filterMask(SkMask* dst, const SkMask& src, | 75 bool SkEmbossMaskFilter::filterMask(SkMask* dst, const SkMask& src, |
| 76 const SkMatrix& matrix, SkIPoint* margin) co
nst { | 76 const SkMatrix& matrix, SkIPoint* margin) co
nst { |
| 77 SkScalar sigma = matrix.mapRadius(fBlurSigma); | 77 SkScalar sigma = matrix.mapRadius(fBlurSigma); |
| 78 | 78 |
| 79 if (!SkBlurMask::BoxBlur(dst, src, sigma, SkBlurMask::kInner_Style, | 79 if (!SkBlurMask::BoxBlur(dst, src, sigma, kInner_SkBlurStyle, kLow_SkBlurQua
lity)) { |
| 80 SkBlurMask::kLow_Quality)) { | |
| 81 return false; | 80 return false; |
| 82 } | 81 } |
| 83 | 82 |
| 84 dst->fFormat = SkMask::k3D_Format; | 83 dst->fFormat = SkMask::k3D_Format; |
| 85 if (margin) { | 84 if (margin) { |
| 86 margin->set(SkScalarCeilToInt(3*sigma), SkScalarCeilToInt(3*sigma)); | 85 margin->set(SkScalarCeilToInt(3*sigma), SkScalarCeilToInt(3*sigma)); |
| 87 } | 86 } |
| 88 | 87 |
| 89 if (src.fImage == NULL) { | 88 if (src.fImage == NULL) { |
| 90 return true; | 89 return true; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 str->append(") "); | 152 str->append(") "); |
| 154 | 153 |
| 155 str->appendf("ambient: %d specular: %d ", | 154 str->appendf("ambient: %d specular: %d ", |
| 156 fLight.fAmbient, fLight.fSpecular); | 155 fLight.fAmbient, fLight.fSpecular); |
| 157 | 156 |
| 158 str->append("blurSigma: "); | 157 str->append("blurSigma: "); |
| 159 str->appendScalar(fBlurSigma); | 158 str->appendScalar(fBlurSigma); |
| 160 str->append(")"); | 159 str->append(")"); |
| 161 } | 160 } |
| 162 #endif | 161 #endif |
| OLD | NEW |