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

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

Issue 12457031: cc: Changed total_pixels_rasterized to be a return value (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/resources/picture_pile_impl.cc ('k') | no next file » | 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/resources/tile_manager.h" 5 #include "cc/resources/tile_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 DCHECK(buffer); 977 DCHECK(buffer);
978 978
979 SkBitmap bitmap; 979 SkBitmap bitmap;
980 bitmap.setConfig(SkBitmap::kARGB_8888_Config, rect.width(), rect.height()); 980 bitmap.setConfig(SkBitmap::kARGB_8888_Config, rect.width(), rect.height());
981 bitmap.setPixels(buffer); 981 bitmap.setPixels(buffer);
982 SkDevice device(bitmap); 982 SkDevice device(bitmap);
983 SkCanvas canvas(&device); 983 SkCanvas canvas(&device);
984 984
985 base::TimeTicks start_time = stats_instrumentation->StartRecording(); 985 base::TimeTicks start_time = stats_instrumentation->StartRecording();
986 986
987 int64 total_pixels_rasterized = 0; 987 int64 total_pixels_rasterized =
988 picture_pile->Raster(&canvas, rect, contents_scale, 988 picture_pile->Raster(&canvas, rect, contents_scale);
989 &total_pixels_rasterized);
990 989
991 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); 990 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time);
992 991
993 if (stats_instrumentation->record_rendering_stats()) { 992 if (stats_instrumentation->record_rendering_stats()) {
994 stats_instrumentation->AddRaster(duration, 993 stats_instrumentation->AddRaster(duration,
995 total_pixels_rasterized, 994 total_pixels_rasterized,
996 metadata.is_tile_in_pending_tree_now_bin); 995 metadata.is_tile_in_pending_tree_now_bin);
997 996
998 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.PictureRasterTimeMS", 997 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.PictureRasterTimeMS",
999 duration.InMilliseconds(), 998 duration.InMilliseconds(),
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1090 skia::LazyPixelRef* pixel_ref, 1089 skia::LazyPixelRef* pixel_ref,
1091 RenderingStatsInstrumentation* stats_instrumentation) { 1090 RenderingStatsInstrumentation* stats_instrumentation) {
1092 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); 1091 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask");
1093 base::TimeTicks start_time = stats_instrumentation->StartRecording(); 1092 base::TimeTicks start_time = stats_instrumentation->StartRecording();
1094 pixel_ref->Decode(); 1093 pixel_ref->Decode();
1095 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); 1094 base::TimeDelta duration = stats_instrumentation->EndRecording(start_time);
1096 stats_instrumentation->AddDeferredImageDecode(duration); 1095 stats_instrumentation->AddDeferredImageDecode(duration);
1097 } 1096 }
1098 1097
1099 } // namespace cc 1098 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_pile_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698