| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 RendererCapabilities::RendererCapabilities() | 46 RendererCapabilities::RendererCapabilities() |
| 47 : best_texture_format(0), | 47 : best_texture_format(0), |
| 48 using_partial_swap(false), | 48 using_partial_swap(false), |
| 49 using_set_visibility(false), | 49 using_set_visibility(false), |
| 50 using_egl_image(false), | 50 using_egl_image(false), |
| 51 allow_partial_texture_updates(false), | 51 allow_partial_texture_updates(false), |
| 52 using_offscreen_context3d(false), | 52 using_offscreen_context3d(false), |
| 53 max_texture_size(0), | 53 max_texture_size(0), |
| 54 avoid_pow2_textures(false), | 54 avoid_pow2_textures(false), |
| 55 using_map_image(false) {} | 55 using_map_image(false), |
| 56 using_shared_memory_resources(false) {} |
| 56 | 57 |
| 57 RendererCapabilities::~RendererCapabilities() {} | 58 RendererCapabilities::~RendererCapabilities() {} |
| 58 | 59 |
| 59 bool LayerTreeHost::AnyLayerTreeHostInstanceExists() { | 60 bool LayerTreeHost::AnyLayerTreeHostInstanceExists() { |
| 60 return s_num_layer_tree_instances > 0; | 61 return s_num_layer_tree_instances > 0; |
| 61 } | 62 } |
| 62 | 63 |
| 63 scoped_ptr<LayerTreeHost> LayerTreeHost::Create( | 64 scoped_ptr<LayerTreeHost> LayerTreeHost::Create( |
| 64 LayerTreeHostClient* client, | 65 LayerTreeHostClient* client, |
| 65 const LayerTreeSettings& settings, | 66 const LayerTreeSettings& settings, |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 return; | 676 return; |
| 676 | 677 |
| 677 lcd_text_metrics_.total_num_cc_layers++; | 678 lcd_text_metrics_.total_num_cc_layers++; |
| 678 if (layer->draw_properties().can_use_lcd_text) { | 679 if (layer->draw_properties().can_use_lcd_text) { |
| 679 lcd_text_metrics_.total_num_cc_layers_can_use_lcd_text++; | 680 lcd_text_metrics_.total_num_cc_layers_can_use_lcd_text++; |
| 680 if (layer->contents_opaque()) | 681 if (layer->contents_opaque()) |
| 681 lcd_text_metrics_.total_num_cc_layers_will_use_lcd_text++; | 682 lcd_text_metrics_.total_num_cc_layers_will_use_lcd_text++; |
| 682 } | 683 } |
| 683 } | 684 } |
| 684 | 685 |
| 686 bool LayerTreeHost::UsingSharedMemoryResources() { |
| 687 return GetRendererCapabilities().using_shared_memory_resources; |
| 688 } |
| 689 |
| 685 void LayerTreeHost::UpdateLayers(Layer* root_layer, | 690 void LayerTreeHost::UpdateLayers(Layer* root_layer, |
| 686 ResourceUpdateQueue* queue) { | 691 ResourceUpdateQueue* queue) { |
| 687 TRACE_EVENT1("cc", "LayerTreeHost::UpdateLayers", | 692 TRACE_EVENT1("cc", "LayerTreeHost::UpdateLayers", |
| 688 "commit_number", commit_number()); | 693 "commit_number", commit_number()); |
| 689 | 694 |
| 690 LayerList update_list; | 695 LayerList update_list; |
| 691 { | 696 { |
| 692 UpdateHudLayer(); | 697 UpdateHudLayer(); |
| 693 | 698 |
| 694 Layer* root_scroll = FindFirstScrollableLayer(root_layer); | 699 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; | 1053 bool start_ready_animations = true; |
| 1049 (*iter).second->UpdateState(start_ready_animations, NULL); | 1054 (*iter).second->UpdateState(start_ready_animations, NULL); |
| 1050 } | 1055 } |
| 1051 } | 1056 } |
| 1052 | 1057 |
| 1053 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1058 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
| 1054 return proxy_->CapturePicture(); | 1059 return proxy_->CapturePicture(); |
| 1055 } | 1060 } |
| 1056 | 1061 |
| 1057 } // namespace cc | 1062 } // namespace cc |
| OLD | NEW |