| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/debug/rendering_stats.h" | 5 #include "cc/debug/rendering_stats.h" |
| 6 | 6 |
| 7 namespace cc { | 7 namespace cc { |
| 8 | 8 |
| 9 RenderingStats::TimeDeltaList::TimeDeltaList() { | 9 RenderingStats::TimeDeltaList::TimeDeltaList() { |
| 10 } | 10 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 std::list<base::TimeDelta>::const_iterator iter; | 21 std::list<base::TimeDelta>::const_iterator iter; |
| 22 for (iter = values.begin(); iter != values.end(); ++iter) { | 22 for (iter = values.begin(); iter != values.end(); ++iter) { |
| 23 list_value->AppendDouble(iter->InMillisecondsF()); | 23 list_value->AppendDouble(iter->InMillisecondsF()); |
| 24 } | 24 } |
| 25 } | 25 } |
| 26 | 26 |
| 27 void RenderingStats::TimeDeltaList::Add(const TimeDeltaList& other) { | 27 void RenderingStats::TimeDeltaList::Add(const TimeDeltaList& other) { |
| 28 values.insert(values.end(), other.values.begin(), other.values.end()); | 28 values.insert(values.end(), other.values.begin(), other.values.end()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 base::TimeDelta RenderingStats::TimeDeltaList::GetLastTimeDelta() const { |
| 32 return values.empty() ? base::TimeDelta() : values.back(); |
| 33 } |
| 34 |
| 31 RenderingStats::MainThreadRenderingStats::MainThreadRenderingStats() | 35 RenderingStats::MainThreadRenderingStats::MainThreadRenderingStats() |
| 32 : painted_pixel_count(0), recorded_pixel_count(0) { | 36 : painted_pixel_count(0), recorded_pixel_count(0) { |
| 33 } | 37 } |
| 34 | 38 |
| 35 RenderingStats::MainThreadRenderingStats::~MainThreadRenderingStats() { | 39 RenderingStats::MainThreadRenderingStats::~MainThreadRenderingStats() { |
| 36 } | 40 } |
| 37 | 41 |
| 38 scoped_refptr<base::debug::ConvertableToTraceFormat> | 42 scoped_refptr<base::debug::ConvertableToTraceFormat> |
| 39 RenderingStats::MainThreadRenderingStats::AsTraceableData() const { | 43 RenderingStats::MainThreadRenderingStats::AsTraceableData() const { |
| 40 scoped_refptr<base::debug::TracedValue> record_data = | 44 scoped_refptr<base::debug::TracedValue> record_data = |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 commit_to_activate_duration_estimate.Add( | 124 commit_to_activate_duration_estimate.Add( |
| 121 other.commit_to_activate_duration_estimate); | 125 other.commit_to_activate_duration_estimate); |
| 122 } | 126 } |
| 123 | 127 |
| 124 void RenderingStats::Add(const RenderingStats& other) { | 128 void RenderingStats::Add(const RenderingStats& other) { |
| 125 main_stats.Add(other.main_stats); | 129 main_stats.Add(other.main_stats); |
| 126 impl_stats.Add(other.impl_stats); | 130 impl_stats.Add(other.impl_stats); |
| 127 } | 131 } |
| 128 | 132 |
| 129 } // namespace cc | 133 } // namespace cc |
| OLD | NEW |