Changeset 63659 in webkit


Ignore:
Timestamp:
Jul 19, 2010 7:52:38 AM (14 years ago)
Author:
andreas.kling@nokia.com
Message:

2010-07-14 Andreas Kling <andreas.kling@nokia.com>

Reviewed by Kenneth Rohde Christiansen.

Canvas: Rename operator==(CanvasStyle,CanvasStyle) since it isn't a proper equality check
https://bugs.webkit.org/show_bug.cgi?id=42284

New name is isEquivalentColor(CanvasStyle).

  • html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::setStrokeStyle): (WebCore::CanvasRenderingContext2D::setFillStyle):
  • html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::isEquivalentColor):
  • html/canvas/CanvasStyle.h:
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r63657 r63659  
     12010-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
    1172010-07-19  Andreas Kling  <andreas.kling@nokia.com>
    218
  • trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r63607 r63659  
    173173        return;
    174174
    175     if (state().m_strokeStyle && *style == *state().m_strokeStyle)
     175    if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentColor(*style))
    176176        return;
    177177
     
    201201        return;
    202202
    203     if (state().m_fillStyle && *style == *state().m_fillStyle)
     203    if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(*style))
    204204        return;
    205205 
  • trunk/WebCore/html/canvas/CanvasStyle.cpp

    r63329 r63659  
    122122}
    123123
    124 bool operator==(const CanvasStyle& s1, const CanvasStyle& s2)
    125 {
    126     if (s1.m_type != s2.m_type)
     124bool CanvasStyle::isEquivalentColor(const CanvasStyle& other) const
     125{
     126    if (m_type != other.m_type)
    127127        return false;
    128128
    129     switch (s1.m_type) {
     129    switch (m_type) {
    130130    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;
    132138    case CanvasStyle::Gradient:
    133         return false;
    134139    case CanvasStyle::ImagePattern:
    135140        return false;
    136     case CanvasStyle::CMYKA:
    137         return s1.m_cmyka.c == s2.m_cmyka.c
    138             && s1.m_cmyka.m == s2.m_cmyka.m
    139             && s1.m_cmyka.y == s2.m_cmyka.y
    140             && s1.m_cmyka.k == s2.m_cmyka.k
    141             && s1.m_cmyka.a == s2.m_cmyka.a;
    142141    }
    143142
  • trunk/WebCore/html/canvas/CanvasStyle.h

    r63327 r63659  
    5656        void applyStrokeColor(GraphicsContext*);
    5757
    58         friend bool operator==(const CanvasStyle&, const CanvasStyle&);
     58        bool isEquivalentColor(const CanvasStyle&) const;
    5959
    6060    private:
Note: See TracChangeset for help on using the changeset viewer.