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

Side by Side Diff: cc/debug/smoothness_timing_tracker.cc

Issue 397443002: [not for review] Add Draw entries to window Performance Timeline Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use damage rect not viewport rect Created 6 years, 3 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 | « cc/debug/smoothness_timing_tracker.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/debug/smoothness_timing_tracker.h"
6
7 #include <algorithm>
8 #include <limits>
9
10 #include "base/metrics/histogram.h"
11 #include "cc/trees/proxy.h"
12
13 namespace cc {
14
15 // static
16 scoped_ptr<SmoothnessTimingTracker> SmoothnessTimingTracker::Create() {
17 return make_scoped_ptr(new SmoothnessTimingTracker);
18 }
19
20 SmoothnessTimingTracker::SmoothnessTimingTracker() {
21 }
22
23 void SmoothnessTimingTracker::SaveTimeStamps(
24 base::TimeTicks timestamp,
25 const std::vector<std::pair<int, int64_t> >& frame_ids) {
26 for (std::vector<std::pair<int, int64_t> >::const_iterator it =
27 frame_ids.begin();
28 it != frame_ids.end();
29 ++it) {
30 SmoothnessTimingCompositeEvent smoothness_timing_composite_event(
31 it->first, it->second, timestamp);
32 ring_buffer_.SaveToBuffer(smoothness_timing_composite_event);
33 }
34 }
35
36 scoped_ptr<CompositeTimingSet>
37 SmoothnessTimingTracker::CalculateCompositeCounts() {
38 typedef base::hash_map<int64_t,
39 std::vector<std::pair<int, base::TimeTicks> > >
40 TicksByRectId;
41 TicksByRectId id_map;
42 for (RingBufferType::Iterator it = begin(); it; ++it) {
43 id_map[it->rect_id_].push_back(
44 std::make_pair(it->frame_id_, it->timestamp_));
45 }
46 scoped_ptr<CompositeTimingSet> composite_info(new CompositeTimingSet);
47 for (TicksByRectId::iterator id = id_map.begin(); id != id_map.end(); ++id) {
48 LayerTreeHostCommon::CompositeTimingInfo composite;
49 composite.rect_id = id->first;
50 composite.timestamps = id->second;
51 std::sort(composite.timestamps.begin(), composite.timestamps.end());
52 composite_info->composites.push_back(composite);
53 }
54 return composite_info.Pass();
55 }
56
57 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/smoothness_timing_tracker.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698