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 #ifndef CC_DEBUG_OVERDRAW_METRICS_H_ | 5 #ifndef CC_DEBUG_OVERDRAW_METRICS_H_ |
6 #define CC_DEBUG_OVERDRAW_METRICS_H_ | 6 #define CC_DEBUG_OVERDRAW_METRICS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class Rect; | 12 class Rect; |
13 class Transform; | 13 class Transform; |
14 } | 14 } |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 class LayerTreeHost; | 17 class LayerTreeHost; |
18 class LayerTreeHostImpl; | 18 class LayerTreeHostImpl; |
19 | 19 |
20 class OverdrawMetrics { | 20 class OverdrawMetrics { |
21 public: | 21 public: |
22 static scoped_ptr<OverdrawMetrics> Create(bool record_metrics_for_frame) { | 22 static scoped_ptr<OverdrawMetrics> Create(bool record_metrics_for_frame) { |
23 return make_scoped_ptr(new OverdrawMetrics(record_metrics_for_frame)); | 23 return make_scoped_ptr(new OverdrawMetrics(record_metrics_for_frame)); |
24 } | 24 } |
25 | 25 |
26 // These methods are used for saving metrics during update/commit. | 26 // These methods are used for saving metrics during update/commit. |
27 | 27 |
28 // Record pixels painted by WebKit into the texture updater, but does not mean | 28 // Record pixels painted by WebKit into the texture updater, but does not mean |
29 // the pixels were rasterized in main memory. | 29 // the pixels were rasterized in main memory. |
30 void DidPaint(gfx::Rect painted_rect); | 30 void DidPaint(gfx::Rect painted_rect); |
31 // Records that an invalid tile was culled and did not need to be | 31 // Records that an invalid tile was culled and did not need to be |
32 // painted/uploaded, and did not contribute to other tiles needing to be | 32 // painted/uploaded, and did not contribute to other tiles needing to be |
33 // painted. | 33 // painted. |
34 void DidCullTilesForUpload(int count); | 34 void DidCullTilesForUpload(int count); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // Count of pixels that were painted due to invalidation. | 87 // Count of pixels that were painted due to invalidation. |
88 float pixels_painted_; | 88 float pixels_painted_; |
89 // Count of pixels uploaded to textures and known to be opaque. | 89 // Count of pixels uploaded to textures and known to be opaque. |
90 float pixels_uploaded_opaque_; | 90 float pixels_uploaded_opaque_; |
91 // Count of pixels uploaded to textures and not known to be opaque. | 91 // Count of pixels uploaded to textures and not known to be opaque. |
92 float pixels_uploaded_translucent_; | 92 float pixels_uploaded_translucent_; |
93 // Count of tiles that were invalidated but not uploaded. | 93 // Count of tiles that were invalidated but not uploaded. |
94 int tiles_culled_for_upload_; | 94 int tiles_culled_for_upload_; |
95 // Count the number of bytes in contents textures. | 95 // Count the number of bytes in contents textures. |
96 unsigned long long contents_texture_use_bytes_; | 96 uint64 contents_texture_use_bytes_; |
97 // Count the number of bytes in RenderSurfaceImpl textures. | 97 // Count the number of bytes in RenderSurfaceImpl textures. |
98 unsigned long long render_surface_texture_use_bytes_; | 98 uint64 render_surface_texture_use_bytes_; |
99 | 99 |
100 // These values are used for saving metrics during draw. | 100 // These values are used for saving metrics during draw. |
101 | 101 |
102 // Count of pixels that are opaque (and thus occlude). Ideally this is no more | 102 // Count of pixels that are opaque (and thus occlude). Ideally this is no more |
103 // than wiewport width x height. | 103 // than wiewport width x height. |
104 float pixels_drawn_opaque_; | 104 float pixels_drawn_opaque_; |
105 // Count of pixels that are possibly translucent, and cannot occlude. | 105 // Count of pixels that are possibly translucent, and cannot occlude. |
106 float pixels_drawn_translucent_; | 106 float pixels_drawn_translucent_; |
107 // Count of pixels not drawn as they are occluded by somthing opaque. | 107 // Count of pixels not drawn as they are occluded by somthing opaque. |
108 float pixels_culled_for_drawing_; | 108 float pixels_culled_for_drawing_; |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(OverdrawMetrics); | 110 DISALLOW_COPY_AND_ASSIGN(OverdrawMetrics); |
111 }; | 111 }; |
112 | 112 |
113 } // namespace cc | 113 } // namespace cc |
114 | 114 |
115 #endif // CC_DEBUG_OVERDRAW_METRICS_H_ | 115 #endif // CC_DEBUG_OVERDRAW_METRICS_H_ |
OLD | NEW |