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

jamesr at google.com jamesr at google.com
Wed Dec 22 13:00:38 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 24ce5630555a543c7a9eff14bac409fa6cef459f
Author: jamesr at google.com <jamesr at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Sep 4 00:58:43 2010 +0000

    2010-09-03  James Robinson  <jamesr at chromium.org>
    
            Reviewed by Kenneth Russell.
    
            Force 2d canvases to be rendered in software when the composite operation isn't source-over
            https://bugs.webkit.org/show_bug.cgi?id=45216
    
            The current accelerated 2d canvas implementation is very slow for composite operations other
            than the default.  This patch forces a canvas to be rendered in software if any other operation
            is set until we accelerate the rest.
    
            Tested by any of the fast/canvas tests that use a non-default globalCompositeOperation.
    
            * html/canvas/CanvasRenderingContext2D.cpp:
            (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation):
            * platform/graphics/skia/PlatformContextSkia.cpp:
            (WebCore::PlatformContextSkia::setSharedGraphicsContext3D):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66782 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1bc87b1..76cde62 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-03  James Robinson  <jamesr at chromium.org>
+
+        Reviewed by Kenneth Russell.
+
+        Force 2d canvases to be rendered in software when the composite operation isn't source-over
+        https://bugs.webkit.org/show_bug.cgi?id=45216
+
+        The current accelerated 2d canvas implementation is very slow for composite operations other
+        than the default.  This patch forces a canvas to be rendered in software if any other operation
+        is set until we accelerate the rest.
+
+        Tested by any of the fast/canvas tests that use a non-default globalCompositeOperation.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation):
+        * platform/graphics/skia/PlatformContextSkia.cpp:
+        (WebCore::PlatformContextSkia::setSharedGraphicsContext3D):
+
 2010-09-03  Paul Sawaya  <psawaya at apple.com>
 
         Reviewed by Chris Marrin.
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 22d3e2d..f261c1d 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -441,6 +441,15 @@ void CanvasRenderingContext2D::setGlobalCompositeOperation(const String& operati
     if (!c)
         return;
     c->setCompositeOperation(op);
+#if ENABLE(ACCELERATED_2D_CANVAS)
+    if (isAccelerated() && op != CompositeSourceOver) {
+        c->setSharedGraphicsContext3D(0, 0, IntSize());
+        m_drawingBuffer.clear();
+        m_context3D.clear();
+        // Mark as needing a style recalc so our compositing layer can be removed.
+        canvas()->setNeedsStyleRecalc(SyntheticStyleChange);
+    }
+#endif
 }
 
 void CanvasRenderingContext2D::scale(float sx, float sy)
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 52fe327..4a2153e 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -698,10 +698,17 @@ private:
 
 void PlatformContextSkia::setSharedGraphicsContext3D(SharedGraphicsContext3D* context, DrawingBuffer* drawingBuffer, const WebCore::IntSize& size)
 {
-    m_useGPU = true;
-    m_gpuCanvas = new GLES2Canvas(context, drawingBuffer, size);
-    m_uploadTexture.clear();
-    drawingBuffer->setWillPublishCallback(WillPublishCallbackImpl::create(this));
+    if (context && drawingBuffer) {
+        m_useGPU = true;
+        m_gpuCanvas = new GLES2Canvas(context, drawingBuffer, size);
+        m_uploadTexture.clear();
+        drawingBuffer->setWillPublishCallback(WillPublishCallbackImpl::create(this));
+    } else {
+        syncSoftwareCanvas();
+        m_uploadTexture.clear();
+        m_gpuCanvas.clear();
+        m_useGPU = false;
+    }
 }
 
 void PlatformContextSkia::prepareForSoftwareDraw() const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list