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/content_layer.h" | 5 #include "cc/content_layer.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 { | 25 { |
26 return make_scoped_ptr(new ContentLayerPainter(client)); | 26 return make_scoped_ptr(new ContentLayerPainter(client)); |
27 } | 27 } |
28 | 28 |
29 void ContentLayerPainter::paint(SkCanvas* canvas, gfx::Rect contentRect, gfx::Re
ctF& opaque) | 29 void ContentLayerPainter::paint(SkCanvas* canvas, gfx::Rect contentRect, gfx::Re
ctF& opaque) |
30 { | 30 { |
31 base::TimeTicks paintStart = base::TimeTicks::HighResNow(); | 31 base::TimeTicks paintStart = base::TimeTicks::HighResNow(); |
32 m_client->paintContents(canvas, contentRect, opaque); | 32 m_client->paintContents(canvas, contentRect, opaque); |
33 base::TimeTicks paintEnd = base::TimeTicks::HighResNow(); | 33 base::TimeTicks paintEnd = base::TimeTicks::HighResNow(); |
34 double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintE
nd - paintStart).InSecondsF(); | 34 double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintE
nd - paintStart).InSecondsF(); |
35 HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintDurationMS", (paintEnd -
paintStart).InMilliseconds(), 0, 120, 30); | 35 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintDurationMS", |
36 HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintMegapixPerSecond", pixel
sPerSec / 1000000, 10, 210, 30); | 36 (paintEnd - paintStart).InMilliseconds(), |
| 37 0, 120, 30); |
| 38 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.AccelContentPaintMegapixPerSecond", |
| 39 pixelsPerSec / 1000000, 10, 210, 30); |
37 } | 40 } |
38 | 41 |
39 const int ContentLayer::kLCDTextMaxChangeCount = 1; | 42 const int ContentLayer::kLCDTextMaxChangeCount = 1; |
40 | 43 |
41 scoped_refptr<ContentLayer> ContentLayer::create(ContentLayerClient* client) | 44 scoped_refptr<ContentLayer> ContentLayer::create(ContentLayerClient* client) |
42 { | 45 { |
43 return make_scoped_refptr(new ContentLayer(client)); | 46 return make_scoped_refptr(new ContentLayer(client)); |
44 } | 47 } |
45 | 48 |
46 ContentLayer::ContentLayer(ContentLayerClient* client) | 49 ContentLayer::ContentLayer(ContentLayerClient* client) |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // it does not really cause any invalidation. | 146 // it does not really cause any invalidation. |
144 TRACE_EVENT_INSTANT0("cc", "ContentLayer::canUseLCDTextDidChange"); | 147 TRACE_EVENT_INSTANT0("cc", "ContentLayer::canUseLCDTextDidChange"); |
145 } | 148 } |
146 ++m_lcdTextChangeCount; | 149 ++m_lcdTextChangeCount; |
147 | 150 |
148 // Need to repaint the layer with different text AA setting. | 151 // Need to repaint the layer with different text AA setting. |
149 setNeedsDisplay(); | 152 setNeedsDisplay(); |
150 } | 153 } |
151 | 154 |
152 } // namespace cc | 155 } // namespace cc |
OLD | NEW |