Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 469 } | 469 } |
| 470 | 470 |
| 471 void LayerTreeHost::CommitComplete() { | 471 void LayerTreeHost::CommitComplete() { |
| 472 client_->DidCommit(); | 472 client_->DidCommit(); |
| 473 } | 473 } |
| 474 | 474 |
| 475 scoped_ptr<OutputSurface> LayerTreeHost::CreateOutputSurface() { | 475 scoped_ptr<OutputSurface> LayerTreeHost::CreateOutputSurface() { |
| 476 return client_->CreateOutputSurface(); | 476 return client_->CreateOutputSurface(); |
| 477 } | 477 } |
| 478 | 478 |
| 479 scoped_ptr<InputHandlerClient> LayerTreeHost::CreateInputHandlerClient() { | 479 const base::WeakPtr<InputHandler>& LayerTreeHost::GetInputHandler() { |
|
danakj
2013/05/01 19:20:43
can this just be input_handler() inline in the hea
| |
| 480 return client_->CreateInputHandlerClient(); | 480 return input_handler_weak_ptr_; |
| 481 } | 481 } |
| 482 | 482 |
| 483 scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl( | 483 scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl( |
| 484 LayerTreeHostImplClient* client) { | 484 LayerTreeHostImplClient* client) { |
| 485 DCHECK(proxy_->IsImplThread()); | 485 DCHECK(proxy_->IsImplThread()); |
| 486 scoped_ptr<LayerTreeHostImpl> host_impl = | 486 scoped_ptr<LayerTreeHostImpl> host_impl = |
| 487 LayerTreeHostImpl::Create(settings_, | 487 LayerTreeHostImpl::Create(settings_, |
| 488 client, | 488 client, |
| 489 proxy_.get(), | 489 proxy_.get(), |
| 490 rendering_stats_instrumentation_.get()); | 490 rendering_stats_instrumentation_.get()); |
| 491 if (settings_.calculate_top_controls_position && | 491 if (settings_.calculate_top_controls_position && |
| 492 host_impl->top_controls_manager()) { | 492 host_impl->top_controls_manager()) { |
| 493 top_controls_manager_weak_ptr_ = | 493 top_controls_manager_weak_ptr_ = |
| 494 host_impl->top_controls_manager()->AsWeakPtr(); | 494 host_impl->top_controls_manager()->AsWeakPtr(); |
| 495 } | 495 } |
| 496 input_handler_weak_ptr_ = host_impl->AsWeakPtr(); | |
| 496 return host_impl.Pass(); | 497 return host_impl.Pass(); |
| 497 } | 498 } |
| 498 | 499 |
| 499 void LayerTreeHost::DidLoseOutputSurface() { | 500 void LayerTreeHost::DidLoseOutputSurface() { |
| 500 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); | 501 TRACE_EVENT0("cc", "LayerTreeHost::DidLoseOutputSurface"); |
| 501 DCHECK(proxy_->IsMainThread()); | 502 DCHECK(proxy_->IsMainThread()); |
| 502 output_surface_lost_ = true; | 503 output_surface_lost_ = true; |
| 503 num_failed_recreate_attempts_ = 0; | 504 num_failed_recreate_attempts_ = 0; |
| 504 SetNeedsCommit(); | 505 SetNeedsCommit(); |
| 505 } | 506 } |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1104 bool start_ready_animations = true; | 1105 bool start_ready_animations = true; |
| 1105 (*iter).second->UpdateState(start_ready_animations, NULL); | 1106 (*iter).second->UpdateState(start_ready_animations, NULL); |
| 1106 } | 1107 } |
| 1107 } | 1108 } |
| 1108 | 1109 |
| 1109 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1110 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
| 1110 return proxy_->CapturePicture(); | 1111 return proxy_->CapturePicture(); |
| 1111 } | 1112 } |
| 1112 | 1113 |
| 1113 } // namespace cc | 1114 } // namespace cc |
| OLD | NEW |