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

Side by Side Diff: cc/resources/bitmap_skpicture_content_layer_updater.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/bitmap_content_layer_updater.cc ('k') | cc/resources/content_layer_updater.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/resources/bitmap_skpicture_content_layer_updater.h" 5 #include "cc/resources/bitmap_skpicture_content_layer_updater.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "cc/debug/rendering_stats.h" 8 #include "cc/debug/rendering_stats.h"
9 #include "cc/resources/layer_painter.h" 9 #include "cc/resources/layer_painter.h"
10 #include "cc/resources/prioritized_resource.h" 10 #include "cc/resources/prioritized_resource.h"
(...skipping 18 matching lines...) Expand all
29 SkBitmap::kARGB_8888_Config, source_rect.width(), source_rect.height()); 29 SkBitmap::kARGB_8888_Config, source_rect.width(), source_rect.height());
30 bitmap_.allocPixels(); 30 bitmap_.allocPixels();
31 bitmap_.setIsOpaque(updater_->layer_is_opaque()); 31 bitmap_.setIsOpaque(updater_->layer_is_opaque());
32 SkDevice device(bitmap_); 32 SkDevice device(bitmap_);
33 SkCanvas canvas(&device); 33 SkCanvas canvas(&device);
34 base::TimeTicks paint_begin_time; 34 base::TimeTicks paint_begin_time;
35 if (stats) 35 if (stats)
36 paint_begin_time = base::TimeTicks::Now(); 36 paint_begin_time = base::TimeTicks::Now();
37 updater_->PaintContentsRect(&canvas, source_rect, stats); 37 updater_->PaintContentsRect(&canvas, source_rect, stats);
38 if (stats) 38 if (stats)
39 stats->totalPaintTime += base::TimeTicks::Now() - paint_begin_time; 39 stats->total_paint_time += base::TimeTicks::Now() - paint_begin_time;
40 40
41 ResourceUpdate upload = ResourceUpdate::Create( 41 ResourceUpdate upload = ResourceUpdate::Create(
42 texture(), &bitmap_, source_rect, source_rect, dest_offset); 42 texture(), &bitmap_, source_rect, source_rect, dest_offset);
43 if (partial_update) 43 if (partial_update)
44 queue->AppendPartialUpload(upload); 44 queue->AppendPartialUpload(upload);
45 else 45 else
46 queue->AppendFullUpload(upload); 46 queue->AppendFullUpload(upload);
47 } 47 }
48 48
49 scoped_refptr<BitmapSkPictureContentLayerUpdater> 49 scoped_refptr<BitmapSkPictureContentLayerUpdater>
(...skipping 20 matching lines...) Expand all
70 gfx::Rect source_rect, 70 gfx::Rect source_rect,
71 RenderingStats* stats) { 71 RenderingStats* stats) {
72 // Translate the origin of content_rect to that of source_rect. 72 // Translate the origin of content_rect to that of source_rect.
73 canvas->translate(content_rect().x() - source_rect.x(), 73 canvas->translate(content_rect().x() - source_rect.x(),
74 content_rect().y() - source_rect.y()); 74 content_rect().y() - source_rect.y());
75 base::TimeTicks rasterize_begin_time; 75 base::TimeTicks rasterize_begin_time;
76 if (stats) 76 if (stats)
77 rasterize_begin_time = base::TimeTicks::Now(); 77 rasterize_begin_time = base::TimeTicks::Now();
78 DrawPicture(canvas); 78 DrawPicture(canvas);
79 if (stats) { 79 if (stats) {
80 stats->totalRasterizeTime += base::TimeTicks::Now() - rasterize_begin_time; 80 stats->total_rasterize_time +=
81 stats->totalPixelsRasterized += source_rect.width() * source_rect.height(); 81 base::TimeTicks::Now() - rasterize_begin_time;
82 stats->total_pixels_rasterized +=
83 source_rect.width() * source_rect.height();
82 } 84 }
83 } 85 }
84 86
85 } // namespace cc 87 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/bitmap_content_layer_updater.cc ('k') | cc/resources/content_layer_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698