Diff
Added: trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-permanently-expected.png (0 => 94450)
--- trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-permanently-expected.png (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-permanently-expected.png 2011-09-02 21:35:56 UTC (rev 94450)
@@ -0,0 +1,8 @@
+\x89PNG
+
+
+IHDR X ' )tEXtchecksum 6b0ecc73552409651fdf34f695a73063\xFDh\xB1E
+\xC2IDATx\x9C\xED\xDC1\x83@A\x9F\xE5#^\xBE\x84D\xCEZ PUzɄ\xAD
+n\xCD\xCC \x80\xCE\xF7\xEE o#\xB0 b &\xB0 b &\xB0 b \xF6\xFB\xF7\xB0\xF6u\xE5\x8EG\x9B\xCD_b \xC0\xC9 &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b \xB6f\xE6\xEE
+ \xAF\xE2\x82 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 ; 7\x83
+\xABۡ\xA1\xE6 IEND\xAEB`\x82
\ No newline at end of file
Added: trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-permanently-expected.txt (0 => 94450)
--- trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-permanently-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-permanently-expected.txt 2011-09-02 21:35:56 UTC (rev 94450)
@@ -0,0 +1 @@
+
Copied: trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-permanently.html (from rev 94449, trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context.html) (0 => 94450)
--- trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-permanently.html (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-permanently.html 2011-09-02 21:35:56 UTC (rev 94450)
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style type="text/css" media="screen">
+ .red {
+ background-color: red;
+ }
+
+ .green {
+ background-color: green;
+ }
+
+ div {
+ height: 100px;
+ width: 100px;
+ }
+
+ .composited {
+ -webkit-transform: translateZ(0);
+ }
+ </style>
+</head>
+<body>
+ <!-- In the pixel results, one green squares should be visible. -->
+ <div class="red">
+ <div id="target" class="red composited">
+ </div>
+ </div>
+ <p>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText(true); // This is only useful as a pixel test.
+ layoutTestController.display();
+ layoutTestController.loseCompositorContext(100); // Make it lose the context over and over again.
+
+ // Force display many times so that the compositor gives up on GPU acceleration
+ // The number of times to try should be at least as many as the
+ // m_numFailedRecreateAttempts in CCSingleThreadProxy.
+ for (var i = 0; i < 10; ++i)
+ layoutTestController.display();
+ }
+ var target = document.getElementById("target");
+ target.classList.remove("red");
+ target.classList.add("green");
+ </script>
+</body>
+</html>
Added: trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-twice-expected.png (0 => 94450)
--- trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-twice-expected.png (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-twice-expected.png 2011-09-02 21:35:56 UTC (rev 94450)
@@ -0,0 +1,8 @@
+\x89PNG
+
+
+IHDR X ' )tEXtchecksum 6b0ecc73552409651fdf34f695a73063\xFDh\xB1E
+\xC2IDATx\x9C\xED\xDC1\x83@A\x9F\xE5#^\xBE\x84D\xCEZ PUzɄ\xAD
+n\xCD\xCC \x80\xCE\xF7\xEE o#\xB0 b &\xB0 b &\xB0 b \xF6\xFB\xF7\xB0\xF6u\xE5\x8EG\x9B\xCD_b \xC0\xC9 &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b &\xB0 b \xB6f\xE6\xEE
+ \xAF\xE2\x82 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 X 1\x81 ; 7\x83
+\xABۡ\xA1\xE6 IEND\xAEB`\x82
\ No newline at end of file
Added: trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-twice-expected.txt (0 => 94450)
--- trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-twice-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-twice-expected.txt 2011-09-02 21:35:56 UTC (rev 94450)
@@ -0,0 +1 @@
+
Copied: trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-twice.html (from rev 94449, trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context.html) (0 => 94450)
--- trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-twice.html (rev 0)
+++ trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context-twice.html 2011-09-02 21:35:56 UTC (rev 94450)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style type="text/css" media="screen">
+ .red {
+ background-color: red;
+ }
+
+ .green {
+ background-color: green;
+ }
+
+ div {
+ height: 100px;
+ width: 100px;
+ }
+
+ .composited {
+ -webkit-transform: translateZ(0);
+ }
+ </style>
+</head>
+<body>
+ <!-- In the pixel results, one green squares should be visible. -->
+ <div class="red">
+ <div id="target" class="red composited">
+ </div>
+ </div>
+ <p>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText(true); // This is only useful as a pixel test.
+ layoutTestController.display();
+ layoutTestController.loseCompositorContext(2); // Lose the compositor context, then lose it again on the next redisplay
+ layoutTestController.display(); // Will also fail
+ }
+ var target = document.getElementById("target");
+ target.classList.remove("red");
+ target.classList.add("green");
+ </script>
+</body>
+</html>
Modified: trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context.html (94449 => 94450)
--- trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context.html 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/LayoutTests/platform/chromium/compositing/lost-compositor-context.html 2011-09-02 21:35:56 UTC (rev 94450)
@@ -31,7 +31,7 @@
if (window.layoutTestController) {
layoutTestController.dumpAsText(true); // This is only useful as a pixel test.
layoutTestController.display();
- layoutTestController.loseCompositorContext();
+ layoutTestController.loseCompositorContext(1);
}
var target = document.getElementById("target");
target.classList.remove("red");
Modified: trunk/Source/WebCore/ChangeLog (94449 => 94450)
--- trunk/Source/WebCore/ChangeLog 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebCore/ChangeLog 2011-09-02 21:35:56 UTC (rev 94450)
@@ -1,3 +1,13 @@
+2011-09-02 Nat Duca <nd...@chromium.org>
+
+ [chromium] Check for null context when reinitializing compositor
+ https://bugs.webkit.org/show_bug.cgi?id=67507
+
+ Reviewed by James Robinson.
+
+ * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+ (WebCore::CCSingleThreadProxy::recreateContextIfNeeded):
+
2011-09-02 Sam Weinig <s...@webkit.org>
Remove BeforeProcessEvent, it was never meant to be
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (94449 => 94450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp 2011-09-02 21:35:56 UTC (rev 94450)
@@ -226,9 +226,9 @@
m_proxy->setNeedsCommitAndRedraw();
}
-void CCLayerTreeHost::loseCompositorContext()
+void CCLayerTreeHost::loseCompositorContext(int numTimes)
{
- m_proxy->loseCompositorContext();
+ m_proxy->loseCompositorContext(numTimes);
}
TextureManager* CCLayerTreeHost::contentsTextureManager() const
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (94449 => 94450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h 2011-09-02 21:35:56 UTC (rev 94450)
@@ -135,7 +135,7 @@
const LayerRendererCapabilities& layerRendererCapabilities() const;
// Test-only hook
- void loseCompositorContext();
+ void loseCompositorContext(int numTimes);
void setNeedsCommitAndRedraw();
void setNeedsRedraw();
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h (94449 => 94450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h 2011-09-02 21:35:56 UTC (rev 94450)
@@ -75,7 +75,7 @@
#endif
// Testing hooks
- virtual void loseCompositorContext() = 0;
+ virtual void loseCompositorContext(int numTimes) = 0;
// Temporary hack while render_widget still does scheduling for CCLayerTreeHostMainThreadI
virtual GraphicsContext3D* context() = 0;
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp (94449 => 94450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp 2011-09-02 21:35:56 UTC (rev 94450)
@@ -62,6 +62,7 @@
: m_layerTreeHost(layerTreeHost)
, m_numFailedRecreateAttempts(0)
, m_graphicsContextLost(false)
+ , m_timesRecreateShouldFail(0)
{
TRACE_EVENT("CCSingleThreadProxy::CCSingleThreadProxy", this, 0);
ASSERT(isMainThread());
@@ -140,9 +141,10 @@
return m_layerTreeHostImpl->layerRendererCapabilities();
}
-void CCSingleThreadProxy::loseCompositorContext()
+void CCSingleThreadProxy::loseCompositorContext(int numTimes)
{
m_graphicsContextLost = true;
+ m_timesRecreateShouldFail = numTimes - 1;
}
void CCSingleThreadProxy::setNeedsCommitAndRedraw()
@@ -198,12 +200,19 @@
{
if (!m_graphicsContextLost)
return true;
- RefPtr<GraphicsContext3D> context = m_layerTreeHost->createLayerTreeHostContext3D();
- ASSERT(context->hasOneRef());
- if (m_layerTreeHostImpl->initializeLayerRenderer(0, context)) {
- m_layerTreeHost->didRecreateGraphicsContext(true);
- m_graphicsContextLost = false;
- return true;
+ RefPtr<GraphicsContext3D> context;
+ if (!m_timesRecreateShouldFail)
+ context = m_layerTreeHost->createLayerTreeHostContext3D();
+ else
+ m_timesRecreateShouldFail--;
+
+ if (context) {
+ ASSERT(context->hasOneRef());
+ if (m_layerTreeHostImpl->initializeLayerRenderer(0, context)) {
+ m_layerTreeHost->didRecreateGraphicsContext(true);
+ m_graphicsContextLost = false;
+ return true;
+ }
}
// Tolerate a certain number of recreation failures to work around races
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h (94449 => 94450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h 2011-09-02 21:35:56 UTC (rev 94450)
@@ -46,7 +46,7 @@
virtual bool isStarted() const;
virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack);
virtual const LayerRendererCapabilities& layerRendererCapabilities() const;
- virtual void loseCompositorContext();
+ virtual void loseCompositorContext(int numTimes);
virtual void setNeedsCommitAndRedraw();
virtual void setNeedsRedraw();
virtual void start();
@@ -74,6 +74,7 @@
int m_numFailedRecreateAttempts;
bool m_graphicsContextLost;
+ int m_timesRecreateShouldFail; // Used during testing.
};
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp (94449 => 94450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp 2011-09-02 21:35:56 UTC (rev 94450)
@@ -129,7 +129,7 @@
return m_layerRendererCapabilitiesMainThreadCopy;
}
-void CCThreadProxy::loseCompositorContext()
+void CCThreadProxy::loseCompositorContext(int numTimes)
{
ASSERT_NOT_REACHED();
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h (94449 => 94450)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h 2011-09-02 21:35:56 UTC (rev 94450)
@@ -47,7 +47,7 @@
virtual bool isStarted() const;
virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack);
virtual const LayerRendererCapabilities& layerRendererCapabilities() const;
- virtual void loseCompositorContext();
+ virtual void loseCompositorContext(int numTimes);
virtual void setNeedsCommitAndRedraw();
virtual void setNeedsRedraw();
virtual void start();
Modified: trunk/Source/WebKit/chromium/public/WebView.h (94449 => 94450)
--- trunk/Source/WebKit/chromium/public/WebView.h 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebKit/chromium/public/WebView.h 2011-09-02 21:35:56 UTC (rev 94450)
@@ -393,7 +393,7 @@
// Testing functionality for LayoutTestController -----------------------
// Simulates a compositor lost context.
- virtual void loseCompositorContext() = 0;
+ virtual void loseCompositorContext(int numTimes) = 0;
protected:
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (94449 => 94450)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-09-02 21:35:56 UTC (rev 94450)
@@ -1175,11 +1175,11 @@
#endif
}
-void WebViewImpl::loseCompositorContext()
+void WebViewImpl::loseCompositorContext(int numTimes)
{
#if USE(ACCELERATED_COMPOSITING)
if (m_layerTreeHost)
- m_layerTreeHost->loseCompositorContext();
+ m_layerTreeHost->loseCompositorContext(numTimes);
#endif
}
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (94449 => 94450)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.h 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h 2011-09-02 21:35:56 UTC (rev 94450)
@@ -406,7 +406,7 @@
void resetGestureRecognizer();
#endif
- void loseCompositorContext();
+ void loseCompositorContext(int numTimes);
private:
friend class WebView; // So WebView::Create can call our constructor
Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp (94449 => 94450)
--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp 2011-09-02 21:16:25 UTC (rev 94449)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp 2011-09-02 21:35:56 UTC (rev 94450)
@@ -1751,9 +1751,14 @@
result->set(m_shell->webView()->mainFrame()->layerTreeAsText(m_showDebugLayerTree).utf8());
}
-void LayoutTestController::loseCompositorContext(const CppArgumentList&, CppVariant*)
+void LayoutTestController::loseCompositorContext(const CppArgumentList& args, CppVariant*)
{
- m_shell->webView()->loseCompositorContext();
+ int numTimes;
+ if (args.size() == 1 || !args[0].isNumber())
+ numTimes = 1;
+ else
+ numTimes = args[0].toInt32();
+ m_shell->webView()->loseCompositorContext(numTimes);
}
void LayoutTestController::markerTextForListItem(const CppArgumentList& args, CppVariant* result)