Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3942)

Unified Diff: cc/layers/layer.cc

Issue 1586343003: cc: Add some tracing below LayerTreeHost::PushProperties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/layers/nine_patch_layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 238c23476e8bb1fb762f459eeb59666cbb795dc3..cc2cbbb537c0a7c859681652fe149eebde643ccd 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -1162,6 +1162,7 @@ static void PostCopyCallbackToMainThread(
}
void Layer::PushPropertiesTo(LayerImpl* layer) {
+ TRACE_EVENT0("cc", "Layer::PushPropertiesTo");
DCHECK(layer_tree_host_);
// If we did not SavePaintProperties() for the layer this frame, then push the
@@ -1284,26 +1285,28 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->PushScrollOffsetFromMainThread(scroll_offset_);
layer->SetScrollCompensationAdjustment(ScrollCompensationAdjustment());
- // Wrap the copy_requests_ in a PostTask to the main thread.
- std::vector<scoped_ptr<CopyOutputRequest>> main_thread_copy_requests;
- for (auto it = copy_requests_.begin(); it != copy_requests_.end(); ++it) {
- scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner =
- layer_tree_host()->task_runner_provider()->MainThreadTaskRunner();
- scoped_ptr<CopyOutputRequest> original_request = std::move(*it);
- const CopyOutputRequest& original_request_ref = *original_request;
- scoped_ptr<CopyOutputRequest> main_thread_request =
- CopyOutputRequest::CreateRelayRequest(
- original_request_ref,
- base::Bind(&PostCopyCallbackToMainThread,
- main_thread_task_runner,
- base::Passed(&original_request)));
- main_thread_copy_requests.push_back(std::move(main_thread_request));
- }
- if (!copy_requests_.empty() && layer_tree_host_)
- layer_tree_host_->property_trees()->needs_rebuild = true;
+ {
+ TRACE_EVENT0("cc", "Layer::PushPropertiesTo::CopyOutputRequests");
+ // Wrap the copy_requests_ in a PostTask to the main thread.
+ std::vector<scoped_ptr<CopyOutputRequest>> main_thread_copy_requests;
+ for (auto it = copy_requests_.begin(); it != copy_requests_.end(); ++it) {
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner =
+ layer_tree_host()->task_runner_provider()->MainThreadTaskRunner();
+ scoped_ptr<CopyOutputRequest> original_request = std::move(*it);
+ const CopyOutputRequest& original_request_ref = *original_request;
+ scoped_ptr<CopyOutputRequest> main_thread_request =
+ CopyOutputRequest::CreateRelayRequest(
+ original_request_ref,
+ base::Bind(&PostCopyCallbackToMainThread, main_thread_task_runner,
+ base::Passed(&original_request)));
+ main_thread_copy_requests.push_back(std::move(main_thread_request));
+ }
+ if (!copy_requests_.empty() && layer_tree_host_)
+ layer_tree_host_->property_trees()->needs_rebuild = true;
- copy_requests_.clear();
- layer->PassCopyRequests(&main_thread_copy_requests);
+ copy_requests_.clear();
+ layer->PassCopyRequests(&main_thread_copy_requests);
+ }
// If the main thread commits multiple times before the impl thread actually
// draws, then damage tracking will become incorrect if we simply clobber the
« no previous file with comments | « no previous file | cc/layers/nine_patch_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698