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


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

    2010-09-03  Kenneth Russell  <kbr at google.com>
    
            Reviewed by Darin Fisher.
    
            Add thirdparty directory and incorporate GLU tessellator
            https://bugs.webkit.org/show_bug.cgi?id=44707
    
            This directory is intended to contain copies of third-party libraries used
            by WebCore, in particular those which may require some modification in
            order to incorporate.
    
            No tests at this time; these sources are being added in preparation for
            incorporating other code which uses them, at which point the code will be
            exercised and testable.
    
            * thirdparty: Added.
            * thirdparty/README.txt: Added.
            * thirdparty/glu: Added.
            * thirdparty/glu/LICENSE.txt: Added.
            * thirdparty/glu/README.webkit: Added.
            * thirdparty/glu/gluos.h: Added.
            * thirdparty/glu/internal_glu.h: Added.
            * thirdparty/glu/libtess: Added.
            * thirdparty/glu/libtess/GNUmakefile: Added.
            * thirdparty/glu/libtess/Imakefile: Added.
            * thirdparty/glu/libtess/README: Added.
            * thirdparty/glu/libtess/alg-outline: Added.
            * thirdparty/glu/libtess/dict-list.h: Added.
            * thirdparty/glu/libtess/dict.c: Added.
            * thirdparty/glu/libtess/dict.h: Added.
            * thirdparty/glu/libtess/geom.c: Added.
            * thirdparty/glu/libtess/geom.h: Added.
            * thirdparty/glu/libtess/memalloc.c: Added.
            * thirdparty/glu/libtess/memalloc.h: Added.
            * thirdparty/glu/libtess/mesh.c: Added.
            * thirdparty/glu/libtess/mesh.h: Added.
            * thirdparty/glu/libtess/normal.c: Added.
            * thirdparty/glu/libtess/normal.h: Added.
            * thirdparty/glu/libtess/priorityq-heap.c: Added.
            * thirdparty/glu/libtess/priorityq-heap.h: Added.
            * thirdparty/glu/libtess/priorityq-sort.h: Added.
            * thirdparty/glu/libtess/priorityq.c: Added.
            * thirdparty/glu/libtess/priorityq.h: Added.
            * thirdparty/glu/libtess/render.c: Added.
            * thirdparty/glu/libtess/render.h: Added.
            * thirdparty/glu/libtess/sweep.c: Added.
            * thirdparty/glu/libtess/sweep.h: Added.
            * thirdparty/glu/libtess/tess.c: Added.
            * thirdparty/glu/libtess/tess.h: Added.
            * thirdparty/glu/libtess/tessmono.c: Added.
            * thirdparty/glu/libtess/tessmono.h: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66785 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 128ff9f..3dfd6fe 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -391,6 +391,29 @@
 
 2010-09-03  James Robinson  <jamesr at chromium.org>
 
+        Reviewed by Darin Fisher.
+
+        [chromium] Implement ImageBufferSkia::draw on the GPU when possible
+        https://bugs.webkit.org/show_bug.cgi?id=45207
+
+        When drawing from an ImageBuffer into a GraphicsContext, attempt to do the
+        draw in hardware when possible.  This is how canvas 2d's drawImage(canvas, ...)
+        is implemented.  Adds new API to DrawingBuffer to request a texture containing
+        the DrawingBuffer's current rendering results.
+
+        Test: covered fast/canvas/drawImage.html and all other tests that draw from one
+        2d canvas into another.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::drawImage):
+        * platform/graphics/chromium/DrawingBufferChromium.cpp:
+        (WebCore::DrawingBuffer::getRenderingResultsAsTexture):
+        * platform/graphics/gpu/DrawingBuffer.h:
+        * platform/graphics/skia/ImageBufferSkia.cpp:
+        (WebCore::ImageBuffer::draw):
+
+2010-09-03  James Robinson  <jamesr at chromium.org>
+
         Reviewed by Kenneth Russell.
 
         [chromium] Null out Canvas2DLayerChromium's back reference to DrawingBuffer on destruction
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index f261c1d..49f54fb 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -1288,7 +1288,16 @@ void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const
     if (!sourceCanvas->originClean())
         canvas()->setOriginTainted();
 
+#if ENABLE(ACCELERATED_2D_CANVAS)
+    // If we're drawing from one accelerated canvas 2d to another, avoid calling sourceCanvas->makeRenderingResultsAvailable()
+    // as that will do a readback to software.
+    CanvasRenderingContext* sourceContext = sourceCanvas->renderingContext();
+    // FIXME: Implement an accelerated path for drawing from a WebGL canvas to a 2d canvas when possible.
+    if (!isAccelerated() || !sourceContext || !sourceContext->isAccelerated() || !sourceContext->is2d())
+        sourceCanvas->makeRenderingResultsAvailable();
+#else
     sourceCanvas->makeRenderingResultsAvailable();
+#endif
 
     c->drawImageBuffer(buffer, DeviceColorSpace, destRect, sourceRect, state().m_globalComposite);
     didDraw(destRect);
diff --git a/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp b/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
index 720f8d6..76c1570 100644
--- a/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
+++ b/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
@@ -119,4 +119,9 @@ PlatformLayer* DrawingBuffer::platformLayer()
     return m_internal->platformLayer.get();
 }
 
+unsigned DrawingBuffer::getRenderingResultsAsTexture()
+{
+    return m_internal->offscreenColorTexture;
+}
+
 }
diff --git a/WebCore/platform/graphics/gpu/DrawingBuffer.h b/WebCore/platform/graphics/gpu/DrawingBuffer.h
index 1b44f4d..031867f 100644
--- a/WebCore/platform/graphics/gpu/DrawingBuffer.h
+++ b/WebCore/platform/graphics/gpu/DrawingBuffer.h
@@ -58,6 +58,8 @@ public:
     void publishToPlatformLayer();
     IntSize size() const { return m_size; }
 
+    unsigned getRenderingResultsAsTexture();
+
     class WillPublishCallback : public Noncopyable {
     public:
         virtual void willPublish() = 0;
diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index 9403406..e0bda03 100644
--- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -36,10 +36,12 @@
 #include "Base64.h"
 #include "BitmapImage.h"
 #include "BitmapImageSingleFrameSkia.h"
+#include "DrawingBuffer.h"
+#include "GLES2Canvas.h"
 #include "GraphicsContext.h"
 #include "ImageData.h"
-#include "PlatformContextSkia.h"
 #include "PNGImageEncoder.h"
+#include "PlatformContextSkia.h"
 #include "SkColorPriv.h"
 #include "SkiaUtils.h"
 
@@ -108,6 +110,16 @@ void ImageBuffer::clip(GraphicsContext* context, const FloatRect& rect) const
 void ImageBuffer::draw(GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect,
                        CompositeOperator op, bool useLowQualityScale)
 {
+    if (m_data.m_platformContext.useGPU() && context->platformContext()->useGPU()) {
+        DrawingBuffer* sourceDrawingBuffer = m_data.m_platformContext.gpuCanvas()->drawingBuffer();
+        unsigned sourceTexture = sourceDrawingBuffer->getRenderingResultsAsTexture();
+        FloatRect destRectFlipped(destRect);
+        destRectFlipped.setY(destRect.y() + destRect.height());
+        destRectFlipped.setHeight(-destRect.height());
+        context->platformContext()->gpuCanvas()->drawTexturedRect(sourceTexture, m_size, srcRect, destRectFlipped, styleColorSpace, op);
+        return;
+    }
+
     RefPtr<Image> image = BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), context == m_context);
     context->drawImage(image.get(), styleColorSpace, destRect, srcRect, op, useLowQualityScale);
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list