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/tile_manager.h" | 5 #include "cc/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" |
11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/metrics/histogram.h" | |
13 #include "cc/platform_color.h" | 14 #include "cc/platform_color.h" |
14 #include "cc/raster_worker_pool.h" | 15 #include "cc/raster_worker_pool.h" |
15 #include "cc/resource_pool.h" | 16 #include "cc/resource_pool.h" |
16 #include "cc/tile.h" | 17 #include "cc/tile.h" |
17 #include "third_party/skia/include/core/SkDevice.h" | 18 #include "third_party/skia/include/core/SkDevice.h" |
18 | 19 |
19 namespace cc { | 20 namespace cc { |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
755 PicturePileImpl* picture_pile, | 756 PicturePileImpl* picture_pile, |
756 RenderingStats* stats) { | 757 RenderingStats* stats) { |
757 TRACE_EVENT0("cc", "TileManager::RunRasterTask"); | 758 TRACE_EVENT0("cc", "TileManager::RunRasterTask"); |
758 DCHECK(picture_pile); | 759 DCHECK(picture_pile); |
759 DCHECK(buffer); | 760 DCHECK(buffer); |
760 SkBitmap bitmap; | 761 SkBitmap bitmap; |
761 bitmap.setConfig(SkBitmap::kARGB_8888_Config, rect.width(), rect.height()); | 762 bitmap.setConfig(SkBitmap::kARGB_8888_Config, rect.width(), rect.height()); |
762 bitmap.setPixels(buffer); | 763 bitmap.setPixels(buffer); |
763 SkDevice device(bitmap); | 764 SkDevice device(bitmap); |
764 SkCanvas canvas(&device); | 765 SkCanvas canvas(&device); |
766 | |
767 base::TimeTicks rasterize_begin_time; | |
768 if (stats) | |
769 rasterize_begin_time = base::TimeTicks::HighResNow(); | |
danakj
2013/02/04 18:33:19
This changed from Now to HighResNow? The ImageDeco
| |
770 | |
765 picture_pile->Raster(&canvas, rect, contents_scale, stats); | 771 picture_pile->Raster(&canvas, rect, contents_scale, stats); |
772 | |
773 if (stats) { | |
774 base::TimeTicks rasterize_end_time = base::TimeTicks::HighResNow(); | |
775 base::TimeDelta rasterize_duration = rasterize_end_time - rasterize_begin_ti me; | |
danakj
2013/02/04 18:33:19
80 col. if you drop the "rasterize_" prefix on the
| |
776 stats->totalRasterizeTime += rasterize_duration; | |
777 UMA_HISTOGRAM_CUSTOM_COUNTS( | |
778 "Renderer4.PictureRasterTimeMS", | |
779 rasterize_duration.InMilliseconds(), | |
780 0, 10, 10 | |
781 ); | |
782 } | |
766 } | 783 } |
767 | 784 |
768 // static | 785 // static |
769 void TileManager::RunImageDecodeTask(skia::LazyPixelRef* pixel_ref, | 786 void TileManager::RunImageDecodeTask(skia::LazyPixelRef* pixel_ref, |
770 RenderingStats* stats) { | 787 RenderingStats* stats) { |
771 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); | 788 TRACE_EVENT0("cc", "TileManager::RunImageDecodeTask"); |
772 base::TimeTicks decode_begin_time; | 789 base::TimeTicks decode_begin_time; |
773 if (stats) | 790 if (stats) |
774 decode_begin_time = base::TimeTicks::Now(); | 791 decode_begin_time = base::TimeTicks::Now(); |
775 pixel_ref->Decode(); | 792 pixel_ref->Decode(); |
776 if (stats) { | 793 if (stats) { |
777 stats->totalDeferredImageDecodeCount++; | 794 stats->totalDeferredImageDecodeCount++; |
778 stats->totalDeferredImageDecodeTime += | 795 stats->totalDeferredImageDecodeTime += |
779 base::TimeTicks::Now() - decode_begin_time; | 796 base::TimeTicks::Now() - decode_begin_time; |
780 } | 797 } |
781 } | 798 } |
782 | 799 |
783 } // namespace cc | 800 } // namespace cc |
OLD | NEW |