Index: Source/core/html/canvas/WebGLRenderingContextBase.cpp |
diff --git a/Source/core/html/canvas/WebGLRenderingContextBase.cpp b/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
index 71e6f1022aec0114bced0f9d3fee4b4e4a32b73b..6282e43fc67848fb295aa462388358eda280a5e8 100644 |
--- a/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
+++ b/Source/core/html/canvas/WebGLRenderingContextBase.cpp |
@@ -833,9 +833,12 @@ void WebGLRenderingContextBase::paintRenderingResultsToCanvas() |
m_drawingBuffer->commit(); |
if (!(canvas()->buffer())->copyRenderingResultsFromDrawingBuffer(m_drawingBuffer.get())) { |
+ restoreCurrentTexture2D(); |
canvas()->ensureUnacceleratedImageBuffer(); |
if (canvas()->hasImageBuffer()) |
m_drawingBuffer->paintRenderingResultsToCanvas(canvas()->buffer()); |
+ } else { |
+ restoreCurrentTexture2D(); |
} |
if (m_framebufferBinding) |
@@ -3414,6 +3417,7 @@ void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in |
if (buffer && buffer->copyToPlatformTexture(m_context.get(), texture->object(), internalformat, type, |
level, m_unpackPremultiplyAlpha, m_unpackFlipY)) { |
texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas->height(), type); |
+ restoreCurrentTexture2D(); |
return; |
} |
} else { |
@@ -3421,9 +3425,11 @@ void WebGLRenderingContextBase::texImage2D(GLenum target, GLint level, GLenum in |
if (gl && gl->m_drawingBuffer->copyToPlatformTexture(m_context.get(), texture->object(), internalformat, type, |
Ken Russell (switch to Gerrit)
2014/03/13 19:35:54
If the save/restore in DrawingBuffer::copyToPlatfo
|
level, m_unpackPremultiplyAlpha, m_unpackFlipY)) { |
texture->setLevelInfo(target, level, internalformat, canvas->width(), canvas->height(), type); |
+ restoreCurrentTexture2D(); |
return; |
} |
} |
+ restoreCurrentTexture2D(); |
Ken Russell (switch to Gerrit)
2014/03/13 19:35:54
It might be worth creating a class which makes the
|
} |
RefPtr<ImageData> imageData = canvas->getImageData(); |
@@ -5338,7 +5344,7 @@ void WebGLRenderingContextBase::maybeRestoreContext(Timer<WebGLRenderingContextB |
return; |
blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes->attributes(canvas()->document().topDocument().url().string(), settings); |
- OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(attributes)); |
+ OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::current()->createOffscreenGraphicsContext3D(attributes, 0)); |
if (!context) { |
if (m_contextLostMode == RealLostContext) { |
m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts, FROM_HERE); |