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

Side by Side Diff: cc/overdraw_metrics.h

Issue 11308153: Migrate most of cc/ from WebKit::WebTransformationMatrix to gfx::Transform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch for landing Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « cc/occlusion_tracker_unittest.cc ('k') | cc/overdraw_metrics.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_OVERDRAW_METRICS_H_ 5 #ifndef CC_OVERDRAW_METRICS_H_
6 #define CC_OVERDRAW_METRICS_H_ 6 #define CC_OVERDRAW_METRICS_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 9
10 namespace gfx { 10 namespace gfx {
11 class Rect; 11 class Rect;
12 } 12 class Transform;
13
14 namespace WebKit {
15 class WebTransformationMatrix;
16 } 13 }
17 14
18 namespace cc { 15 namespace cc {
19 class LayerTreeHost; 16 class LayerTreeHost;
20 class LayerTreeHostImpl; 17 class LayerTreeHostImpl;
21 18
22 // FIXME: compute overdraw metrics only occasionally, not every frame. 19 // FIXME: compute overdraw metrics only occasionally, not every frame.
23 class OverdrawMetrics { 20 class OverdrawMetrics {
24 public: 21 public:
25 static scoped_ptr<OverdrawMetrics> create(bool recordMetricsForFrame) { retu rn make_scoped_ptr(new OverdrawMetrics(recordMetricsForFrame)); } 22 static scoped_ptr<OverdrawMetrics> create(bool recordMetricsForFrame) { retu rn make_scoped_ptr(new OverdrawMetrics(recordMetricsForFrame)); }
26 23
27 // These methods are used for saving metrics during update/commit. 24 // These methods are used for saving metrics during update/commit.
28 25
29 // Record pixels painted by WebKit into the texture updater, but does not me an the pixels were rasterized in main memory. 26 // Record pixels painted by WebKit into the texture updater, but does not me an the pixels were rasterized in main memory.
30 void didPaint(const gfx::Rect& paintedRect); 27 void didPaint(const gfx::Rect& paintedRect);
31 // Records that an invalid tile was culled and did not need to be painted/up loaded, and did not contribute to other tiles needing to be painted. 28 // Records that an invalid tile was culled and did not need to be painted/up loaded, and did not contribute to other tiles needing to be painted.
32 void didCullTilesForUpload(int count); 29 void didCullTilesForUpload(int count);
33 // Records pixels that were uploaded to texture memory. 30 // Records pixels that were uploaded to texture memory.
34 void didUpload(const WebKit::WebTransformationMatrix& transformToTarget, con st gfx::Rect& uploadRect, const gfx::Rect& opaqueRect); 31 void didUpload(const gfx::Transform& transformToTarget, const gfx::Rect& upl oadRect, const gfx::Rect& opaqueRect);
35 // Record contents texture(s) behind present using the given number of bytes . 32 // Record contents texture(s) behind present using the given number of bytes .
36 void didUseContentsTextureMemoryBytes(size_t contentsTextureUseBytes); 33 void didUseContentsTextureMemoryBytes(size_t contentsTextureUseBytes);
37 // Record RenderSurfaceImpl texture(s) being present using the given number of bytes. 34 // Record RenderSurfaceImpl texture(s) being present using the given number of bytes.
38 void didUseRenderSurfaceTextureMemoryBytes(size_t renderSurfaceUseBytes); 35 void didUseRenderSurfaceTextureMemoryBytes(size_t renderSurfaceUseBytes);
39 36
40 // These methods are used for saving metrics during draw. 37 // These methods are used for saving metrics during draw.
41 38
42 // Record pixels that were not drawn to screen. 39 // Record pixels that were not drawn to screen.
43 void didCullForDrawing(const WebKit::WebTransformationMatrix& transformToTar get, const gfx::Rect& beforeCullRect, const gfx::Rect& afterCullRect); 40 void didCullForDrawing(const gfx::Transform& transformToTarget, const gfx::R ect& beforeCullRect, const gfx::Rect& afterCullRect);
44 // Record pixels that were drawn to screen. 41 // Record pixels that were drawn to screen.
45 void didDraw(const WebKit::WebTransformationMatrix& transformToTarget, const gfx::Rect& afterCullRect, const gfx::Rect& opaqueRect); 42 void didDraw(const gfx::Transform& transformToTarget, const gfx::Rect& after CullRect, const gfx::Rect& opaqueRect);
46 43
47 void recordMetrics(const LayerTreeHost*) const; 44 void recordMetrics(const LayerTreeHost*) const;
48 void recordMetrics(const LayerTreeHostImpl*) const; 45 void recordMetrics(const LayerTreeHostImpl*) const;
49 46
50 // Accessors for tests. 47 // Accessors for tests.
51 float pixelsDrawnOpaque() const { return m_pixelsDrawnOpaque; } 48 float pixelsDrawnOpaque() const { return m_pixelsDrawnOpaque; }
52 float pixelsDrawnTranslucent() const { return m_pixelsDrawnTranslucent; } 49 float pixelsDrawnTranslucent() const { return m_pixelsDrawnTranslucent; }
53 float pixelsCulledForDrawing() const { return m_pixelsCulledForDrawing; } 50 float pixelsCulledForDrawing() const { return m_pixelsCulledForDrawing; }
54 float pixelsPainted() const { return m_pixelsPainted; } 51 float pixelsPainted() const { return m_pixelsPainted; }
55 float pixelsUploadedOpaque() const { return m_pixelsUploadedOpaque; } 52 float pixelsUploadedOpaque() const { return m_pixelsUploadedOpaque; }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 float m_pixelsDrawnOpaque; 88 float m_pixelsDrawnOpaque;
92 // Count of pixels that are possibly translucent, and cannot occlude. 89 // Count of pixels that are possibly translucent, and cannot occlude.
93 float m_pixelsDrawnTranslucent; 90 float m_pixelsDrawnTranslucent;
94 // Count of pixels not drawn as they are occluded by somthing opaque. 91 // Count of pixels not drawn as they are occluded by somthing opaque.
95 float m_pixelsCulledForDrawing; 92 float m_pixelsCulledForDrawing;
96 }; 93 };
97 94
98 } // namespace cc 95 } // namespace cc
99 96
100 #endif // CC_OVERDRAW_METRICS_H_ 97 #endif // CC_OVERDRAW_METRICS_H_
OLDNEW
« no previous file with comments | « cc/occlusion_tracker_unittest.cc ('k') | cc/overdraw_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698