REGRESSION (r199819): CrashTracer: [GraphicsContext3D::getInternalFramebufferSize
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jun 2016 01:06:45 +0000 (01:06 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jun 2016 01:06:45 +0000 (01:06 +0000)
commit9a3615b559df58075897e7d202f75e29151685b8
treed98d6c16fae4368a101645aae9bcb08dd98998ef
parent9e1822f58ce67ed806a0ef9ef3a1768e6186d8b5
REGRESSION (r199819): CrashTracer: [GraphicsContext3D::getInternalFramebufferSize
https://bugs.webkit.org/show_bug.cgi?id=158895
<rdar://problem/26423617>

Reviewed by Zalan Bujtas.

Source/WebCore:

In r199819 we started resetting contexts if the page had too
many. Unfortunately there were entry points in the WebGL context
that didn't check for the validity of the object before trying
to access the lower level objects.

Test: webgl/many-contexts-access-after-loss.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::drawingBufferWidth): Return 0 if we're lost.
(WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.

LayoutTests:

New test to access the contexts after loss. Also cleaned
up the JavaScript code in the existing test (and made sure
it ran outside of the test system).

* webgl/many-contexts-access-after-loss-expected.txt: Added.
* webgl/many-contexts-access-after-loss.html: Added.
* webgl/many-contexts.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/webgl/many-contexts-access-after-loss-expected.txt [new file with mode: 0644]
LayoutTests/webgl/many-contexts-access-after-loss.html [new file with mode: 0644]
LayoutTests/webgl/many-contexts.html
Source/WebCore/ChangeLog
Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp