Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(774)

Unified Diff: cc/trees/thread_proxy.cc

Issue 256573003: cc: Remove the capability to give up and leave compositing mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index df350b8b46398af13e6a6ca5c0add25970afe126..9e9abd3571e5348aaf2f02c9a092724f394e838e 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -288,13 +288,7 @@ void ThreadProxy::DoCreateAndInitializeOutputSurface() {
RendererCapabilities capabilities;
bool success = !!output_surface;
- if (!success) {
- OnOutputSurfaceInitializeAttempted(false, capabilities);
- return;
- }
-
- success = false;
- {
+ if (success) {
// Make a blocking call to InitializeOutputSurfaceOnImplThread. The results
// of that call are pushed into the success and capabilities local
// variables.
@@ -311,8 +305,15 @@ void ThreadProxy::DoCreateAndInitializeOutputSurface() {
&capabilities));
completion.Wait();
}
+ main().renderer_capabilities_main_thread_copy = capabilities;
+ layer_tree_host()->OnCreateAndInitializeOutputSurfaceAttempted(success);
- OnOutputSurfaceInitializeAttempted(success, capabilities);
+ if (success) {
+ main().output_surface_creation_callback.Cancel();
+ } else if (!main().output_surface_creation_callback.IsCancelled()) {
+ Proxy::MainThreadTaskRunner()->PostTask(
+ FROM_HERE, main().output_surface_creation_callback.callback());
+ }
}
void ThreadProxy::SetRendererCapabilitiesMainThreadCopy(
@@ -320,28 +321,6 @@ void ThreadProxy::SetRendererCapabilitiesMainThreadCopy(
main().renderer_capabilities_main_thread_copy = capabilities;
}
-void ThreadProxy::OnOutputSurfaceInitializeAttempted(
- bool success,
- const RendererCapabilities& capabilities) {
- DCHECK(IsMainThread());
- DCHECK(layer_tree_host());
-
- if (success) {
- main().renderer_capabilities_main_thread_copy = capabilities;
- }
-
- LayerTreeHost::CreateResult result =
- layer_tree_host()->OnCreateAndInitializeOutputSurfaceAttempted(success);
- if (result == LayerTreeHost::CreateFailedButTryAgain) {
- if (!main().output_surface_creation_callback.callback().is_null()) {
- Proxy::MainThreadTaskRunner()->PostTask(
- FROM_HERE, main().output_surface_creation_callback.callback());
- }
- } else {
- main().output_surface_creation_callback.Cancel();
- }
-}
-
void ThreadProxy::SendCommitRequestToImplThreadIfNeeded() {
DCHECK(IsMainThread());
if (main().commit_request_sent_to_impl_thread)
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | content/browser/renderer_host/compositor_impl_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698