Title: [87987] trunk/Source/WebCore
- Revision
- 87987
- Author
- [email protected]
- Date
- 2011-06-02 19:10:44 -0700 (Thu, 02 Jun 2011)
Log Message
2011-06-02 John Bates <[email protected]>
Reviewed by James Robinson.
DrawingBufferChromium cleanup:
- Correct FIXME comment about synchronization.
- Remove unnecessary DrawingBufferInternal indirection struct
and its unused offscreenColorTexture member.
https://bugs.webkit.org/show_bug.cgi?id=61953
* platform/graphics/chromium/DrawingBufferChromium.cpp:
(WebCore::DrawingBuffer::DrawingBuffer):
(WebCore::DrawingBuffer::~DrawingBuffer):
(WebCore::DrawingBuffer::publishToPlatformLayer):
(WebCore::DrawingBuffer::didReset):
(WebCore::DrawingBuffer::platformLayer):
* platform/graphics/gpu/DrawingBuffer.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (87986 => 87987)
--- trunk/Source/WebCore/ChangeLog 2011-06-03 01:50:43 UTC (rev 87986)
+++ trunk/Source/WebCore/ChangeLog 2011-06-03 02:10:44 UTC (rev 87987)
@@ -1,3 +1,21 @@
+2011-06-02 John Bates <[email protected]>
+
+ Reviewed by James Robinson.
+
+ DrawingBufferChromium cleanup:
+ - Correct FIXME comment about synchronization.
+ - Remove unnecessary DrawingBufferInternal indirection struct
+ and its unused offscreenColorTexture member.
+ https://bugs.webkit.org/show_bug.cgi?id=61953
+
+ * platform/graphics/chromium/DrawingBufferChromium.cpp:
+ (WebCore::DrawingBuffer::DrawingBuffer):
+ (WebCore::DrawingBuffer::~DrawingBuffer):
+ (WebCore::DrawingBuffer::publishToPlatformLayer):
+ (WebCore::DrawingBuffer::didReset):
+ (WebCore::DrawingBuffer::platformLayer):
+ * platform/graphics/gpu/DrawingBuffer.h:
+
2011-06-02 Andrey Kosyakov <[email protected]>
Reviewed by Pavel Feldman.
Modified: trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp (87986 => 87987)
--- trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp 2011-06-03 01:50:43 UTC (rev 87986)
+++ trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp 2011-06-03 02:10:44 UTC (rev 87987)
@@ -46,13 +46,6 @@
namespace WebCore {
-struct DrawingBufferInternal {
- unsigned offscreenColorTexture;
-#if USE(ACCELERATED_COMPOSITING)
- RefPtr<Canvas2DLayerChromium> platformLayer;
-#endif
-};
-
static unsigned generateColorTexture(GraphicsContext3D* context, const IntSize& size)
{
unsigned offscreenColorTexture = context->createTexture();
@@ -86,7 +79,6 @@
, m_stencilBuffer(0)
, m_multisampleFBO(0)
, m_multisampleColorBuffer(0)
- , m_internal(adoptPtr(new DrawingBufferInternal))
#if USE(SKIA)
, m_grContext(0)
#endif
@@ -108,8 +100,8 @@
DrawingBuffer::~DrawingBuffer()
{
#if USE(ACCELERATED_COMPOSITING)
- if (m_internal->platformLayer)
- m_internal->platformLayer->setDrawingBuffer(0);
+ if (m_platformLayer)
+ m_platformLayer->setDrawingBuffer(0);
#endif
if (!m_context)
@@ -128,12 +120,11 @@
m_callback->willPublish();
if (multisample())
commit();
- unsigned parentTexture = m_internal->platformLayer->textureId();
- // FIXME: We do the copy in the canvas' (child) context so that it executes in the correct order relative to
- // other commands in the child context. This ensures that the parent texture always contains a complete
- // frame and not some intermediate result. However, there is no synchronization to ensure that this copy
- // happens before the compositor draws. This means we might draw stale frames sometimes. Ideally this
- // would insert a fence into the child command stream that the compositor could wait for.
+ unsigned parentTexture = m_platformLayer->textureId();
+ // We do the copy in the canvas' (child) context so that it executes in the correct order relative to
+ // other commands in the child context. This ensures that the parent texture always contains a complete
+ // frame and not some intermediate result. LayerRendererChromium uses glSetLatch to make sure the child
+ // context completes before the parent context consumes the texture.
m_context->makeContextCurrent();
#if USE(SKIA)
if (m_grContext)
@@ -147,17 +138,17 @@
void DrawingBuffer::didReset()
{
#if USE(ACCELERATED_COMPOSITING)
- if (m_internal->platformLayer)
- m_internal->platformLayer->setTextureChanged();
+ if (m_platformLayer)
+ m_platformLayer->setTextureChanged();
#endif
}
#if USE(ACCELERATED_COMPOSITING)
PlatformLayer* DrawingBuffer::platformLayer()
{
- if (!m_internal->platformLayer)
- m_internal->platformLayer = Canvas2DLayerChromium::create(this, 0);
- return m_internal->platformLayer.get();
+ if (!m_platformLayer)
+ m_platformLayer = Canvas2DLayerChromium::create(this, 0);
+ return m_platformLayer.get();
}
#endif
Modified: trunk/Source/WebCore/platform/graphics/gpu/DrawingBuffer.h (87986 => 87987)
--- trunk/Source/WebCore/platform/graphics/gpu/DrawingBuffer.h 2011-06-03 01:50:43 UTC (rev 87986)
+++ trunk/Source/WebCore/platform/graphics/gpu/DrawingBuffer.h 2011-06-03 02:10:44 UTC (rev 87987)
@@ -49,8 +49,8 @@
namespace WebCore {
-#if PLATFORM(CHROMIUM)
-struct DrawingBufferInternal;
+#if PLATFORM(CHROMIUM) && USE(ACCELERATED_COMPOSITING)
+class Canvas2DLayerChromium;
#endif
// Manages a rendering target (framebuffer + attachment) for a canvas. Can publish its rendering
@@ -138,8 +138,10 @@
#if PLATFORM(CHROMIUM)
OwnPtr<WillPublishCallback> m_callback;
- OwnPtr<DrawingBufferInternal> m_internal;
+#if USE(ACCELERATED_COMPOSITING)
+ RefPtr<Canvas2DLayerChromium> m_platformLayer;
#endif
+#endif
#if PLATFORM(MAC)
RetainPtr<WebGLLayer> m_platformLayer;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes