[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:37:16 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 715e99dffe71bfc9b938c69c3e30b0e3b0327cf9
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 2 23:06:53 2010 +0000

    2010-02-02  Garret Kelly  <gdk at chromium.org>
    
            Reviewed by David Levin.
    
            When using the Skia graphics context, the beginTransparencyLayer call
            currently creates a new layer, but does not keep the current
            compositing mode for use when merging the created layer back onto the
            rest of the context. This patch fixes that.
            https://bugs.webkit.org/show_bug.cgi?id=34491
    
            fast/backgrounds/svg-as-mask.html is affected by this change in Chromium,
            but not fixed. This is the first of a series of patches to fix it.
    
            * platform/graphics/skia/GraphicsContextSkia.cpp:
            (WebCore::GraphicsContext::beginTransparencyLayer):
            * platform/graphics/skia/PlatformContextSkia.cpp:
            (PlatformContextSkia::beginTransparencyLayer):
            * platform/graphics/skia/PlatformContextSkia.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54257 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 92e6fc3..318dd28 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-02-02  Garret Kelly  <gdk at chromium.org>
+
+        Reviewed by David Levin.
+
+        When using the Skia graphics context, the beginTransparencyLayer call
+        currently creates a new layer, but does not keep the current
+        compositing mode for use when merging the created layer back onto the
+        rest of the context. This patch fixes that.
+        https://bugs.webkit.org/show_bug.cgi?id=34491
+
+        fast/backgrounds/svg-as-mask.html is affected by this change in Chromium,
+        but not fixed. This is the first of a series of patches to fix it.
+
+        * platform/graphics/skia/GraphicsContextSkia.cpp:
+        (WebCore::GraphicsContext::beginTransparencyLayer):
+        * platform/graphics/skia/PlatformContextSkia.cpp:
+        (PlatformContextSkia::beginTransparencyLayer):
+        * platform/graphics/skia/PlatformContextSkia.h:
+
 2010-02-02  Kwang Yul Seo  <skyul at company100.net>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index bd97ca2..9eb49e6 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -264,15 +264,7 @@ void GraphicsContext::beginTransparencyLayer(float opacity)
     if (paintingDisabled())
         return;
 
-    // We need the "alpha" layer flag here because the base layer is opaque
-    // (the surface of the page) but layers on top may have transparent parts.
-    // Without explicitly setting the alpha flag, the layer will inherit the
-    // opaque setting of the base and some things won't work properly.
-    platformContext()->canvas()->saveLayerAlpha(
-        0,
-        static_cast<unsigned char>(opacity * 255),
-        static_cast<SkCanvas::SaveFlags>(SkCanvas::kHasAlphaLayer_SaveFlag |
-                                         SkCanvas::kFullColorLayer_SaveFlag));
+    platformContext()->beginTransparencyLayer(opacity);
 }
 
 void GraphicsContext::endTransparencyLayer()
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 92a1870..6f51a5d 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -622,3 +622,19 @@ void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths)
 
     m_canvas->restore();
 }
+
+void PlatformContextSkia::beginTransparencyLayer(float opacity)
+{
+    SkPaint layerPaint;
+    setupPaintCommon(&layerPaint);
+    layerPaint.setAlpha(static_cast<unsigned char>(opacity * 255));
+
+    // We need the "alpha" layer flag here because the base layer is opaque
+    // (the surface of the page) but layers on top may have transparent parts.
+    // Without explicitly setting the alpha flag, the layer will inherit the
+    // opaque setting of the base and some things won't work properly.
+    SkCanvas::SaveFlags layerFlags = static_cast<SkCanvas::SaveFlags>(
+        SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag);
+
+    m_canvas->saveLayer(0, &layerPaint, layerFlags);
+}
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.h b/WebCore/platform/graphics/skia/PlatformContextSkia.h
index e445262..4bd474d 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -137,6 +137,8 @@ public:
     void addPath(const SkPath&);
     SkPath currentPathInLocalCoordinates() const;
 
+    void beginTransparencyLayer(float opacity);
+
     // Returns the fill color. The returned color has it's alpha adjusted
     // by the current alpha.
     SkColor effectiveFillColor() const;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list