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

Side by Side Diff: cc/layers/surface_layer.cc

Issue 1178963003: Trace main thread commit in flow events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make OnCommit virtual and only LatencyInfoSwapPromise can call it to trace flow events. Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/output/latency_info_swap_promise.h » ('j') | cc/output/swap_promise.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/layers/surface_layer.h" 5 #include "cc/layers/surface_layer.h"
6 6
7 #include "cc/layers/surface_layer_impl.h" 7 #include "cc/layers/surface_layer_impl.h"
8 #include "cc/output/swap_promise.h" 8 #include "cc/output/swap_promise.h"
9 #include "cc/trees/layer_tree_host.h" 9 #include "cc/trees/layer_tree_host.h"
10 10
(...skipping 10 matching lines...) Expand all
21 private: 21 private:
22 void DidActivate() override {} 22 void DidActivate() override {}
23 void DidSwap(CompositorFrameMetadata* metadata) override { 23 void DidSwap(CompositorFrameMetadata* metadata) override {
24 metadata->satisfies_sequences.push_back(sequence_.sequence); 24 metadata->satisfies_sequences.push_back(sequence_.sequence);
25 } 25 }
26 26
27 void DidNotSwap(DidNotSwapReason reason) override { 27 void DidNotSwap(DidNotSwapReason reason) override {
28 satisfy_callback_.Run(sequence_); 28 satisfy_callback_.Run(sequence_);
29 } 29 }
30 int64 TraceId() const override { return 0; } 30 int64 TraceId() const override { return 0; }
31 void OnCommit() override { return; }
31 32
32 SurfaceSequence sequence_; 33 SurfaceSequence sequence_;
33 SurfaceLayer::SatisfyCallback satisfy_callback_; 34 SurfaceLayer::SatisfyCallback satisfy_callback_;
34 35
35 DISALLOW_COPY_AND_ASSIGN(SatisfySwapPromise); 36 DISALLOW_COPY_AND_ASSIGN(SatisfySwapPromise);
36 }; 37 };
37 38
38 scoped_refptr<SurfaceLayer> SurfaceLayer::Create( 39 scoped_refptr<SurfaceLayer> SurfaceLayer::Create(
39 const LayerSettings& settings, 40 const LayerSettings& settings,
40 const SatisfyCallback& satisfy_callback, 41 const SatisfyCallback& satisfy_callback,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 if (!layer_tree_host()) 111 if (!layer_tree_host())
111 return; 112 return;
112 DCHECK(!destroy_sequence_.is_null()); 113 DCHECK(!destroy_sequence_.is_null());
113 scoped_ptr<SatisfySwapPromise> satisfy( 114 scoped_ptr<SatisfySwapPromise> satisfy(
114 new SatisfySwapPromise(destroy_sequence_, satisfy_callback_)); 115 new SatisfySwapPromise(destroy_sequence_, satisfy_callback_));
115 layer_tree_host()->QueueSwapPromise(satisfy.Pass()); 116 layer_tree_host()->QueueSwapPromise(satisfy.Pass());
116 destroy_sequence_ = SurfaceSequence(); 117 destroy_sequence_ = SurfaceSequence();
117 } 118 }
118 119
119 } // namespace cc 120 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/latency_info_swap_promise.h » ('j') | cc/output/swap_promise.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698