[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 11:19:18 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 6f139499c84b7c72bb1dad24b757b13db3cbd3e9
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jul 19 14:52:38 2010 +0000

    2010-07-14  Andreas Kling  <andreas.kling at 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:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63659 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8b872d4..47b004a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-14  Andreas Kling  <andreas.kling at 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:
+
 2010-07-19  Andreas Kling  <andreas.kling at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 70c6f63..5082c1d 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -172,7 +172,7 @@ void CanvasRenderingContext2D::setStrokeStyle(PassRefPtr<CanvasStyle> style)
     if (!style)
         return;
 
-    if (state().m_strokeStyle && *style == *state().m_strokeStyle)
+    if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentColor(*style))
         return;
 
     if (canvas()->originClean()) {
@@ -200,7 +200,7 @@ void CanvasRenderingContext2D::setFillStyle(PassRefPtr<CanvasStyle> style)
     if (!style)
         return;
 
-    if (state().m_fillStyle && *style == *state().m_fillStyle)
+    if (state().m_fillStyle && state().m_fillStyle->isEquivalentColor(*style))
         return;
  
     if (canvas()->originClean()) {
diff --git a/WebCore/html/canvas/CanvasStyle.cpp b/WebCore/html/canvas/CanvasStyle.cpp
index 4783a90..1ae5236 100644
--- a/WebCore/html/canvas/CanvasStyle.cpp
+++ b/WebCore/html/canvas/CanvasStyle.cpp
@@ -121,24 +121,23 @@ PassRefPtr<CanvasStyle> CanvasStyle::create(PassRefPtr<CanvasPattern> pattern)
     return adoptRef(new CanvasStyle(pattern));
 }
 
-bool operator==(const CanvasStyle& s1, const CanvasStyle& s2)
+bool CanvasStyle::isEquivalentColor(const CanvasStyle& other) const
 {
-    if (s1.m_type != s2.m_type)
+    if (m_type != other.m_type)
         return false;
 
-    switch (s1.m_type) {
+    switch (m_type) {
     case CanvasStyle::RGBA:
-        return s1.m_rgba == s2.m_rgba;
+        return m_rgba == other.m_rgba;
+    case CanvasStyle::CMYKA:
+        return m_cmyka.c == other.m_cmyka.c
+            && m_cmyka.m == other.m_cmyka.m
+            && m_cmyka.y == other.m_cmyka.y
+            && m_cmyka.k == other.m_cmyka.k
+            && m_cmyka.a == other.m_cmyka.a;
     case CanvasStyle::Gradient:
-        return false;
     case CanvasStyle::ImagePattern:
         return false;
-    case CanvasStyle::CMYKA:
-        return s1.m_cmyka.c == s2.m_cmyka.c
-            && s1.m_cmyka.m == s2.m_cmyka.m
-            && s1.m_cmyka.y == s2.m_cmyka.y
-            && s1.m_cmyka.k == s2.m_cmyka.k
-            && s1.m_cmyka.a == s2.m_cmyka.a;
     }
 
     ASSERT_NOT_REACHED();
diff --git a/WebCore/html/canvas/CanvasStyle.h b/WebCore/html/canvas/CanvasStyle.h
index 77edd18..76ba6ef 100644
--- a/WebCore/html/canvas/CanvasStyle.h
+++ b/WebCore/html/canvas/CanvasStyle.h
@@ -55,7 +55,7 @@ namespace WebCore {
         void applyFillColor(GraphicsContext*);
         void applyStrokeColor(GraphicsContext*);
 
-        friend bool operator==(const CanvasStyle&, const CanvasStyle&);
+        bool isEquivalentColor(const CanvasStyle&) const;
 
     private:
         CanvasStyle(RGBA32 rgba);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list