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 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2096 *resource_pool = ResourcePool::Create( | 2096 *resource_pool = ResourcePool::Create( |
2097 resource_provider_.get(), GL_TEXTURE_2D); | 2097 resource_provider_.get(), GL_TEXTURE_2D); |
2098 | 2098 |
2099 *tile_task_worker_pool = PixelBufferTileTaskWorkerPool::Create( | 2099 *tile_task_worker_pool = PixelBufferTileTaskWorkerPool::Create( |
2100 task_runner, TileTaskWorkerPool::GetTaskGraphRunner(), context_provider, | 2100 task_runner, TileTaskWorkerPool::GetTaskGraphRunner(), context_provider, |
2101 resource_provider_.get(), | 2101 resource_provider_.get(), |
2102 GetMaxTransferBufferUsageBytes(context_provider->ContextCapabilities(), | 2102 GetMaxTransferBufferUsageBytes(context_provider->ContextCapabilities(), |
2103 settings_.renderer_settings.refresh_rate)); | 2103 settings_.renderer_settings.refresh_rate)); |
2104 } | 2104 } |
2105 | 2105 |
2106 void LayerTreeHostImpl::RecordMainFrameTiming( | |
2107 const BeginFrameArgs& start_of_main_frame_args, | |
2108 const BeginFrameArgs& current_frame_args) { | |
mithro-old
2015/03/23 00:15:08
This is "current_main_frame_args" or "current_impl
vmpstr
2015/03/23 20:26:43
That's where I'm a little bit hesitant. It's reall
mithro-old
2015/03/24 07:37:42
I think you need to be *explicitly* clear what is
vmpstr
2015/03/24 18:02:15
In the situation where main frames don't happen on
| |
2109 std::vector<int64_t> request_ids; | |
2110 active_tree_->GatherFrameTimingRequestIds(&request_ids); | |
2111 if (request_ids.empty()) | |
2112 return; | |
2113 | |
2114 base::TimeTicks start_time = start_of_main_frame_args.frame_time; | |
2115 // Since we finished the work in the current frame, we should be sending the | |
2116 // next frame's frame_time. However, at this stage we don't know what the next | |
2117 // frame_time will be. We can estimate this value by adding interval to the | |
2118 // current frame's frame_time. | |
mithro-old
2015/03/23 00:15:08
I really don't think we should be sending an estim
vmpstr
2015/03/23 20:26:43
Done. With the latest patch, this is not an estima
| |
2119 base::TimeTicks end_time = | |
2120 current_frame_args.frame_time + current_frame_args.interval; | |
2121 frame_timing_tracker_->SaveMainFrameTimeStamps( | |
2122 request_ids, start_time, end_time, active_tree_->source_frame_number()); | |
2123 } | |
2124 | |
2106 void LayerTreeHostImpl::DestroyTileManager() { | 2125 void LayerTreeHostImpl::DestroyTileManager() { |
2107 tile_manager_ = nullptr; | 2126 tile_manager_ = nullptr; |
2108 resource_pool_ = nullptr; | 2127 resource_pool_ = nullptr; |
2109 staging_resource_pool_ = nullptr; | 2128 staging_resource_pool_ = nullptr; |
2110 tile_task_worker_pool_ = nullptr; | 2129 tile_task_worker_pool_ = nullptr; |
2111 rasterizer_ = nullptr; | 2130 rasterizer_ = nullptr; |
2112 single_thread_synchronous_task_graph_runner_ = nullptr; | 2131 single_thread_synchronous_task_graph_runner_ = nullptr; |
2113 } | 2132 } |
2114 | 2133 |
2115 bool LayerTreeHostImpl::IsSynchronousSingleThreaded() const { | 2134 bool LayerTreeHostImpl::IsSynchronousSingleThreaded() const { |
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3467 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3486 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
3468 | 3487 |
3469 curve->UpdateTarget( | 3488 curve->UpdateTarget( |
3470 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3489 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
3471 .InSecondsF(), | 3490 .InSecondsF(), |
3472 new_target); | 3491 new_target); |
3473 | 3492 |
3474 return true; | 3493 return true; |
3475 } | 3494 } |
3476 } // namespace cc | 3495 } // namespace cc |
OLD | NEW |