WebGL: Destroy the GLContext if a GPU restart has been detected.
authorroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Feb 2015 04:19:30 +0000 (04:19 +0000)
committerroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Feb 2015 04:19:30 +0000 (04:19 +0000)
commit8731a67786213c0ed581ac2eb9d0cc4ba4b29ef6
treec28787e414107e312e978d36f76713a83b1766ec
parent4b905bc7fac82444c99df49e94fb02655ff8dfb8
WebGL: Destroy the GLContext if a GPU restart has been detected.
https://bugs.webkit.org/show_bug.cgi?id=141567.
<rdar://problem/18507496>
Reviewed by Dean Jackson.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::setWebGLContext):
Keep track of which WebGLRenderingContext is associated with the current GraphicsContext3D.
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Helper method to check GPU status.
(WebCore::GraphicsContext3D::GraphicsContext3D):
Don’t immediately abort the GPU process when the restart status is kCGLCPGPURestartStatusBlacklisted.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::forceContextLost):
Force the WebGLRenderingContext to be lost.
(WebCore::GraphicsContext3D::drawArrays): Check GPU status after calling drawArrays.
(WebCore::GraphicsContext3D::drawElements): Check GPU status after calling drawElements.
* WebCore.xcodeproj/project.pbxproj: Add SPI header for iOS.
* platform/spi/ios/OpenGLESSPI.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
Source/WebCore/platform/graphics/GraphicsContext3D.h
Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp
Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/graphics/win/GraphicsContext3DWin.cpp
Source/WebCore/platform/spi/ios/OpenGLESSPI.h [new file with mode: 0644]