summaryrefslogtreecommitdiffstats
path: root/WebCore/html/canvas/WebGLRenderingContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html/canvas/WebGLRenderingContext.cpp')
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index f567ac8..fb17db9 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -141,18 +141,22 @@ void WebGLRenderingContext::markContextChanged()
RenderBox* renderBox = canvas()->renderBox();
if (renderBox && renderBox->hasLayer() && renderBox->layer()->hasAcceleratedCompositing())
renderBox->layer()->rendererContentChanged();
+ else {
#endif
- if (!m_markedCanvasDirty) {
- // Make sure the canvas's image buffer is allocated.
- canvas()->buffer();
- canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height()));
- m_markedCanvasDirty = true;
+ if (!m_markedCanvasDirty)
+ canvas()->willDraw(FloatRect(0, 0, canvas()->width(), canvas()->height()));
+#if USE(ACCELERATED_COMPOSITING)
}
+#endif
+ m_markedCanvasDirty = true;
}
bool WebGLRenderingContext::paintRenderingResultsToCanvas()
{
if (m_markedCanvasDirty) {
+ // FIXME: It should not be necessary to clear the image before doing a readback.
+ // Investigate why this is needed and remove if possible.
+ canvas()->buffer()->clearImage();
m_markedCanvasDirty = false;
m_context->paintRenderingResultsToCanvas(this);
return true;