OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrStrokeInfo_DEFINED | 8 #ifndef GrStrokeInfo_DEFINED |
9 #define GrStrokeInfo_DEFINED | 9 #define GrStrokeInfo_DEFINED |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 fDashPhase = other.fDashPhase; | 48 fDashPhase = other.fDashPhase; |
49 fIntervals.reset(other.getDashCount()); | 49 fIntervals.reset(other.getDashCount()); |
50 memcpy(fIntervals.get(), other.fIntervals.get(), fIntervals.count() * sizeof(SkScalar)); | 50 memcpy(fIntervals.get(), other.fIntervals.get(), fIntervals.count() * sizeof(SkScalar)); |
51 } else { | 51 } else { |
52 this->removeDash(); | 52 this->removeDash(); |
53 } | 53 } |
54 fStroke = other.fStroke; | 54 fStroke = other.fStroke; |
55 return *this; | 55 return *this; |
56 } | 56 } |
57 | 57 |
58 bool operator==(const GrStrokeInfo& other) const { | |
59 if (this->isDashed() != other.isDashed()) { | |
60 return false; | |
61 } | |
62 if (this->isDashed()) { | |
63 if (fDashPhase != other.fDashPhase || | |
64 fIntervals.count() != other.fIntervals.count() || | |
egdaniel
2015/05/05 19:48:44
align these lines under each other? It could be th
Kimmo Kinnunen
2015/05/06 08:30:25
It was intentional -- some reviewers want *me* to
| |
65 memcmp(fIntervals.get(), other.fIntervals.get(), | |
66 fIntervals.count() * sizeof(SkScalar)) != 0) { | |
67 return false; | |
68 } | |
69 } | |
70 return fStroke == other.fStroke; | |
71 } | |
72 | |
58 const SkStrokeRec& getStrokeRec() const { return fStroke; } | 73 const SkStrokeRec& getStrokeRec() const { return fStroke; } |
59 | 74 |
60 SkStrokeRec* getStrokeRecPtr() { return &fStroke; } | 75 SkStrokeRec* getStrokeRecPtr() { return &fStroke; } |
61 | 76 |
62 void setFillStyle() { fStroke.setFillStyle(); } | 77 void setFillStyle() { fStroke.setFillStyle(); } |
63 | 78 |
64 /* | 79 /* |
65 * This functions takes in a patheffect and updates the dashing information if the path effect | 80 * This functions takes in a patheffect and updates the dashing information if the path effect |
66 * is a Dash type. Returns true if the path effect is a dashed effect and we are stroking, | 81 * is a Dash type. Returns true if the path effect is a dashed effect and we are stroking, |
67 * otherwise it returns false. | 82 * otherwise it returns false. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 this->setDashInfo(pe); | 153 this->setDashInfo(pe); |
139 } | 154 } |
140 | 155 |
141 SkStrokeRec fStroke; | 156 SkStrokeRec fStroke; |
142 SkPathEffect::DashType fDashType; | 157 SkPathEffect::DashType fDashType; |
143 SkScalar fDashPhase; | 158 SkScalar fDashPhase; |
144 SkAutoSTArray<2, SkScalar> fIntervals; | 159 SkAutoSTArray<2, SkScalar> fIntervals; |
145 }; | 160 }; |
146 | 161 |
147 #endif | 162 #endif |
OLD | NEW |