[chromium] Check that we can make the SharedGraphicsContext3D current before returning
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 21:32:54 +0000 (21:32 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Feb 2012 21:32:54 +0000 (21:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78142

Reviewed by Stephen White.

If we can't make the context current, we can't use it.

* platform/graphics/gpu/SharedGraphicsContext3D.cpp:
(WebCore::SharedGraphicsContext3D::get):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp

index 6d5ea79..c81ae19 100644 (file)
@@ -1,3 +1,15 @@
+2012-02-08  James Robinson  <jamesr@chromium.org>
+
+        [chromium] Check that we can make the SharedGraphicsContext3D current before returning
+        https://bugs.webkit.org/show_bug.cgi?id=78142
+
+        Reviewed by Stephen White.
+
+        If we can't make the context current, we can't use it.
+
+        * platform/graphics/gpu/SharedGraphicsContext3D.cpp:
+        (WebCore::SharedGraphicsContext3D::get):
+
 2012-02-08  Abhishek Arya  <inferno@chromium.org>
 
         Crash in Node::normalize.
index e96591d..a77345c 100644 (file)
@@ -39,6 +39,8 @@ GraphicsContext3D* SharedGraphicsContext3D::get()
     attributes.canRecoverFromContextLoss = false; // Canvas contexts can not handle lost contexts.
     attributes.shareResources = true;
     static GraphicsContext3D* context = GraphicsContext3D::create(attributes, 0).leakRef();
+    if (context && !context->makeContextCurrent())
+        context = 0;
     return context;
 }