[chromium] Need a way to test lost compositor context recovery
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Aug 2011 01:33:12 +0000 (01:33 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Aug 2011 01:33:12 +0000 (01:33 +0000)
commitfaad76425706c3701f27da791c0fc93a4d60987c
tree0dc02732f1ef833703e9981d2b8859c5cc03635d
parent286611a6027badc4d40d82933feac6b8cb159541
[chromium] Need a way to test lost compositor context recovery
https://bugs.webkit.org/show_bug.cgi?id=66820

Reviewed by Kenneth Russell.

Source/WebCore:

Adds support for recreating a context as if it was lost, and fixes
compositeAndReadback() to attempt context recovery.

Test: platform/chromium/compositing/lost-compositor-context.html

* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::compositeAndReadback):
(WebCore::CCLayerTreeHost::loseCompositorContext):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:

Source/WebKit/chromium:

Adds a testing-only API to simulate a lost compositor context.

* public/WebView.h:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::loseCompositorContext):
* src/WebViewImpl.h:

Tools:

Exposes a LayoutTestController interface in chromium to simulate a
lost compositor context.

* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::loseCompositorContext):
* DumpRenderTree/chromium/LayoutTestController.h:

LayoutTests:

Adds a simple test for losing the compositor context in a recoverable
way on a composited page. Tests that we recover without crashing and
render the updated content on the next frame.

* platform/chromium/compositing/lost-compositor-context.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium/compositing/lost-compositor-context-expected.png [new file with mode: 0644]
LayoutTests/platform/chromium/compositing/lost-compositor-context-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/compositing/lost-compositor-context.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebView.h
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h
Tools/ChangeLog
Tools/DumpRenderTree/chromium/LayoutTestController.cpp
Tools/DumpRenderTree/chromium/LayoutTestController.h