Source/WebCore/ChangeLog

 12011-10-10 Kenneth Russell <[email protected]>
 2
 3 [chromium] Check for lost context at beginning of compositor's execution
 4 https://bugs.webkit.org/show_bug.cgi?id=69776
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Test: platform/chromium/compositing/webgl-loses-compositor-context.html
 9
 10 * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
 11 (WebCore::CCSingleThreadProxy::recreateContextIfNeeded):
 12
1132011-10-10 Jeremy Apthorp <[email protected]>
214
315 Exiting fullscreen shouldn't crash if the element that was fullscreened
97092

Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp

@@void CCSingleThreadProxy::compositeImmed
198198bool CCSingleThreadProxy::recreateContextIfNeeded()
199199{
200200 ASSERT(CCProxy::isMainThread());
 201
 202 if (!m_graphicsContextLost && m_layerTreeHostImpl->isContextLost()) {
 203 m_graphicsContextLost = true;
 204 m_numFailedRecreateAttempts = 0;
 205 }
 206
201207 if (!m_graphicsContextLost)
202208 return true;
203209 RefPtr<GraphicsContext3D> context;
97083

LayoutTests/ChangeLog

 12011-10-10 Kenneth Russell <[email protected]>
 2
 3 [chromium] Check for lost context at beginning of compositor's execution
 4 https://bugs.webkit.org/show_bug.cgi?id=69776
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Added test case which asserts when run in Chrome with dynamic GPU
 9 switching enabled and without the fix in this patch.
 10
 11 * platform/chromium/compositing/webgl-loses-compositor-context-expected.png: Added.
 12 * platform/chromium/compositing/webgl-loses-compositor-context-expected.txt: Added.
 13 * platform/chromium/compositing/webgl-loses-compositor-context.html: Added.
 14
1152011-10-10 Jeremy Apthorp <[email protected]>
216
317 Exiting fullscreen shouldn't crash if the element that was fullscreened
97092

LayoutTests/platform/chromium/compositing/webgl-loses-compositor-context-expected.txt

 1
0

LayoutTests/platform/chromium/compositing/webgl-loses-compositor-context.html

 1<!DOCTYPE html>
 2<html>
 3<head>
 4 <style type="text/css" media="screen">
 5 .composited {
 6 -webkit-transform: translateZ(0);
 7 }
 8 </style>
 9 <script>
 10 if (window.layoutTestController) {
 11 layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
 12 layoutTestController.waitUntilDone();
 13 layoutTestController.dumpAsText(true);
 14 }
 15
 16 window.setTimeout(function() {
 17 var c = document.getElementById("c");
 18 // On some platforms the fetching of the WebGL context will
 19 // force a switch from the integrated to the discrete GPU
 20 // and the loss of the compositor's context.
 21 var gl = c.getContext("experimental-webgl");
 22 gl.clearColor(0, 1, 0, 1);
 23 gl.clear(gl.COLOR_BUFFER_BIT);
 24 if (window.layoutTestController) {
 25 window.setTimeout(function() {
 26 window.layoutTestController.notifyDone();
 27 }, 0);
 28 }
 29 }, 0);
 30 </script>
 31</head>
 32<body>
 33 <div id="target" class="composited">
 34 </div>
 35 <div>
 36 <canvas id="c" width="100" height="100">
 37 </canvas>
 38 </div>
 39</body>
 40</html>
0

LayoutTests/platform/chromium/compositing/webgl-loses-compositor-context-expected.png

e3bf0b857fa20ffee8613bade9cc44f4