[chromium] During tear down, prevent the WebGLLayerChromium instance from attempting...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Nov 2011 05:12:33 +0000 (05:12 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Nov 2011 05:12:33 +0000 (05:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72423

Patch by Jeff Timanus <twiz@chromium.org> on 2011-11-15
Reviewed by Kenneth Russell.

* platform/graphics/chromium/WebGLLayerChromium.cpp:
(WebCore::WebGLLayerChromium::setDrawingBuffer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100401 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp

index eb86eda3fa7b14320243b0222a52c4cca2b8c756..6da1f6bedef818a4ed492a1e206fa83aa9b321f4 100644 (file)
@@ -1,3 +1,13 @@
+2011-11-15  Jeff Timanus  <twiz@chromium.org>
+
+        [chromium] During tear down, prevent the WebGLLayerChromium instance from attempting to stop a timer for a NULL context.
+        https://bugs.webkit.org/show_bug.cgi?id=72423
+
+        Reviewed by Kenneth Russell.
+
+        * platform/graphics/chromium/WebGLLayerChromium.cpp:
+        (WebCore::WebGLLayerChromium::setDrawingBuffer):
+
 2011-11-15  Mark Hahnenberg  <mhahnenberg@apple.com>
 
         Rebaseline generated WebCore bindings
index a4a9a805bbecc50df484e7d62447fcc1e691ca49..276f3c9fc2fe107f163b2aba098c03fbb3344cb6 100644 (file)
@@ -51,6 +51,7 @@ WebGLLayerChromium::WebGLLayerChromium(CCLayerDelegate* delegate)
     : CanvasLayerChromium(delegate)
     , m_textureChanged(true)
     , m_textureUpdated(false)
+    , m_drawingBuffer(0)
 {
 }
 
@@ -125,11 +126,16 @@ void WebGLLayerChromium::contentChanged()
 void WebGLLayerChromium::setDrawingBuffer(DrawingBuffer* drawingBuffer)
 {
     bool drawingBufferChanged = (m_drawingBuffer != drawingBuffer);
-    m_drawingBuffer = drawingBuffer;
 
-    if (layerTreeHost() && drawingBufferChanged)
-        layerTreeHost()->stopRateLimiter(context());
+    // The GraphicsContext3D used by the layer is the context associated with
+    // the drawing buffer. If the drawing buffer is changing, make sure
+    // to stop the rate limiter on the old context, not the new context from the
+    // new drawing buffer.
+    GraphicsContext3D* context3D = context();
+    if (layerTreeHost() && drawingBufferChanged && context3D)
+        layerTreeHost()->stopRateLimiter(context3D);
 
+    m_drawingBuffer = drawingBuffer;
     if (!m_drawingBuffer)
         return;