OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |