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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 return InitializeProxy(proxy_for_testing.Pass()); | 116 return InitializeProxy(proxy_for_testing.Pass()); |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { | 119 bool LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) { |
| 120 TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); | 120 TRACE_EVENT0("cc", "LayerTreeHost::InitializeForReal"); |
| 121 | 121 |
| 122 scoped_ptr<OutputSurface> output_surface(CreateOutputSurface()); | 122 scoped_ptr<OutputSurface> output_surface(CreateOutputSurface()); |
| 123 if (!output_surface) | 123 if (!output_surface) |
| 124 return false; | 124 return false; |
| 125 | 125 |
| 126 using_gl_renderer_ = | |
| 127 output_surface->context3d() || | |
| 128 output_surface->capabilities().deferred_gl_initialization; | |
|
piman
2013/07/02 04:00:09
Note: during the lifetime of the LTH, we may recre
jbauman
2013/07/02 20:16:19
Ok, I'm now passing it through RendererCapabilitie
| |
| 129 | |
| 126 proxy_ = proxy.Pass(); | 130 proxy_ = proxy.Pass(); |
| 127 proxy_->Start(output_surface.Pass()); | 131 proxy_->Start(output_surface.Pass()); |
| 128 return true; | 132 return true; |
| 129 } | 133 } |
| 130 | 134 |
| 131 LayerTreeHost::~LayerTreeHost() { | 135 LayerTreeHost::~LayerTreeHost() { |
| 132 TRACE_EVENT0("cc", "LayerTreeHost::~LayerTreeHost"); | 136 TRACE_EVENT0("cc", "LayerTreeHost::~LayerTreeHost"); |
| 133 if (root_layer_.get()) | 137 if (root_layer_.get()) |
| 134 root_layer_->SetLayerTreeHost(NULL); | 138 root_layer_->SetLayerTreeHost(NULL); |
| 135 | 139 |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 675 return; | 679 return; |
| 676 | 680 |
| 677 lcd_text_metrics_.total_num_cc_layers++; | 681 lcd_text_metrics_.total_num_cc_layers++; |
| 678 if (layer->draw_properties().can_use_lcd_text) { | 682 if (layer->draw_properties().can_use_lcd_text) { |
| 679 lcd_text_metrics_.total_num_cc_layers_can_use_lcd_text++; | 683 lcd_text_metrics_.total_num_cc_layers_can_use_lcd_text++; |
| 680 if (layer->contents_opaque()) | 684 if (layer->contents_opaque()) |
| 681 lcd_text_metrics_.total_num_cc_layers_will_use_lcd_text++; | 685 lcd_text_metrics_.total_num_cc_layers_will_use_lcd_text++; |
| 682 } | 686 } |
| 683 } | 687 } |
| 684 | 688 |
| 689 bool LayerTreeHost::UsingGLRenderer() { return using_gl_renderer_; } | |
| 690 | |
| 685 void LayerTreeHost::UpdateLayers(Layer* root_layer, | 691 void LayerTreeHost::UpdateLayers(Layer* root_layer, |
| 686 ResourceUpdateQueue* queue) { | 692 ResourceUpdateQueue* queue) { |
| 687 TRACE_EVENT1("cc", "LayerTreeHost::UpdateLayers", | 693 TRACE_EVENT1("cc", "LayerTreeHost::UpdateLayers", |
| 688 "commit_number", commit_number()); | 694 "commit_number", commit_number()); |
| 689 | 695 |
| 690 LayerList update_list; | 696 LayerList update_list; |
| 691 { | 697 { |
| 692 UpdateHudLayer(); | 698 UpdateHudLayer(); |
| 693 | 699 |
| 694 Layer* root_scroll = FindFirstScrollableLayer(root_layer); | 700 Layer* root_scroll = FindFirstScrollableLayer(root_layer); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1048 bool start_ready_animations = true; | 1054 bool start_ready_animations = true; |
| 1049 (*iter).second->UpdateState(start_ready_animations, NULL); | 1055 (*iter).second->UpdateState(start_ready_animations, NULL); |
| 1050 } | 1056 } |
| 1051 } | 1057 } |
| 1052 | 1058 |
| 1053 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1059 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
| 1054 return proxy_->CapturePicture(); | 1060 return proxy_->CapturePicture(); |
| 1055 } | 1061 } |
| 1056 | 1062 |
| 1057 } // namespace cc | 1063 } // namespace cc |
| OLD | NEW |