OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 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 | 8 |
9 #ifndef SkPDFGraphicState_DEFINED | 9 #ifndef SkPDFGraphicState_DEFINED |
10 #define SkPDFGraphicState_DEFINED | 10 #define SkPDFGraphicState_DEFINED |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 static SkPDFGraphicState* GetGraphicStateForPaint(SkPDFCanon* canon, | 44 static SkPDFGraphicState* GetGraphicStateForPaint(SkPDFCanon* canon, |
45 const SkPaint& paint); | 45 const SkPaint& paint); |
46 | 46 |
47 /** Make a graphic state that only sets the passed soft mask. | 47 /** Make a graphic state that only sets the passed soft mask. |
48 * @param sMask The form xobject to use as a soft mask. | 48 * @param sMask The form xobject to use as a soft mask. |
49 * @param invert Indicates if the alpha of the sMask should be inverted. | 49 * @param invert Indicates if the alpha of the sMask should be inverted. |
50 * @param sMaskMode Whether to use alpha or luminosity for the sMask. | 50 * @param sMaskMode Whether to use alpha or luminosity for the sMask. |
51 * | 51 * |
52 * These are not de-duped. | 52 * These are not de-duped. |
53 */ | 53 */ |
54 static sk_sp<SkPDFDict> GetSMaskGraphicState(SkPDFObject* sMask, | 54 static sk_sp<SkPDFDict> GetSMaskGraphicState(sk_sp<SkPDFObject> sMask, |
55 bool invert, | 55 bool invert, |
56 SkPDFSMaskMode sMaskMode, | 56 SkPDFSMaskMode sMaskMode, |
57 SkPDFCanon* canon); | 57 SkPDFCanon* canon); |
58 | 58 |
59 /** Make a graphic state that only unsets the soft mask. */ | 59 /** Make a graphic state that only unsets the soft mask. */ |
60 static sk_sp<SkPDFDict> MakeNoSmaskGraphicState(); | 60 static sk_sp<SkPDFDict> MakeNoSmaskGraphicState(); |
61 static sk_sp<SkPDFStream> MakeInvertFunction(); | 61 static sk_sp<SkPDFStream> MakeInvertFunction(); |
62 | 62 |
63 bool operator==(const SkPDFGraphicState& rhs) const { | 63 bool operator==(const SkPDFGraphicState& rhs) const { |
64 return 0 == memcmp(&fStrokeWidth, &rhs.fStrokeWidth, 12); | 64 return 0 == memcmp(&fStrokeWidth, &rhs.fStrokeWidth, 12); |
65 } | 65 } |
66 uint32_t hash() const { return SkChecksum::Murmur3(&fStrokeWidth, 12); } | 66 uint32_t hash() const { return SkChecksum::Murmur3(&fStrokeWidth, 12); } |
67 | 67 |
68 private: | 68 private: |
69 const SkScalar fStrokeWidth; | 69 const SkScalar fStrokeWidth; |
70 const SkScalar fStrokeMiter; | 70 const SkScalar fStrokeMiter; |
71 const uint8_t fAlpha; | 71 const uint8_t fAlpha; |
72 const uint8_t fStrokeCap; // SkPaint::Cap | 72 const uint8_t fStrokeCap; // SkPaint::Cap |
73 const uint8_t fStrokeJoin; // SkPaint::Join | 73 const uint8_t fStrokeJoin; // SkPaint::Join |
74 const uint8_t fMode; // SkXfermode::Mode | 74 const uint8_t fMode; // SkXfermode::Mode |
75 | 75 |
76 SkPDFGraphicState(const SkPaint&); | 76 SkPDFGraphicState(const SkPaint&); |
77 | 77 |
78 typedef SkPDFDict INHERITED; | 78 typedef SkPDFDict INHERITED; |
79 }; | 79 }; |
80 | 80 |
81 #endif | 81 #endif |
OLD | NEW |