Changeset 63659 in webkit
- Timestamp:
- Jul 19, 2010 7:52:38 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63657 r63659 1 2010-07-14 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 Canvas: Rename operator==(CanvasStyle,CanvasStyle) since it isn't a proper equality check 6 https://bugs.webkit.org/show_bug.cgi?id=42284 7 8 New name is isEquivalentColor(CanvasStyle). 9 10 * html/canvas/CanvasRenderingContext2D.cpp: 11 (WebCore::CanvasRenderingContext2D::setStrokeStyle): 12 (WebCore::CanvasRenderingContext2D::setFillStyle): 13 * html/canvas/CanvasStyle.cpp: 14 (WebCore::CanvasStyle::isEquivalentColor): 15 * html/canvas/CanvasStyle.h: 16 1 17 2010-07-19 Andreas Kling <andreas.kling@nokia.com> 2 18 -
trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r63607 r63659 173 173 return; 174 174 175 if (state().m_strokeStyle && *style == *state().m_strokeStyle)175 if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentColor(*style)) 176 176 return; 177 177 … … 201 201 return; 202 202 203 if (state().m_fillStyle && *style == *state().m_fillStyle)203 if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(*style)) 204 204 return; 205 205 -
trunk/WebCore/html/canvas/CanvasStyle.cpp
r63329 r63659 122 122 } 123 123 124 bool operator==(const CanvasStyle& s1, const CanvasStyle& s2)125 { 126 if ( s1.m_type != s2.m_type)124 bool CanvasStyle::isEquivalentColor(const CanvasStyle& other) const 125 { 126 if (m_type != other.m_type) 127 127 return false; 128 128 129 switch ( s1.m_type) {129 switch (m_type) { 130 130 case CanvasStyle::RGBA: 131 return s1.m_rgba == s2.m_rgba; 131 return m_rgba == other.m_rgba; 132 case CanvasStyle::CMYKA: 133 return m_cmyka.c == other.m_cmyka.c 134 && m_cmyka.m == other.m_cmyka.m 135 && m_cmyka.y == other.m_cmyka.y 136 && m_cmyka.k == other.m_cmyka.k 137 && m_cmyka.a == other.m_cmyka.a; 132 138 case CanvasStyle::Gradient: 133 return false;134 139 case CanvasStyle::ImagePattern: 135 140 return false; 136 case CanvasStyle::CMYKA:137 return s1.m_cmyka.c == s2.m_cmyka.c138 && s1.m_cmyka.m == s2.m_cmyka.m139 && s1.m_cmyka.y == s2.m_cmyka.y140 && s1.m_cmyka.k == s2.m_cmyka.k141 && s1.m_cmyka.a == s2.m_cmyka.a;142 141 } 143 142 -
trunk/WebCore/html/canvas/CanvasStyle.h
r63327 r63659 56 56 void applyStrokeColor(GraphicsContext*); 57 57 58 friend bool operator==(const CanvasStyle&, const CanvasStyle&);58 bool isEquivalentColor(const CanvasStyle&) const; 59 59 60 60 private:
Note: See TracChangeset
for help on using the changeset viewer.