[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 11:50:36 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit f1d1542a0ba8100a67a3536e77b19f57950e8cb7
Author: jamesr at google.com <jamesr at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Aug 9 18:05:38 2010 +0000
2010-08-09 James Robinson <jamesr at chromium.org>
Reviewed by Dimitri Glazkov.
[chromium] Add a PrepareTextureCallback to the chromium canvas layer compositor to upload mixed-mode results before compositing
https://bugs.webkit.org/show_bug.cgi?id=43656
When compositing an accelerated canvas that is using both hardware and software drawing,
we need a callback before compositing the layer to make sure that we upload any software
drawn results to the texture. This will go away as soon as implement all draw calls
in hardware.
To test, run any canvas demo that runs in mixed mode and verifies that the software results
always show up.
* platform/graphics/chromium/CanvasLayerChromium.cpp:
(WebCore::CanvasLayerChromium::updateTextureContents):
* platform/graphics/chromium/CanvasLayerChromium.h:
(WebCore::CanvasLayerChromium::setPrepareTextureCallback):
* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PrepareTextureCallbackImpl::create):
(WebCore::PrepareTextureCallbackImpl::willPrepareTexture):
(WebCore::PrepareTextureCallbackImpl::PrepareTextureCallbackImpl):
(WebCore::PlatformContextSkia::setGraphicsContext3D):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a366172..6ce41db 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2010-08-09 James Robinson <jamesr at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] Add a PrepareTextureCallback to the chromium canvas layer compositor to upload mixed-mode results before compositing
+ https://bugs.webkit.org/show_bug.cgi?id=43656
+
+ When compositing an accelerated canvas that is using both hardware and software drawing,
+ we need a callback before compositing the layer to make sure that we upload any software
+ drawn results to the texture. This will go away as soon as implement all draw calls
+ in hardware.
+
+ To test, run any canvas demo that runs in mixed mode and verifies that the software results
+ always show up.
+
+ * platform/graphics/chromium/CanvasLayerChromium.cpp:
+ (WebCore::CanvasLayerChromium::updateTextureContents):
+ * platform/graphics/chromium/CanvasLayerChromium.h:
+ (WebCore::CanvasLayerChromium::setPrepareTextureCallback):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ (WebCore::PrepareTextureCallbackImpl::create):
+ (WebCore::PrepareTextureCallbackImpl::willPrepareTexture):
+ (WebCore::PrepareTextureCallbackImpl::PrepareTextureCallbackImpl):
+ (WebCore::PlatformContextSkia::setGraphicsContext3D):
+
2010-08-09 Dominic Cooney <dominicc at google.com>
Reviewed by Adam Barth.
diff --git a/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp b/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp
index f290e68..7e732d1 100644
--- a/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp
@@ -75,6 +75,8 @@ void CanvasLayerChromium::updateTextureContents(unsigned textureId)
}
// Update the contents of the texture used by the compositor.
if (m_contentsDirty) {
+ if (m_prepareTextureCallback)
+ m_prepareTextureCallback->willPrepareTexture();
m_context->prepareTexture();
m_contentsDirty = false;
}
diff --git a/WebCore/platform/graphics/chromium/CanvasLayerChromium.h b/WebCore/platform/graphics/chromium/CanvasLayerChromium.h
index a0025a4..98be270 100644
--- a/WebCore/platform/graphics/chromium/CanvasLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/CanvasLayerChromium.h
@@ -54,11 +54,18 @@ public:
static void setShaderProgramId(unsigned shaderProgramId) { m_shaderProgramId = shaderProgramId; }
+ class PrepareTextureCallback : public Noncopyable {
+ public:
+ virtual void willPrepareTexture() = 0;
+ };
+ void setPrepareTextureCallback(PassOwnPtr<PrepareTextureCallback> callback) { m_prepareTextureCallback = callback; }
+
private:
explicit CanvasLayerChromium(GraphicsLayerChromium* owner);
GraphicsContext3D* m_context;
unsigned m_textureId;
bool m_textureChanged;
+ OwnPtr<PrepareTextureCallback> m_prepareTextureCallback;
static unsigned m_shaderProgramId;
};
diff --git a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index b14c6cd..0dfe494 100644
--- a/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -33,6 +33,7 @@
#include "PlatformContextSkia.h"
#include "AffineTransform.h"
+#include "CanvasLayerChromium.h"
#include "GraphicsContext.h"
#include "ImageBuffer.h"
#include "NativeImageSkia.h"
@@ -220,6 +221,12 @@ PlatformContextSkia::PlatformContextSkia(skia::PlatformCanvas* canvas)
PlatformContextSkia::~PlatformContextSkia()
{
+#if USE(GLES2_RENDERING)
+ if (m_gpuCanvas) {
+ CanvasLayerChromium* layer = static_cast<CanvasLayerChromium*>(m_gpuCanvas->context()->platformLayer());
+ layer->setPrepareTextureCallback(0);
+ }
+#endif
}
void PlatformContextSkia::setCanvas(skia::PlatformCanvas* canvas)
@@ -678,10 +685,28 @@ void PlatformContextSkia::applyAntiAliasedClipPaths(WTF::Vector<SkPath>& paths)
#if USE(GLES2_RENDERING)
+class PrepareTextureCallbackImpl : public CanvasLayerChromium::PrepareTextureCallback {
+public:
+ static PassOwnPtr<PrepareTextureCallbackImpl> create(PlatformContextSkia* pcs)
+ {
+ return new PrepareTextureCallbackImpl(pcs);
+ }
+
+ virtual void willPrepareTexture()
+ {
+ m_pcs->prepareForHardwareDraw();
+ }
+private:
+ explicit PrepareTextureCallbackImpl(PlatformContextSkia* pcs) : m_pcs(pcs) {}
+ PlatformContextSkia* m_pcs;
+};
+
void PlatformContextSkia::setGraphicsContext3D(GraphicsContext3D* context, const WebCore::IntSize& size)
{
m_useGPU = true;
m_gpuCanvas = new GLES2Canvas(context, size);
+ CanvasLayerChromium* layer = static_cast<CanvasLayerChromium*>(context->platformLayer());
+ layer->setPrepareTextureCallback(PrepareTextureCallbackImpl::create(this));
}
void PlatformContextSkia::prepareForSoftwareDraw() const
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list