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

Side by Side Diff: cc/tile_manager.cc

Issue 12191006: Add picture pile raster times histogram (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed HighResNow to Now Created 7 years, 10 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/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/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
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 begin_time;
768 if (stats)
769 begin_time = base::TimeTicks::Now();
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 end_time = base::TimeTicks::Now();
775 base::TimeDelta duration = end_time - begin_time;
danakj 2013/02/04 18:56:24 nit: i think i'd drop the "duration" variable, I d
776 stats->totalRasterizeTime += duration;
777 UMA_HISTOGRAM_CUSTOM_COUNTS(
778 "Renderer4.PictureRasterTimeMS",
779 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
OLDNEW
« no previous file with comments | « cc/picture_pile_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698