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

senorblanco at chromium.org senorblanco at chromium.org
Wed Dec 22 12:29:31 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1bcb34b8fa400432f6bfc2faf8b02b1d599e69b5
Author: senorblanco at chromium.org <senorblanco at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Aug 24 19:17:19 2010 +0000

    2010-08-24  Stephen White  <senorblanco at chromium.org>
    
            Reviewed by Kenneth Russell.
    
            Fix accelerated 2d canvas with accelerated compositing off.
            https://bugs.webkit.org/show_bug.cgi?id=44525
    
            Tested by running with --enable-accelerated-2d-canvas with
            --enable-accelerated-compositing off.
            ImageBuffer::copyImage changes covered by
            LayoutTests/fast/canvas/canvas-pattern-*.html.
    
            * html/HTMLCanvasElement.cpp:
            (WebCore::HTMLCanvasElement::paint):
            Extend the accelerated compositing check and the readback for
            non-accelerated compositing to accelerated 2D canvas also.
            * html/canvas/CanvasRenderingContext.cpp:
            * html/canvas/CanvasRenderingContext.h:
            (WebCore::CanvasRenderingContext::paintsIntoCanvasBuffer):
            Move this logic from WebGL to common canvas context code.
            * html/canvas/WebGLRenderingContext.h:
            Remove implementation of paintsIntoCanvasBuffer.
            * platform/graphics/skia/ImageBufferSkia.cpp:
            (WebCore::ImageBuffer::copyImage):
            When copying the image for patterns, sync the software canvas.
            * platform/graphics/skia/PlatformContextSkia.cpp:
            (WebCore::PlatformContextSkia::prepareForSoftwareDraw):
            Use SkDevice::eraseColor() to clear the canvas for mixed mode rendering.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65921 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index dec181e..6e42fd7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,32 @@
+2010-08-24  Stephen White  <senorblanco at chromium.org>
+
+        Reviewed by Kenneth Russell.
+
+        Fix accelerated 2d canvas with accelerated compositing off.
+        https://bugs.webkit.org/show_bug.cgi?id=44525
+
+        Tested by running with --enable-accelerated-2d-canvas with
+        --enable-accelerated-compositing off.
+        ImageBuffer::copyImage changes covered by
+        LayoutTests/fast/canvas/canvas-pattern-*.html.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::paint):
+        Extend the accelerated compositing check and the readback for
+        non-accelerated compositing to accelerated 2D canvas also.
+        * html/canvas/CanvasRenderingContext.cpp:
+        * html/canvas/CanvasRenderingContext.h:
+        (WebCore::CanvasRenderingContext::paintsIntoCanvasBuffer):
+        Move this logic from WebGL to common canvas context code.
+        * html/canvas/WebGLRenderingContext.h:
+        Remove implementation of paintsIntoCanvasBuffer.
+        * platform/graphics/skia/ImageBufferSkia.cpp:
+        (WebCore::ImageBuffer::copyImage):
+        When copying the image for patterns, sync the software canvas.
+        * platform/graphics/skia/PlatformContextSkia.cpp:
+        (WebCore::PlatformContextSkia::prepareForSoftwareDraw):
+        Use SkDevice::eraseColor() to clear the canvas for mixed mode rendering.
+
 2010-08-24  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index bf6b95e..c8355ca 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -272,15 +272,11 @@ void HTMLCanvasElement::paint(GraphicsContext* context, const IntRect& r)
     if (context->paintingDisabled())
         return;
     
-#if ENABLE(3D_CANVAS)
-    WebGLRenderingContext* context3D = 0;
-    if (m_context && m_context->is3d()) {
-        context3D = static_cast<WebGLRenderingContext*>(m_context.get());
-        if (!context3D->paintsIntoCanvasBuffer())
+    if (m_context) {
+        if (!m_context->paintsIntoCanvasBuffer())
             return;
-        context3D->paintRenderingResultsToCanvas();
+        m_context->paintRenderingResultsToCanvas();
     }
-#endif
 
     if (hasCreatedImageBuffer()) {
         ImageBuffer* imageBuffer = buffer();
diff --git a/WebCore/html/canvas/CanvasRenderingContext.cpp b/WebCore/html/canvas/CanvasRenderingContext.cpp
index fed8cb2..1e897d3 100644
--- a/WebCore/html/canvas/CanvasRenderingContext.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext.cpp
@@ -25,7 +25,9 @@
 
 #include "config.h"
 #include "CanvasRenderingContext.h"
-
+#if ENABLE(ACCELERATED_2D_CANVAS) || ENABLE(3D_CANVAS)
+#include "GraphicsContext3D.h"
+#endif
 #include "HTMLCanvasElement.h"
 
 namespace WebCore {
@@ -45,4 +47,13 @@ void CanvasRenderingContext::deref()
     m_canvas->deref(); 
 }
 
+bool CanvasRenderingContext::paintsIntoCanvasBuffer() const
+{
+#if ENABLE(ACCELERATED_2D_CANVAS) || ENABLE(3D_CANVAS)
+    if (GraphicsContext3D* context3D = graphicsContext3D())
+        return context3D->paintsIntoCanvasBuffer();
+#endif
+    return true;
+}
+
 } // namespace WebCore
diff --git a/WebCore/html/canvas/CanvasRenderingContext.h b/WebCore/html/canvas/CanvasRenderingContext.h
index cb26363..2cdbe1d 100644
--- a/WebCore/html/canvas/CanvasRenderingContext.h
+++ b/WebCore/html/canvas/CanvasRenderingContext.h
@@ -54,6 +54,7 @@ namespace WebCore {
         virtual GraphicsContext3D* graphicsContext3D() const { return 0; }
 
         virtual void paintRenderingResultsToCanvas() {}
+        bool paintsIntoCanvasBuffer() const;
 
     private:
         HTMLCanvasElement* m_canvas;
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index 5b15e6c..0cb78ae 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -285,8 +285,6 @@ public:
 
     void removeObject(WebGLObject*);
 
-    bool paintsIntoCanvasBuffer() const { return m_context->paintsIntoCanvasBuffer(); }
-
   private:
     friend class WebGLObject;
 
diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index 19cf0f0..9403406 100644
--- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -94,6 +94,7 @@ bool ImageBuffer::drawsUsingCopy() const
 
 PassRefPtr<Image> ImageBuffer::copyImage() const
 {
+    m_context->platformContext()->syncSoftwareCanvas();
     return BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), true);
 }
 
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index 737323b..b9de0a2 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -733,11 +733,7 @@ void PlatformContextSkia::prepareForSoftwareDraw() const
 
         if (m_state->m_xferMode == SkXfermode::kSrcOver_Mode) {
             // Last drawn on hardware; clear out the canvas.
-            m_canvas->save();
-            SkRect bounds = {0, 0, m_canvas->getDevice()->width(), m_canvas->getDevice()->height()};
-            m_canvas->clipRect(bounds, SkRegion::kReplace_Op);
-            m_canvas->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
-            m_canvas->restore();
+            m_canvas->getDevice()->eraseColor(0);
             // Start compositing into the empty canvas.
             m_backingStoreState = Mixed;
         } else {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list