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 "SkArithmeticMode.h" | 8 #include "SkArithmeticMode.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 private: | 43 private: |
44 SkArithmeticMode_scalar(SkScalar k1, SkScalar k2, SkScalar k3, SkScalar k4,
bool enforcePMColor) { | 44 SkArithmeticMode_scalar(SkScalar k1, SkScalar k2, SkScalar k3, SkScalar k4,
bool enforcePMColor) { |
45 fK[0] = k1; | 45 fK[0] = k1; |
46 fK[1] = k2; | 46 fK[1] = k2; |
47 fK[2] = k3; | 47 fK[2] = k3; |
48 fK[3] = k4; | 48 fK[3] = k4; |
49 fEnforcePMColor = enforcePMColor; | 49 fEnforcePMColor = enforcePMColor; |
50 } | 50 } |
51 | 51 |
52 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | |
53 SkArithmeticMode_scalar(SkReadBuffer& buffer) : INHERITED(buffer) { | |
54 fK[0] = buffer.readScalar(); | |
55 fK[1] = buffer.readScalar(); | |
56 fK[2] = buffer.readScalar(); | |
57 fK[3] = buffer.readScalar(); | |
58 fEnforcePMColor = buffer.readBool(); | |
59 } | |
60 #endif | |
61 | |
62 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { | 52 virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { |
63 buffer.writeScalar(fK[0]); | 53 buffer.writeScalar(fK[0]); |
64 buffer.writeScalar(fK[1]); | 54 buffer.writeScalar(fK[1]); |
65 buffer.writeScalar(fK[2]); | 55 buffer.writeScalar(fK[2]); |
66 buffer.writeScalar(fK[3]); | 56 buffer.writeScalar(fK[3]); |
67 buffer.writeBool(fEnforcePMColor); | 57 buffer.writeBool(fEnforcePMColor); |
68 } | 58 } |
69 SkScalar fK[4]; | 59 SkScalar fK[4]; |
70 bool fEnforcePMColor; | 60 bool fEnforcePMColor; |
71 | 61 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 background); | 440 background); |
451 } | 441 } |
452 return true; | 442 return true; |
453 } | 443 } |
454 | 444 |
455 #endif | 445 #endif |
456 | 446 |
457 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) | 447 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) |
458 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) | 448 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) |
459 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 449 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |