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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 return; | 677 return; |
677 | 678 |
678 lcd_text_metrics_.total_num_cc_layers++; | 679 lcd_text_metrics_.total_num_cc_layers++; |
679 if (layer->draw_properties().can_use_lcd_text) { | 680 if (layer->draw_properties().can_use_lcd_text) { |
680 lcd_text_metrics_.total_num_cc_layers_can_use_lcd_text++; | 681 lcd_text_metrics_.total_num_cc_layers_can_use_lcd_text++; |
681 if (layer->contents_opaque()) | 682 if (layer->contents_opaque()) |
682 lcd_text_metrics_.total_num_cc_layers_will_use_lcd_text++; | 683 lcd_text_metrics_.total_num_cc_layers_will_use_lcd_text++; |
683 } | 684 } |
684 } | 685 } |
685 | 686 |
| 687 bool LayerTreeHost::UsingSharedMemoryResources() { |
| 688 return GetRendererCapabilities().using_shared_memory_resources; |
| 689 } |
| 690 |
686 bool LayerTreeHost::UpdateLayers(Layer* root_layer, | 691 bool LayerTreeHost::UpdateLayers(Layer* root_layer, |
687 ResourceUpdateQueue* queue) { | 692 ResourceUpdateQueue* queue) { |
688 TRACE_EVENT1("cc", "LayerTreeHost::UpdateLayers", | 693 TRACE_EVENT1("cc", "LayerTreeHost::UpdateLayers", |
689 "commit_number", commit_number()); | 694 "commit_number", commit_number()); |
690 | 695 |
691 LayerList update_list; | 696 LayerList update_list; |
692 { | 697 { |
693 UpdateHudLayer(); | 698 UpdateHudLayer(); |
694 | 699 |
695 Layer* root_scroll = FindFirstScrollableLayer(root_layer); | 700 Layer* root_scroll = FindFirstScrollableLayer(root_layer); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 bool start_ready_animations = true; | 1060 bool start_ready_animations = true; |
1056 (*iter).second->UpdateState(start_ready_animations, NULL); | 1061 (*iter).second->UpdateState(start_ready_animations, NULL); |
1057 } | 1062 } |
1058 } | 1063 } |
1059 | 1064 |
1060 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1065 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
1061 return proxy_->CapturePicture(); | 1066 return proxy_->CapturePicture(); |
1062 } | 1067 } |
1063 | 1068 |
1064 } // namespace cc | 1069 } // namespace cc |
OLD | NEW |