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

Side by Side Diff: cc/debug/overdraw_metrics.cc

Issue 12912010: cc: Convert non-const reference arguments to pointers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ui/compositor Created 7 years, 9 months 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/base/scoped_ptr_algorithm.h ('k') | cc/layers/picture_layer.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 #include "cc/debug/overdraw_metrics.h" 5 #include "cc/debug/overdraw_metrics.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/trees/layer_tree_host.h" 10 #include "cc/trees/layer_tree_host.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 // Takes a given quad, maps it by the given transformation, and gives the area 45 // Takes a given quad, maps it by the given transformation, and gives the area
46 // of the resulting polygon. 46 // of the resulting polygon.
47 static inline float AreaOfMappedQuad(const gfx::Transform& transform, 47 static inline float AreaOfMappedQuad(const gfx::Transform& transform,
48 const gfx::QuadF& quad) { 48 const gfx::QuadF& quad) {
49 gfx::PointF clipped_quad[8]; 49 gfx::PointF clipped_quad[8];
50 int num_vertices_in_clipped_quad = 0; 50 int num_vertices_in_clipped_quad = 0;
51 MathUtil::MapClippedQuad(transform, 51 MathUtil::MapClippedQuad(transform,
52 quad, 52 quad,
53 clipped_quad, 53 clipped_quad,
54 num_vertices_in_clipped_quad); 54 &num_vertices_in_clipped_quad);
55 return PolygonArea(clipped_quad, num_vertices_in_clipped_quad); 55 return PolygonArea(clipped_quad, num_vertices_in_clipped_quad);
56 } 56 }
57 57
58 void OverdrawMetrics::DidPaint(gfx::Rect painted_rect) { 58 void OverdrawMetrics::DidPaint(gfx::Rect painted_rect) {
59 if (!record_metrics_for_frame_) 59 if (!record_metrics_for_frame_)
60 return; 60 return;
61 61
62 pixels_painted_ += 62 pixels_painted_ +=
63 static_cast<float>(painted_rect.width()) * painted_rect.height(); 63 static_cast<float>(painted_rect.width()) * painted_rect.height();
64 } 64 }
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 contents_texture_use_bytes_, 258 contents_texture_use_bytes_,
259 "RenderSurfaceTextureBytes", 259 "RenderSurfaceTextureBytes",
260 render_surface_texture_use_bytes_); 260 render_surface_texture_use_bytes_);
261 } 261 }
262 break; 262 break;
263 } 263 }
264 } 264 }
265 } 265 }
266 266
267 } // namespace cc 267 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/scoped_ptr_algorithm.h ('k') | cc/layers/picture_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698