| Index: cc/trees/thread_proxy.cc
|
| diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
|
| index cdf05c01db9d9506caf135323b967cf6855be1f7..440332d75dd9621aa941a2a985926c840e5d8884 100644
|
| --- a/cc/trees/thread_proxy.cc
|
| +++ b/cc/trees/thread_proxy.cc
|
| @@ -338,18 +338,27 @@ void ThreadProxy::DoCreateAndInitializeOutputSurface() {
|
| OnOutputSurfaceInitializeAttempted(success, capabilities);
|
| }
|
|
|
| +void ThreadProxy::SetRendererCapabilitiesMainThreadCopy(
|
| + const RendererCapabilities& capabilities) {
|
| + DCHECK(IsMainThread());
|
| + if (main().renderer_capabilities_main_thread_copy == capabilities)
|
| + return;
|
| +
|
| + main().renderer_capabilities_main_thread_copy = capabilities;
|
| + layer_tree_host()->RendererCapabilitiesChanged();
|
| +}
|
| +
|
| 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);
|
| + main().renderer_capabilities_main_thread_copy = capabilities;
|
| + layer_tree_host()->RendererCapabilitiesChanged();
|
| +
|
| if (result == LayerTreeHost::CreateFailedButTryAgain) {
|
| if (!main().output_surface_creation_callback.callback().is_null()) {
|
| Proxy::MainThreadTaskRunner()->PostTask(
|
| @@ -411,6 +420,17 @@ void ThreadProxy::SetNeedsCommit() {
|
| SendCommitRequestToImplThreadIfNeeded();
|
| }
|
|
|
| +void ThreadProxy::UpdateRendererCapabilitiesOnImplThread() {
|
| + DCHECK(IsImplThread());
|
| + Proxy::MainThreadTaskRunner()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&ThreadProxy::SetRendererCapabilitiesMainThreadCopy,
|
| + main_thread_weak_ptr_,
|
| + impl()
|
| + .layer_tree_host_impl->GetRendererCapabilities()
|
| + .MainThreadCapabilities()));
|
| +}
|
| +
|
| void ThreadProxy::DidLoseOutputSurfaceOnImplThread() {
|
| TRACE_EVENT0("cc", "ThreadProxy::DidLoseOutputSurfaceOnImplThread");
|
| DCHECK(IsImplThread());
|
|
|