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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 : best_texture_format(0), | 50 : best_texture_format(0), |
51 using_partial_swap(false), | 51 using_partial_swap(false), |
52 using_accelerated_painting(false), | 52 using_accelerated_painting(false), |
53 using_set_visibility(false), | 53 using_set_visibility(false), |
54 using_swap_complete_callback(false), | 54 using_swap_complete_callback(false), |
55 using_gpu_memory_manager(false), | 55 using_gpu_memory_manager(false), |
56 using_egl_image(false), | 56 using_egl_image(false), |
57 allow_partial_texture_updates(false), | 57 allow_partial_texture_updates(false), |
58 using_offscreen_context3d(false), | 58 using_offscreen_context3d(false), |
59 max_texture_size(0), | 59 max_texture_size(0), |
60 avoid_pow2_textures(false) {} | 60 avoid_pow2_textures(false), |
| 61 use_gpu_memory_buffers(false) {} |
61 | 62 |
62 RendererCapabilities::~RendererCapabilities() {} | 63 RendererCapabilities::~RendererCapabilities() {} |
63 | 64 |
64 bool LayerTreeHost::AnyLayerTreeHostInstanceExists() { | 65 bool LayerTreeHost::AnyLayerTreeHostInstanceExists() { |
65 return s_num_layer_tree_instances > 0; | 66 return s_num_layer_tree_instances > 0; |
66 } | 67 } |
67 | 68 |
68 scoped_ptr<LayerTreeHost> LayerTreeHost::Create( | 69 scoped_ptr<LayerTreeHost> LayerTreeHost::Create( |
69 LayerTreeHostClient* client, | 70 LayerTreeHostClient* client, |
70 const LayerTreeSettings& settings, | 71 const LayerTreeSettings& settings, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 185 } |
185 settings_.max_partial_texture_updates = max_partial_texture_updates; | 186 settings_.max_partial_texture_updates = max_partial_texture_updates; |
186 | 187 |
187 if (!contents_texture_manager_) { | 188 if (!contents_texture_manager_) { |
188 contents_texture_manager_ = | 189 contents_texture_manager_ = |
189 PrioritizedResourceManager::Create(proxy_.get()); | 190 PrioritizedResourceManager::Create(proxy_.get()); |
190 surface_memory_placeholder_ = | 191 surface_memory_placeholder_ = |
191 contents_texture_manager_->CreateTexture(gfx::Size(), GL_RGBA); | 192 contents_texture_manager_->CreateTexture(gfx::Size(), GL_RGBA); |
192 } | 193 } |
193 | 194 |
| 195 settings_.use_gpu_memory_buffers = |
| 196 settings_.use_gpu_memory_buffers && |
| 197 proxy_->GetRendererCapabilities().use_gpu_memory_buffers; |
| 198 |
194 client_->DidInitializeOutputSurface(true); | 199 client_->DidInitializeOutputSurface(true); |
195 return CreateSucceeded; | 200 return CreateSucceeded; |
196 } | 201 } |
197 | 202 |
198 // Failure path. | 203 // Failure path. |
199 | 204 |
200 client_->DidFailToInitializeOutputSurface(); | 205 client_->DidFailToInitializeOutputSurface(); |
201 | 206 |
202 // Tolerate a certain number of recreation failures to work around races | 207 // Tolerate a certain number of recreation failures to work around races |
203 // in the output-surface-lost machinery. | 208 // in the output-surface-lost machinery. |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 bool start_ready_animations = true; | 1100 bool start_ready_animations = true; |
1096 (*iter).second->UpdateState(start_ready_animations, NULL); | 1101 (*iter).second->UpdateState(start_ready_animations, NULL); |
1097 } | 1102 } |
1098 } | 1103 } |
1099 | 1104 |
1100 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1105 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
1101 return proxy_->CapturePicture(); | 1106 return proxy_->CapturePicture(); |
1102 } | 1107 } |
1103 | 1108 |
1104 } // namespace cc | 1109 } // namespace cc |
OLD | NEW |