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

Side by Side Diff: cc/resources/picture.cc

Issue 12780025: cc: Chromify rendering_stats (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « cc/resources/content_layer_updater.cc ('k') | cc/trees/layer_tree_host.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 "base/debug/trace_event.h" 5 #include "base/debug/trace_event.h"
6 #include "cc/debug/rendering_stats.h" 6 #include "cc/debug/rendering_stats.h"
7 #include "cc/layers/content_layer_client.h" 7 #include "cc/layers/content_layer_client.h"
8 #include "cc/resources/picture.h" 8 #include "cc/resources/picture.h"
9 #include "skia/ext/analysis_canvas.h" 9 #include "skia/ext/analysis_canvas.h"
10 #include "third_party/skia/include/core/SkCanvas.h" 10 #include "third_party/skia/include/core/SkCanvas.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 layer_rect_.height()); 95 layer_rect_.height());
96 canvas->clipRect(layer_skrect); 96 canvas->clipRect(layer_skrect);
97 canvas->drawRect(layer_skrect, paint); 97 canvas->drawRect(layer_skrect, paint);
98 98
99 gfx::RectF opaque_layer_rect; 99 gfx::RectF opaque_layer_rect;
100 base::TimeTicks begin_paint_time; 100 base::TimeTicks begin_paint_time;
101 if (stats) 101 if (stats)
102 begin_paint_time = base::TimeTicks::Now(); 102 begin_paint_time = base::TimeTicks::Now();
103 painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect); 103 painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect);
104 if (stats) { 104 if (stats) {
105 stats->totalPaintTime += base::TimeTicks::Now() - begin_paint_time; 105 stats->total_paint_time += base::TimeTicks::Now() - begin_paint_time;
106 stats->totalPixelsPainted += 106 stats->total_pixels_painted +=
107 layer_rect_.width() * layer_rect_.height(); 107 layer_rect_.width() * layer_rect_.height();
108 } 108 }
109 109
110 canvas->restore(); 110 canvas->restore();
111 picture_->endRecording(); 111 picture_->endRecording();
112 112
113 opaque_rect_ = gfx::ToEnclosedRect(opaque_layer_rect); 113 opaque_rect_ = gfx::ToEnclosedRect(opaque_layer_rect);
114 } 114 }
115 115
116 void Picture::Raster( 116 void Picture::Raster(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 if (*refs && (*refs)->getURI() && !strncmp( 152 if (*refs && (*refs)->getURI() && !strncmp(
153 (*refs)->getURI(), labelLazyDecoded, 4)) { 153 (*refs)->getURI(), labelLazyDecoded, 4)) {
154 pixel_ref_list.push_back(static_cast<skia::LazyPixelRef*>(*refs)); 154 pixel_ref_list.push_back(static_cast<skia::LazyPixelRef*>(*refs));
155 } 155 }
156 refs++; 156 refs++;
157 } 157 }
158 pixel_refs->unref(); 158 pixel_refs->unref();
159 } 159 }
160 160
161 } // namespace cc 161 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/content_layer_updater.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698