From: jamesr@google.com Date: Wed, 8 Feb 2012 21:32:54 +0000 (+0000) Subject: [chromium] Check that we can make the SharedGraphicsContext3D current before returning X-Git-Tag: 070512121124~13418 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=81e49af836b7e0ae5fc64ed1928b14c7839d8e81;p=profile%2Fivi%2Fwebkit-efl.git [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): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107127 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 6d5ea79..c81ae19 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,15 @@ +2012-02-08 James Robinson + + [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 Crash in Node::normalize. diff --git a/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp b/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp index e96591d..a77345c 100644 --- a/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp +++ b/Source/WebCore/platform/graphics/gpu/SharedGraphicsContext3D.cpp @@ -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; }