summaryrefslogtreecommitdiffstats
path: root/cc/trees/thread_proxy.cc
diff options
context:
space:
mode:
authorenne <enne@chromium.org>2014-12-10 13:32:09 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-10 21:32:45 +0000
commit7f8fdded6b22322a245bf643454291a0c12079c8 (patch)
tree0f6e7c68d2f84a53fdcff1e93f4029a80c79d7ed /cc/trees/thread_proxy.cc
parentea4b5a8eb8f66713482ef7f4a8aca83886965440 (diff)
downloadchromium_src-7f8fdded6b22322a245bf643454291a0c12079c8.zip
chromium_src-7f8fdded6b22322a245bf643454291a0c12079c8.tar.gz
chromium_src-7f8fdded6b22322a245bf643454291a0c12079c8.tar.bz2
Move output surface fallback from cc to embedders
Having this in cc means that all embedders get this logic and API, even though only RenderWidgetCompositor and ui::Compositor use it. This also means that cc no longer has to be robust to null SetOutputSurface, which makes the API to embedders a bit more clear. Review URL: https://codereview.chromium.org/738983002 Cr-Commit-Position: refs/heads/master@{#307767}
Diffstat (limited to 'cc/trees/thread_proxy.cc')
-rw-r--r--cc/trees/thread_proxy.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index e6ab017..73bf79e 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -215,16 +215,10 @@ void ThreadProxy::RequestNewOutputSurface() {
}
void ThreadProxy::SetOutputSurface(scoped_ptr<OutputSurface> output_surface) {
- if (output_surface) {
- Proxy::ImplThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&ThreadProxy::InitializeOutputSurfaceOnImplThread,
- impl_thread_weak_ptr_,
- base::Passed(&output_surface)));
- return;
- }
-
- DidInitializeOutputSurface(false, RendererCapabilities());
+ Proxy::ImplThreadTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&ThreadProxy::InitializeOutputSurfaceOnImplThread,
+ impl_thread_weak_ptr_, base::Passed(&output_surface)));
}
void ThreadProxy::DidInitializeOutputSurface(
@@ -232,15 +226,13 @@ void ThreadProxy::DidInitializeOutputSurface(
const RendererCapabilities& capabilities) {
TRACE_EVENT0("cc", "ThreadProxy::DidInitializeOutputSurface");
DCHECK(IsMainThread());
- main().renderer_capabilities_main_thread_copy = capabilities;
- layer_tree_host()->OnCreateAndInitializeOutputSurfaceAttempted(success);
if (!success) {
- Proxy::MainThreadTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&ThreadProxy::RequestNewOutputSurface,
- main_thread_weak_ptr_));
+ layer_tree_host()->DidFailToInitializeOutputSurface();
+ return;
}
+ main().renderer_capabilities_main_thread_copy = capabilities;
+ layer_tree_host()->DidInitializeOutputSurface();
}
void ThreadProxy::SetRendererCapabilitiesMainThreadCopy(