Modified: trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp (103705 => 103706)
--- trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp 2011-12-27 10:16:01 UTC (rev 103705)
+++ trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp 2011-12-27 10:21:51 UTC (rev 103706)
@@ -58,16 +58,13 @@
, m_size(size)
, m_backTextureId(0)
, m_fbo(0)
- , m_useDoubleBuffering(CCProxy::hasImplThread())
{
- if (m_useDoubleBuffering)
- GLC(m_context, m_fbo = m_context->createFramebuffer());
+ GLC(m_context, m_fbo = m_context->createFramebuffer());
}
Canvas2DLayerChromium::~Canvas2DLayerChromium()
{
- if (m_useDoubleBuffering && m_fbo)
- GLC(m_context, m_context->deleteFramebuffer(m_fbo));
+ GLC(m_context, m_context->deleteFramebuffer(m_fbo));
}
void Canvas2DLayerChromium::setTextureId(unsigned textureId)
@@ -95,8 +92,7 @@
if (!drawsContent())
return;
- if (m_useDoubleBuffering)
- m_frontTexture->reserve(m_size, GraphicsContext3D::RGBA);
+ m_frontTexture->reserve(m_size, GraphicsContext3D::RGBA);
if (!needsDisplay())
return;
@@ -125,7 +121,7 @@
void Canvas2DLayerChromium::setTextureManager(TextureManager* textureManager)
{
- if (textureManager && m_useDoubleBuffering)
+ if (textureManager)
m_frontTexture = ManagedTexture::create(textureManager);
else
m_frontTexture.clear();
@@ -133,16 +129,14 @@
void Canvas2DLayerChromium::updateCompositorResources(GraphicsContext3D* context, CCTextureUpdater& updater)
{
- if (!m_backTextureId || !m_frontTexture || !m_frontTexture->isValid(m_size, GraphicsContext3D::RGBA))
+ if (!m_backTextureId || !m_frontTexture->isValid(m_size, GraphicsContext3D::RGBA))
return;
m_frontTexture->bindTexture(context, updater.allocator());
GLC(context, context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo));
GLC(context, context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_backTextureId, 0));
- // FIXME: The copy operation will fail if the m_backTexture is allocated as BGRA since glCopyTex(Sub)Image2D doesn't
- // support the BGRA format. See bug https://bugs.webkit.org/show_bug.cgi?id=75142
- GLC(context, context->copyTexSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, 0, 0, 0, 0, m_size.width(), m_size.height()));
+ GLC(context, context->copyTexImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, 0, 0, m_size.width(), m_size.height(), 0));
GLC(context, context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0));
GLC(context, context->flush());
}
@@ -152,22 +146,17 @@
CanvasLayerChromium::pushPropertiesTo(layer);
CCCanvasLayerImpl* canvasLayer = static_cast<CCCanvasLayerImpl*>(layer);
- if (m_useDoubleBuffering)
- canvasLayer->setTextureId(m_frontTexture->textureId());
- else
- canvasLayer->setTextureId(m_backTextureId);
+ canvasLayer->setTextureId(m_frontTexture->textureId());
}
void Canvas2DLayerChromium::unreserveContentsTexture()
{
- if (m_useDoubleBuffering)
- m_frontTexture->unreserve();
+ m_frontTexture->unreserve();
}
void Canvas2DLayerChromium::cleanupResources()
{
- if (m_useDoubleBuffering)
- m_frontTexture.clear();
+ m_frontTexture.clear();
}
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h (103705 => 103706)
--- trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h 2011-12-27 10:16:01 UTC (rev 103705)
+++ trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h 2011-12-27 10:21:51 UTC (rev 103706)
@@ -71,10 +71,6 @@
IntSize m_size;
unsigned m_backTextureId;
Platform3DObject m_fbo;
- // When m_useDoubleBuffering is true, the compositor will draw using a copy of the
- // canvas' backing texture. This option should be used with the compositor doesn't
- // synchronize its draws with the canvas updates.
- bool m_useDoubleBuffering;
OwnPtr<ManagedTexture> m_frontTexture;
};