OLD | NEW |
---|---|
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/content_layer.h" | 5 #include "cc/layers/content_layer.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "cc/layers/content_layer_client.h" | 10 #include "cc/layers/content_layer_client.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 ContentLayerClient::GRAPHICS_CONTEXT_ENABLED); | 34 ContentLayerClient::GRAPHICS_CONTEXT_ENABLED); |
35 base::TimeTicks paint_end = base::TimeTicks::HighResNow(); | 35 base::TimeTicks paint_end = base::TimeTicks::HighResNow(); |
36 // The start and end times might be the same if the paint was very fast or if | 36 // The start and end times might be the same if the paint was very fast or if |
37 // our timer granularity is poor. Treat this as a very short time duration | 37 // our timer granularity is poor. Treat this as a very short time duration |
38 // instead of none to avoid dividing by zero. | 38 // instead of none to avoid dividing by zero. |
39 if (paint_end == paint_start) | 39 if (paint_end == paint_start) |
40 paint_end += base::TimeDelta::FromMicroseconds(1); | 40 paint_end += base::TimeDelta::FromMicroseconds(1); |
41 | 41 |
42 double pixels_per_sec = (content_rect.width() * content_rect.height()) / | 42 double pixels_per_sec = (content_rect.width() * content_rect.height()) / |
43 (paint_end - paint_start).InSecondsF(); | 43 (paint_end - paint_start).InSecondsF(); |
44 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintDurationMS", | |
45 (paint_end - paint_start).InMilliseconds(), | |
46 0, | |
47 120, | |
48 30); | |
49 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintMegapixPerSecond", | 44 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintMegapixPerSecond", |
danakj
2014/05/12 15:57:53
Let's delete this one too? It's coming from the sa
| |
50 pixels_per_sec / 1000000, | 45 pixels_per_sec / 1000000, |
51 10, | 46 10, |
52 210, | 47 210, |
53 30); | 48 30); |
54 } | 49 } |
55 | 50 |
56 scoped_refptr<ContentLayer> ContentLayer::Create(ContentLayerClient* client) { | 51 scoped_refptr<ContentLayer> ContentLayer::Create(ContentLayerClient* client) { |
57 return make_scoped_refptr(new ContentLayer(client)); | 52 return make_scoped_refptr(new ContentLayer(client)); |
58 } | 53 } |
59 | 54 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 return picture; | 169 return picture; |
175 } | 170 } |
176 | 171 |
177 void ContentLayer::OnOutputSurfaceCreated() { | 172 void ContentLayer::OnOutputSurfaceCreated() { |
178 SetTextureFormat( | 173 SetTextureFormat( |
179 layer_tree_host()->GetRendererCapabilities().best_texture_format); | 174 layer_tree_host()->GetRendererCapabilities().best_texture_format); |
180 TiledLayer::OnOutputSurfaceCreated(); | 175 TiledLayer::OnOutputSurfaceCreated(); |
181 } | 176 } |
182 | 177 |
183 } // namespace cc | 178 } // namespace cc |
OLD | NEW |