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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 LOG(ERROR) | 2096 LOG(ERROR) |
2097 << "Forcing zero-copy tile initialization as worker context is missing"; | 2097 << "Forcing zero-copy tile initialization as worker context is missing"; |
2098 use_zero_copy = true; | 2098 use_zero_copy = true; |
2099 } | 2099 } |
2100 | 2100 |
2101 if (use_zero_copy) { | 2101 if (use_zero_copy) { |
2102 *resource_pool = | 2102 *resource_pool = |
2103 ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); | 2103 ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); |
2104 | 2104 |
2105 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( | 2105 *tile_task_worker_pool = ZeroCopyTileTaskWorkerPool::Create( |
2106 GetTaskRunner(), task_graph_runner, resource_provider_.get()); | 2106 GetTaskRunner(), task_graph_runner, resource_provider_.get(), |
| 2107 settings_.renderer_settings.use_rgba_4444_textures); |
2107 return; | 2108 return; |
2108 } | 2109 } |
2109 | 2110 |
2110 *resource_pool = ResourcePool::Create(resource_provider_.get(), | 2111 *resource_pool = ResourcePool::Create(resource_provider_.get(), |
2111 GetTaskRunner(), GL_TEXTURE_2D); | 2112 GetTaskRunner(), GL_TEXTURE_2D); |
2112 | 2113 |
2113 int max_copy_texture_chromium_size = context_provider->ContextCapabilities() | 2114 int max_copy_texture_chromium_size = context_provider->ContextCapabilities() |
2114 .gpu.max_copy_texture_chromium_size; | 2115 .gpu.max_copy_texture_chromium_size; |
2115 | 2116 |
2116 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create( | 2117 *tile_task_worker_pool = OneCopyTileTaskWorkerPool::Create( |
2117 GetTaskRunner(), task_graph_runner, context_provider, | 2118 GetTaskRunner(), task_graph_runner, context_provider, |
2118 resource_provider_.get(), max_copy_texture_chromium_size, | 2119 resource_provider_.get(), max_copy_texture_chromium_size, |
2119 settings_.use_persistent_map_for_gpu_memory_buffers, | 2120 settings_.use_persistent_map_for_gpu_memory_buffers, |
2120 settings_.max_staging_buffer_usage_in_bytes); | 2121 settings_.max_staging_buffer_usage_in_bytes, |
| 2122 settings_.renderer_settings.use_rgba_4444_textures); |
2121 } | 2123 } |
2122 | 2124 |
2123 void LayerTreeHostImpl::RecordMainFrameTiming( | 2125 void LayerTreeHostImpl::RecordMainFrameTiming( |
2124 const BeginFrameArgs& start_of_main_frame_args, | 2126 const BeginFrameArgs& start_of_main_frame_args, |
2125 const BeginFrameArgs& expected_next_main_frame_args) { | 2127 const BeginFrameArgs& expected_next_main_frame_args) { |
2126 std::vector<int64_t> request_ids; | 2128 std::vector<int64_t> request_ids; |
2127 active_tree_->GatherFrameTimingRequestIds(&request_ids); | 2129 active_tree_->GatherFrameTimingRequestIds(&request_ids); |
2128 if (request_ids.empty()) | 2130 if (request_ids.empty()) |
2129 return; | 2131 return; |
2130 | 2132 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2168 // information to do this yet (eg. we don't have a TileManager at this | 2170 // information to do this yet (eg. we don't have a TileManager at this |
2169 // point). | 2171 // point). |
2170 return false; | 2172 return false; |
2171 } | 2173 } |
2172 | 2174 |
2173 output_surface_ = output_surface.Pass(); | 2175 output_surface_ = output_surface.Pass(); |
2174 resource_provider_ = ResourceProvider::Create( | 2176 resource_provider_ = ResourceProvider::Create( |
2175 output_surface_.get(), shared_bitmap_manager_, gpu_memory_buffer_manager_, | 2177 output_surface_.get(), shared_bitmap_manager_, gpu_memory_buffer_manager_, |
2176 proxy_->blocking_main_thread_task_runner(), | 2178 proxy_->blocking_main_thread_task_runner(), |
2177 settings_.renderer_settings.highp_threshold_min, | 2179 settings_.renderer_settings.highp_threshold_min, |
2178 settings_.renderer_settings.use_rgba_4444_textures, | |
2179 settings_.renderer_settings.texture_id_allocation_chunk_size, | 2180 settings_.renderer_settings.texture_id_allocation_chunk_size, |
2180 settings_.use_image_texture_targets); | 2181 settings_.use_image_texture_targets); |
2181 | 2182 |
2182 CreateAndSetRenderer(); | 2183 CreateAndSetRenderer(); |
2183 | 2184 |
2184 // Since the new renderer may be capable of MSAA, update status here. | 2185 // Since the new renderer may be capable of MSAA, update status here. |
2185 UpdateGpuRasterizationStatus(); | 2186 UpdateGpuRasterizationStatus(); |
2186 | 2187 |
2187 CreateTileManagerResources(); | 2188 CreateTileManagerResources(); |
2188 RecreateTreeResources(); | 2189 RecreateTreeResources(); |
(...skipping 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3586 if (active_tree()) { | 3587 if (active_tree()) { |
3587 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); | 3588 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); |
3588 if (layer) | 3589 if (layer) |
3589 return layer->ScrollOffsetForAnimation(); | 3590 return layer->ScrollOffsetForAnimation(); |
3590 } | 3591 } |
3591 | 3592 |
3592 return gfx::ScrollOffset(); | 3593 return gfx::ScrollOffset(); |
3593 } | 3594 } |
3594 | 3595 |
3595 } // namespace cc | 3596 } // namespace cc |
OLD | NEW |