OLD | NEW |
1 | |
2 /* | 1 /* |
3 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
4 * | 3 * |
5 * 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 |
6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
7 */ | 6 */ |
8 | 7 |
9 | |
10 #include "SkEmbossMaskFilter.h" | 8 #include "SkEmbossMaskFilter.h" |
11 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
12 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
13 #include "SkEmbossMask.h" | 11 #include "SkEmbossMask.h" |
14 #include "SkReadBuffer.h" | 12 #include "SkReadBuffer.h" |
15 #include "SkWriteBuffer.h" | 13 #include "SkWriteBuffer.h" |
16 #include "SkString.h" | 14 #include "SkString.h" |
17 | 15 |
| 16 SkEmbossMaskFilter* SkEmbossMaskFilter::Create(SkScalar blurSigma, const Light&
light) { |
| 17 return SkNEW_ARGS(SkEmbossMaskFilter, (blurSigma, light)); |
| 18 } |
| 19 |
18 static inline int pin2byte(int n) { | 20 static inline int pin2byte(int n) { |
19 if (n < 0) { | 21 if (n < 0) { |
20 n = 0; | 22 n = 0; |
21 } else if (n > 0xFF) { | 23 } else if (n > 0xFF) { |
22 n = 0xFF; | 24 n = 0xFF; |
23 } | 25 } |
24 return n; | 26 return n; |
25 } | 27 } |
26 | 28 |
27 SkMaskFilter* SkBlurMaskFilter::CreateEmboss(const SkScalar direction[3], | 29 SkMaskFilter* SkBlurMaskFilter::CreateEmboss(const SkScalar direction[3], |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 str->append(") "); | 154 str->append(") "); |
153 | 155 |
154 str->appendf("ambient: %d specular: %d ", | 156 str->appendf("ambient: %d specular: %d ", |
155 fLight.fAmbient, fLight.fSpecular); | 157 fLight.fAmbient, fLight.fSpecular); |
156 | 158 |
157 str->append("blurSigma: "); | 159 str->append("blurSigma: "); |
158 str->appendScalar(fBlurSigma); | 160 str->appendScalar(fBlurSigma); |
159 str->append(")"); | 161 str->append(")"); |
160 } | 162 } |
161 #endif | 163 #endif |
OLD | NEW |