OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 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 "SkEmbossMaskFilter.h" | 8 #include "SkEmbossMaskFilter.h" |
9 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 light.fPad = 0; // for the font-cache lookup to be clean | 120 light.fPad = 0; // for the font-cache lookup to be clean |
121 const SkScalar sigma = buffer.readScalar(); | 121 const SkScalar sigma = buffer.readScalar(); |
122 return Make(sigma, light); | 122 return Make(sigma, light); |
123 } | 123 } |
124 return nullptr; | 124 return nullptr; |
125 } | 125 } |
126 | 126 |
127 void SkEmbossMaskFilter::flatten(SkWriteBuffer& buffer) const { | 127 void SkEmbossMaskFilter::flatten(SkWriteBuffer& buffer) const { |
128 Light tmpLight = fLight; | 128 Light tmpLight = fLight; |
129 tmpLight.fPad = 0; // for the font-cache lookup to be clean | 129 tmpLight.fPad = 0; // for the font-cache lookup to be clean |
130 buffer.writeByteArray(&tmpLight, sizeof(tmpLight)); | 130 buffer.writeByteArray("fLight", &tmpLight, sizeof(tmpLight)); |
131 buffer.writeScalar(fBlurSigma); | 131 buffer.writeScalar("fBlurSigma", fBlurSigma); |
132 } | 132 } |
133 | 133 |
134 #ifndef SK_IGNORE_TO_STRING | 134 #ifndef SK_IGNORE_TO_STRING |
135 void SkEmbossMaskFilter::toString(SkString* str) const { | 135 void SkEmbossMaskFilter::toString(SkString* str) const { |
136 str->append("SkEmbossMaskFilter: ("); | 136 str->append("SkEmbossMaskFilter: ("); |
137 | 137 |
138 str->append("direction: ("); | 138 str->append("direction: ("); |
139 str->appendScalar(fLight.fDirection[0]); | 139 str->appendScalar(fLight.fDirection[0]); |
140 str->append(", "); | 140 str->append(", "); |
141 str->appendScalar(fLight.fDirection[1]); | 141 str->appendScalar(fLight.fDirection[1]); |
142 str->append(", "); | 142 str->append(", "); |
143 str->appendScalar(fLight.fDirection[2]); | 143 str->appendScalar(fLight.fDirection[2]); |
144 str->append(") "); | 144 str->append(") "); |
145 | 145 |
146 str->appendf("ambient: %d specular: %d ", | 146 str->appendf("ambient: %d specular: %d ", |
147 fLight.fAmbient, fLight.fSpecular); | 147 fLight.fAmbient, fLight.fSpecular); |
148 | 148 |
149 str->append("blurSigma: "); | 149 str->append("blurSigma: "); |
150 str->appendScalar(fBlurSigma); | 150 str->appendScalar(fBlurSigma); |
151 str->append(")"); | 151 str->append(")"); |
152 } | 152 } |
153 #endif | 153 #endif |
OLD | NEW |