OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
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 "SkDropShadowImageFilter.h" | 8 #include "SkDropShadowImageFilter.h" |
9 | 9 |
10 #include "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 SkFlattenable* SkDropShadowImageFilter::CreateProc(SkReadBuffer& buffer) { | 30 SkFlattenable* SkDropShadowImageFilter::CreateProc(SkReadBuffer& buffer) { |
31 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); | 31 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
32 SkScalar dx = buffer.readScalar(); | 32 SkScalar dx = buffer.readScalar(); |
33 SkScalar dy = buffer.readScalar(); | 33 SkScalar dy = buffer.readScalar(); |
34 SkScalar sigmaX = buffer.readScalar(); | 34 SkScalar sigmaX = buffer.readScalar(); |
35 SkScalar sigmaY = buffer.readScalar(); | 35 SkScalar sigmaY = buffer.readScalar(); |
36 SkColor color = buffer.readColor(); | 36 SkColor color = buffer.readColor(); |
37 ShadowMode shadowMode = buffer.isVersionLT(SkReadBuffer::kDropShadowMode_Ver
sion) ? | 37 ShadowMode shadowMode = buffer.isVersionLT(SkReadBuffer::kDropShadowMode_Ver
sion) ? |
38 kDrawShadowAndForeground_ShadowMode : | 38 kDrawShadowAndForeground_ShadowMode : |
39 static_cast<ShadowMode>(buffer.readInt()); | 39 static_cast<ShadowMode>(buffer.readInt()); |
40 return Create(dx, dy, sigmaX, sigmaY, color, shadowMode, common.getInput(0), | 40 return Create(dx, dy, sigmaX, sigmaY, color, shadowMode, common.getInput(0).
get(), |
41 &common.cropRect()); | 41 &common.cropRect()); |
42 } | 42 } |
43 | 43 |
44 void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const { | 44 void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const { |
45 this->INHERITED::flatten(buffer); | 45 this->INHERITED::flatten(buffer); |
46 buffer.writeScalar(fDx); | 46 buffer.writeScalar(fDx); |
47 buffer.writeScalar(fDy); | 47 buffer.writeScalar(fDy); |
48 buffer.writeScalar(fSigmaX); | 48 buffer.writeScalar(fSigmaX); |
49 buffer.writeScalar(fSigmaY); | 49 buffer.writeScalar(fSigmaY); |
50 buffer.writeColor(fColor); | 50 buffer.writeColor(fColor); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 "kDrawShadowAndForeground", "kDrawShadowOnly" | 154 "kDrawShadowAndForeground", "kDrawShadowOnly" |
155 }; | 155 }; |
156 | 156 |
157 static_assert(kShadowModeCount == SK_ARRAY_COUNT(gModeStrings), "enum_mismat
ch"); | 157 static_assert(kShadowModeCount == SK_ARRAY_COUNT(gModeStrings), "enum_mismat
ch"); |
158 | 158 |
159 str->appendf(" mode: %s", gModeStrings[fShadowMode]); | 159 str->appendf(" mode: %s", gModeStrings[fShadowMode]); |
160 | 160 |
161 str->append(")"); | 161 str->append(")"); |
162 } | 162 } |
163 #endif | 163 #endif |
OLD | NEW |