| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 namespace { | 41 namespace { |
| 42 static int s_num_layer_tree_instances; | 42 static int s_num_layer_tree_instances; |
| 43 } | 43 } |
| 44 | 44 |
| 45 namespace cc { | 45 namespace cc { |
| 46 | 46 |
| 47 RendererCapabilities::RendererCapabilities() | 47 RendererCapabilities::RendererCapabilities() |
| 48 : best_texture_format(0), | 48 : best_texture_format(0), |
| 49 using_partial_swap(false), | 49 using_partial_swap(false), |
| 50 using_accelerated_painting(false), | |
| 51 using_set_visibility(false), | 50 using_set_visibility(false), |
| 52 using_swap_complete_callback(false), | 51 using_swap_complete_callback(false), |
| 53 using_gpu_memory_manager(false), | 52 using_gpu_memory_manager(false), |
| 54 using_egl_image(false), | 53 using_egl_image(false), |
| 55 allow_partial_texture_updates(false), | 54 allow_partial_texture_updates(false), |
| 56 using_offscreen_context3d(false), | 55 using_offscreen_context3d(false), |
| 57 max_texture_size(0), | 56 max_texture_size(0), |
| 58 avoid_pow2_textures(false), | 57 avoid_pow2_textures(false), |
| 59 using_map_image(false) {} | 58 using_map_image(false) {} |
| 60 | 59 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) { | 161 LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted(bool success) { |
| 163 TRACE_EVENT1("cc", | 162 TRACE_EVENT1("cc", |
| 164 "LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted", | 163 "LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted", |
| 165 "success", | 164 "success", |
| 166 success); | 165 success); |
| 167 | 166 |
| 168 DCHECK(output_surface_lost_); | 167 DCHECK(output_surface_lost_); |
| 169 if (success) { | 168 if (success) { |
| 170 output_surface_lost_ = false; | 169 output_surface_lost_ = false; |
| 171 | 170 |
| 172 // Update settings_ based on capabilities that we got back from the | |
| 173 // renderer. | |
| 174 settings_.accelerate_painting = | |
| 175 proxy_->GetRendererCapabilities().using_accelerated_painting; | |
| 176 | |
| 177 // Update settings_ based on partial update capability. | 171 // Update settings_ based on partial update capability. |
| 178 size_t max_partial_texture_updates = 0; | 172 size_t max_partial_texture_updates = 0; |
| 179 if (proxy_->GetRendererCapabilities().allow_partial_texture_updates && | 173 if (proxy_->GetRendererCapabilities().allow_partial_texture_updates && |
| 180 !settings_.impl_side_painting) { | 174 !settings_.impl_side_painting) { |
| 181 max_partial_texture_updates = std::min( | 175 max_partial_texture_updates = std::min( |
| 182 settings_.max_partial_texture_updates, | 176 settings_.max_partial_texture_updates, |
| 183 proxy_->MaxPartialTextureUpdates()); | 177 proxy_->MaxPartialTextureUpdates()); |
| 184 } | 178 } |
| 185 settings_.max_partial_texture_updates = max_partial_texture_updates; | 179 settings_.max_partial_texture_updates = max_partial_texture_updates; |
| 186 | 180 |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 bool start_ready_animations = true; | 1070 bool start_ready_animations = true; |
| 1077 (*iter).second->UpdateState(start_ready_animations, NULL); | 1071 (*iter).second->UpdateState(start_ready_animations, NULL); |
| 1078 } | 1072 } |
| 1079 } | 1073 } |
| 1080 | 1074 |
| 1081 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { | 1075 skia::RefPtr<SkPicture> LayerTreeHost::CapturePicture() { |
| 1082 return proxy_->CapturePicture(); | 1076 return proxy_->CapturePicture(); |
| 1083 } | 1077 } |
| 1084 | 1078 |
| 1085 } // namespace cc | 1079 } // namespace cc |
| OLD | NEW |