[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:12:14 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 65d6f10f173a947c7c51b162508ab79e58c73c5a
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 15 00:27:37 2010 +0000

    2010-07-14  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Darin Adler.
    
            Add functions to extract individual RGBA32 components
            https://bugs.webkit.org/show_bug.cgi?id=42305
    
            * html/canvas/CanvasRenderingContext2D.cpp:
            (WebCore::CanvasRenderingContext2D::willDraw): Use alphaChannel()
            * platform/graphics/Color.h:
            (WebCore::redChannel):
            (WebCore::greenChannel):
            (WebCore::blueChannel):
            (WebCore::alphaChannel):
            (WebCore::Color::red):
            (WebCore::Color::green):
            (WebCore::Color::blue):
            (WebCore::Color::alpha):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63382 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 64b8c4d..a4af0f2 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-07-14  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Add functions to extract individual RGBA32 components
+        https://bugs.webkit.org/show_bug.cgi?id=42305
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::willDraw): Use alphaChannel()
+        * platform/graphics/Color.h:
+        (WebCore::redChannel):
+        (WebCore::greenChannel):
+        (WebCore::blueChannel):
+        (WebCore::alphaChannel):
+        (WebCore::Color::red):
+        (WebCore::Color::green):
+        (WebCore::Color::blue):
+        (WebCore::Color::alpha):
+
 2010-07-14  Alexey Proskuryakov  <ap at apple.com>
 
         Not reviewed.
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 9748ff5..b3bafc6 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -1375,7 +1375,7 @@ void CanvasRenderingContext2D::willDraw(const FloatRect& r, unsigned options)
         dirtyRect = ctm.mapRect(r);
     }
     
-    if (options & CanvasWillDrawApplyShadow && Color(state().m_shadowColor).alpha()) {
+    if (options & CanvasWillDrawApplyShadow && alphaChannel(state().m_shadowColor)) {
         // The shadow gets applied after transformation
         FloatRect shadowRect(dirtyRect);
         shadowRect.move(state().m_shadowOffset);
diff --git a/WebCore/platform/graphics/Color.h b/WebCore/platform/graphics/Color.h
index 7192d16..d41e361 100644
--- a/WebCore/platform/graphics/Color.h
+++ b/WebCore/platform/graphics/Color.h
@@ -69,6 +69,11 @@ RGBA32 makeRGBAFromCMYKA(float c, float m, float y, float k, float a);
 
 int differenceSquared(const Color&, const Color&);
 
+inline int redChannel(RGBA32 color) { return (color >> 16) & 0xFF; }
+inline int greenChannel(RGBA32 color) { return (color >> 8) & 0xFF; }
+inline int blueChannel(RGBA32 color) { return color & 0xFF; }
+inline int alphaChannel(RGBA32 color) { return (color >> 24) & 0xFF; }
+
 class Color : public FastAllocBase {
 public:
     Color() : m_color(0), m_valid(false) { }
@@ -93,10 +98,10 @@ public:
 
     bool hasAlpha() const { return alpha() < 255; }
 
-    int red() const { return (m_color >> 16) & 0xFF; }
-    int green() const { return (m_color >> 8) & 0xFF; }
-    int blue() const { return m_color & 0xFF; }
-    int alpha() const { return (m_color >> 24) & 0xFF; }
+    int red() const { return redChannel(m_color); }
+    int green() const { return greenChannel(m_color); }
+    int blue() const { return blueChannel(m_color); }
+    int alpha() const { return alphaChannel(m_color); }
     
     RGBA32 rgb() const { return m_color; } // Preserve the alpha.
     void setRGB(int r, int g, int b) { m_color = makeRGB(r, g, b); m_valid = true; }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list