| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #ifndef SkStrokeRec_DEFINED | 8 #ifndef SkStrokeRec_DEFINED |
| 9 #define SkStrokeRec_DEFINED | 9 #define SkStrokeRec_DEFINED |
| 10 | 10 |
| 11 #include "SkPaint.h" | 11 #include "SkPaint.h" |
| 12 | 12 |
| 13 class SkPath; | 13 class SkPath; |
| 14 | 14 |
| 15 SK_BEGIN_REQUIRE_DENSE |
| 15 class SkStrokeRec { | 16 class SkStrokeRec { |
| 16 public: | 17 public: |
| 17 enum InitStyle { | 18 enum InitStyle { |
| 18 kHairline_InitStyle, | 19 kHairline_InitStyle, |
| 19 kFill_InitStyle | 20 kFill_InitStyle |
| 20 }; | 21 }; |
| 21 SkStrokeRec(InitStyle style); | 22 SkStrokeRec(InitStyle style); |
| 22 SkStrokeRec(const SkPaint&, SkPaint::Style, SkScalar resScale = 1); | 23 SkStrokeRec(const SkPaint&, SkPaint::Style, SkScalar resScale = 1); |
| 23 explicit SkStrokeRec(const SkPaint&, SkScalar resScale = 1); | 24 explicit SkStrokeRec(const SkPaint&, SkScalar resScale = 1); |
| 24 | 25 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 112 |
| 112 private: | 113 private: |
| 113 void init(const SkPaint&, SkPaint::Style, SkScalar resScale); | 114 void init(const SkPaint&, SkPaint::Style, SkScalar resScale); |
| 114 | 115 |
| 115 SkScalar fResScale; | 116 SkScalar fResScale; |
| 116 SkScalar fWidth; | 117 SkScalar fWidth; |
| 117 SkScalar fMiterLimit; | 118 SkScalar fMiterLimit; |
| 118 // The following three members are packed together into a single u32. | 119 // The following three members are packed together into a single u32. |
| 119 // This is to avoid unnecessary padding and ensure binary equality for | 120 // This is to avoid unnecessary padding and ensure binary equality for |
| 120 // hashing (because the padded areas might contain garbage values). | 121 // hashing (because the padded areas might contain garbage values). |
| 121 // | 122 // |
| 122 // fCap and fJoin are larger than needed to avoid having to initialize | 123 // fCap and fJoin are larger than needed to avoid having to initialize |
| 123 // any pad values | 124 // any pad values |
| 124 uint32_t fCap : 16; // SkPaint::Cap | 125 uint32_t fCap : 16; // SkPaint::Cap |
| 125 uint32_t fJoin : 15; // SkPaint::Join | 126 uint32_t fJoin : 15; // SkPaint::Join |
| 126 uint32_t fStrokeAndFill : 1; // bool | 127 uint32_t fStrokeAndFill : 1; // bool |
| 127 }; | 128 }; |
| 129 SK_END_REQUIRE_DENSE |
| 128 | 130 |
| 129 #endif | 131 #endif |
| OLD | NEW |