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

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

Issue 1535833002: Delete CC. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-5
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « cc/debug/frame_timing_tracker.h ('k') | cc/debug/frame_timing_tracker_unittest.cc » ('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 2015 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/frame_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 FrameTimingTracker::CompositeTimingEvent::CompositeTimingEvent(
16 int _frame_id,
17 base::TimeTicks _timestamp)
18 : frame_id(_frame_id), timestamp(_timestamp) {
19 }
20
21 FrameTimingTracker::CompositeTimingEvent::~CompositeTimingEvent() {
22 }
23
24 // static
25 scoped_ptr<FrameTimingTracker> FrameTimingTracker::Create() {
26 return make_scoped_ptr(new FrameTimingTracker);
27 }
28
29 FrameTimingTracker::FrameTimingTracker() {
30 }
31
32 FrameTimingTracker::~FrameTimingTracker() {
33 }
34
35 void FrameTimingTracker::SaveTimeStamps(
36 base::TimeTicks timestamp,
37 const std::vector<FrameAndRectIds>& frame_ids) {
38 if (!composite_events_)
39 composite_events_.reset(new CompositeTimingSet);
40 for (const auto& pair : frame_ids)
41 (*composite_events_)[pair.second].push_back(
42 CompositeTimingEvent(pair.first, timestamp));
43 }
44
45 scoped_ptr<FrameTimingTracker::CompositeTimingSet>
46 FrameTimingTracker::GroupCountsByRectId() {
47 if (!composite_events_)
48 return make_scoped_ptr(new CompositeTimingSet);
49 scoped_ptr<CompositeTimingSet> composite_info(new CompositeTimingSet);
50 for (auto& infos : *composite_events_)
51 std::sort(
52 infos.second.begin(), infos.second.end(),
53 [](const CompositeTimingEvent& lhs, const CompositeTimingEvent& rhs) {
54 return lhs.timestamp < rhs.timestamp;
55 });
56 return composite_events_.Pass();
57 }
58
59 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/frame_timing_tracker.h ('k') | cc/debug/frame_timing_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698