diff options
author | alexst@chromium.org <alexst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 22:11:59 +0000 |
---|---|---|
committer | alexst@chromium.org <alexst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 22:11:59 +0000 |
commit | f35d2445d7eb771a2ba0c66cfd13626d3e0468b3 (patch) | |
tree | 67ee5c663bb759cee674ed578999b8d377676c3f /cc | |
parent | bbd7c16fb1aae13e30eac0e9be4a3cebff8b884b (diff) | |
download | chromium_src-f35d2445d7eb771a2ba0c66cfd13626d3e0468b3.zip chromium_src-f35d2445d7eb771a2ba0c66cfd13626d3e0468b3.tar.gz chromium_src-f35d2445d7eb771a2ba0c66cfd13626d3e0468b3.tar.bz2 |
cc: Chromify rendering_stats
BUG=
TBR=jamesr@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12780025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/debug/rendering_stats.cc | 124 | ||||
-rw-r--r-- | cc/debug/rendering_stats.h | 81 | ||||
-rw-r--r-- | cc/resources/bitmap_content_layer_updater.cc | 2 | ||||
-rw-r--r-- | cc/resources/bitmap_skpicture_content_layer_updater.cc | 6 | ||||
-rw-r--r-- | cc/resources/content_layer_updater.cc | 4 | ||||
-rw-r--r-- | cc/resources/picture.cc | 4 | ||||
-rw-r--r-- | cc/resources/tile_manager.cc | 27 | ||||
-rw-r--r-- | cc/trees/layer_tree_host.cc | 5 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 14 | ||||
-rw-r--r-- | cc/trees/single_thread_proxy.cc | 4 | ||||
-rw-r--r-- | cc/trees/thread_proxy.cc | 4 |
11 files changed, 139 insertions, 136 deletions
diff --git a/cc/debug/rendering_stats.cc b/cc/debug/rendering_stats.cc index 28e7089..d0292c4 100644 --- a/cc/debug/rendering_stats.cc +++ b/cc/debug/rendering_stats.cc @@ -7,72 +7,74 @@ namespace cc { RenderingStats::RenderingStats() - : numAnimationFrames(0), - numFramesSentToScreen(0), - droppedFrameCount(0), - totalCommitCount(0), - totalPixelsPainted(0), - totalPixelsRasterized(0), - numImplThreadScrolls(0), - numMainThreadScrolls(0), - numLayersDrawn(0), - numMissingTiles(0), - totalDeferredImageDecodeCount(0), - totalDeferredImageCacheHitCount(0), - totalImageGatheringCount(0) { -} + : animation_frame_count(0), + screen_frame_count(0), + dropped_frame_count(0), + total_commit_count(0), + total_pixels_painted(0), + total_pixels_rasterized(0), + num_impl_thread_scrolls(0), + num_main_thread_scrolls(0), + num_layers_drawn(0), + num_missing_tiles(0), + total_deferred_image_decode_count(0), + total_deferred_image_cache_hit_count(0), + total_image_gathering_count(0) {} void RenderingStats::EnumerateFields(Enumerator* enumerator) const { - enumerator->AddInt64("numAnimationFrames", numAnimationFrames); - enumerator->AddInt64("numFramesSentToScreen", numFramesSentToScreen); - enumerator->AddInt64("droppedFrameCount", droppedFrameCount); - enumerator->AddDouble("totalPaintTimeInSeconds", - totalPaintTime.InSecondsF()); - enumerator->AddDouble("totalRasterizeTimeInSeconds", - totalRasterizeTime.InSecondsF()); - enumerator->AddDouble("totalRasterizeTimeForNowBinsOnPendingTree", - totalRasterizeTimeForNowBinsOnPendingTree.InSecondsF()); - enumerator->AddDouble("totalCommitTimeInSeconds", - totalCommitTime.InSecondsF()); - enumerator->AddInt64("totalCommitCount", totalCommitCount); - enumerator->AddInt64("totalPixelsPainted", totalPixelsPainted); - enumerator->AddInt64("totalPixelsRasterized", totalPixelsRasterized); - enumerator->AddInt64("numImplThreadScrolls", numImplThreadScrolls); - enumerator->AddInt64("numMainThreadScrolls", numMainThreadScrolls); - enumerator->AddInt64("numLayersDrawn", numLayersDrawn); - enumerator->AddInt64("numMissingTiles", numMissingTiles); - enumerator->AddInt64("totalDeferredImageDecodeCount", - totalDeferredImageDecodeCount); - enumerator->AddInt64("totalDeferredImageCacheHitCount", - totalDeferredImageCacheHitCount); - enumerator->AddInt64("totalImageGatheringCount", totalImageGatheringCount); - enumerator->AddDouble("totalDeferredImageDecodeTimeInSeconds", - totalDeferredImageDecodeTime.InSecondsF()); - enumerator->AddDouble("totalImageGatheringTimeInSeconds", - totalImageGatheringTime.InSecondsF()); + enumerator->AddInt64("animation_frame_count", animation_frame_count); + enumerator->AddInt64("screen_frame_count", screen_frame_count); + enumerator->AddInt64("dropped_frame_count", dropped_frame_count); + enumerator->AddDouble("total_paint_timeInSeconds", + total_paint_time.InSecondsF()); + enumerator->AddDouble("total_rasterize_timeInSeconds", + total_rasterize_time.InSecondsF()); + enumerator->AddDouble( + "total_rasterize_time_for_now_bins_on_pending_tree", + total_rasterize_time_for_now_bins_on_pending_tree.InSecondsF()); + enumerator->AddDouble("total_commit_timeInSeconds", + total_commit_time.InSecondsF()); + enumerator->AddInt64("total_commit_count", total_commit_count); + enumerator->AddInt64("total_pixels_painted", total_pixels_painted); + enumerator->AddInt64("total_pixels_rasterized", total_pixels_rasterized); + enumerator->AddInt64("num_impl_thread_scrolls", num_impl_thread_scrolls); + enumerator->AddInt64("num_main_thread_scrolls", num_main_thread_scrolls); + enumerator->AddInt64("num_layers_drawn", num_layers_drawn); + enumerator->AddInt64("num_missing_tiles", num_missing_tiles); + enumerator->AddInt64("total_deferred_image_decode_count", + total_deferred_image_decode_count); + enumerator->AddInt64("total_deferred_image_cache_hit_count", + total_deferred_image_cache_hit_count); + enumerator->AddInt64("total_image_gathering_count", + total_image_gathering_count); + enumerator->AddDouble("total_deferred_image_decode_timeInSeconds", + total_deferred_image_decode_time.InSecondsF()); + enumerator->AddDouble("total_image_gathering_timeInSeconds", + total_image_gathering_time.InSecondsF()); } void RenderingStats::Add(const RenderingStats& other) { - numAnimationFrames += other.numAnimationFrames; - numFramesSentToScreen += other.numFramesSentToScreen; - droppedFrameCount += other.droppedFrameCount; - totalPaintTime += other.totalPaintTime; - totalRasterizeTime += other.totalRasterizeTime; - totalRasterizeTimeForNowBinsOnPendingTree += - other.totalRasterizeTimeForNowBinsOnPendingTree; - totalCommitTime += other.totalCommitTime; - totalCommitCount += other.totalCommitCount; - totalPixelsPainted += other.totalPixelsPainted; - totalPixelsRasterized += other.totalPixelsRasterized; - numImplThreadScrolls += other.numImplThreadScrolls; - numMainThreadScrolls += other.numMainThreadScrolls; - numLayersDrawn += other.numLayersDrawn; - numMissingTiles += other.numMissingTiles; - totalDeferredImageDecodeCount += other.totalDeferredImageDecodeCount; - totalDeferredImageCacheHitCount += other.totalDeferredImageCacheHitCount; - totalImageGatheringCount += other.totalImageGatheringCount; - totalDeferredImageDecodeTime += other.totalDeferredImageDecodeTime; - totalImageGatheringTime += other.totalImageGatheringTime; + animation_frame_count += other.animation_frame_count; + screen_frame_count += other.screen_frame_count; + dropped_frame_count += other.dropped_frame_count; + total_paint_time += other.total_paint_time; + total_rasterize_time += other.total_rasterize_time; + total_rasterize_time_for_now_bins_on_pending_tree += + other.total_rasterize_time_for_now_bins_on_pending_tree; + total_commit_time += other.total_commit_time; + total_commit_count += other.total_commit_count; + total_pixels_painted += other.total_pixels_painted; + total_pixels_rasterized += other.total_pixels_rasterized; + num_impl_thread_scrolls += other.num_impl_thread_scrolls; + num_main_thread_scrolls += other.num_main_thread_scrolls; + num_layers_drawn += other.num_layers_drawn; + num_missing_tiles += other.num_missing_tiles; + total_deferred_image_decode_count += other.total_deferred_image_decode_count; + total_deferred_image_cache_hit_count += + other.total_deferred_image_cache_hit_count; + total_image_gathering_count += other.total_image_gathering_count; + total_deferred_image_decode_time += other.total_deferred_image_decode_time; + total_image_gathering_time += other.total_image_gathering_time; } } // namespace cc diff --git a/cc/debug/rendering_stats.h b/cc/debug/rendering_stats.h index 799bd88..33ea2c6 100644 --- a/cc/debug/rendering_stats.h +++ b/cc/debug/rendering_stats.h @@ -12,52 +12,51 @@ namespace cc { struct CC_EXPORT RenderingStats { - // FIXME: Rename these to animationFrameCount and screenFrameCount, crbug.com/138641. - int64 numAnimationFrames; - int64 numFramesSentToScreen; - int64 droppedFrameCount; - base::TimeDelta totalPaintTime; - base::TimeDelta totalRasterizeTime; - base::TimeDelta totalRasterizeTimeForNowBinsOnPendingTree; - base::TimeDelta totalCommitTime; - int64 totalCommitCount; - int64 totalPixelsPainted; - int64 totalPixelsRasterized; - int64 numImplThreadScrolls; - int64 numMainThreadScrolls; - int64 numLayersDrawn; - int64 numMissingTiles; - int64 totalDeferredImageDecodeCount; - int64 totalDeferredImageCacheHitCount; - int64 totalImageGatheringCount; - base::TimeDelta totalDeferredImageDecodeTime; - base::TimeDelta totalImageGatheringTime; - // Note: when adding new members, please remember to update EnumerateFields - // and Add in rendering_stats.cc. + int64 animation_frame_count; + int64 screen_frame_count; + int64 dropped_frame_count; + base::TimeDelta total_paint_time; + base::TimeDelta total_rasterize_time; + base::TimeDelta total_rasterize_time_for_now_bins_on_pending_tree; + base::TimeDelta total_commit_time; + int64 total_commit_count; + int64 total_pixels_painted; + int64 total_pixels_rasterized; + int64 num_impl_thread_scrolls; + int64 num_main_thread_scrolls; + int64 num_layers_drawn; + int64 num_missing_tiles; + int64 total_deferred_image_decode_count; + int64 total_deferred_image_cache_hit_count; + int64 total_image_gathering_count; + base::TimeDelta total_deferred_image_decode_time; + base::TimeDelta total_image_gathering_time; + // Note: when adding new members, please remember to update EnumerateFields + // and Add in rendering_stats.cc. - RenderingStats(); + RenderingStats(); - // In conjunction with enumerateFields, this allows the embedder to - // enumerate the values in this structure without - // having to embed references to its specific member variables. This - // simplifies the addition of new fields to this type. - class Enumerator { - public: - virtual void AddInt64(const char* name, int64 value) = 0; - virtual void AddDouble(const char* name, double value) = 0; - virtual void AddInt(const char* name, int value) = 0; - virtual void AddTimeDeltaInSecondsF(const char* name, - const base::TimeDelta& value) = 0; + // In conjunction with enumerateFields, this allows the embedder to + // enumerate the values in this structure without + // having to embed references to its specific member variables. This + // simplifies the addition of new fields to this type. + class Enumerator { + public: + virtual void AddInt64(const char* name, int64 value) = 0; + virtual void AddDouble(const char* name, double value) = 0; + virtual void AddInt(const char* name, int value) = 0; + virtual void AddTimeDeltaInSecondsF(const char* name, + const base::TimeDelta& value) = 0; - protected: - virtual ~Enumerator() { } - }; + protected: + virtual ~Enumerator() {} + }; - // Outputs the fields in this structure to the provided enumerator. - void EnumerateFields(Enumerator* enumerator) const; + // Outputs the fields in this structure to the provided enumerator. + void EnumerateFields(Enumerator* enumerator) const; - // Add fields of |other| to the fields in this structure. - void Add(const RenderingStats& other); + // Add fields of |other| to the fields in this structure. + void Add(const RenderingStats& other); }; } // namespace cc diff --git a/cc/resources/bitmap_content_layer_updater.cc b/cc/resources/bitmap_content_layer_updater.cc index 8a65e9e..fa483b7 100644 --- a/cc/resources/bitmap_content_layer_updater.cc +++ b/cc/resources/bitmap_content_layer_updater.cc @@ -60,7 +60,7 @@ void BitmapContentLayerUpdater::PrepareToUpdate( } if (stats) { - stats->totalPixelsRasterized += + stats->total_pixels_rasterized += content_rect.width() * content_rect.height(); } diff --git a/cc/resources/bitmap_skpicture_content_layer_updater.cc b/cc/resources/bitmap_skpicture_content_layer_updater.cc index e2fdc04..a75c89a 100644 --- a/cc/resources/bitmap_skpicture_content_layer_updater.cc +++ b/cc/resources/bitmap_skpicture_content_layer_updater.cc @@ -36,7 +36,7 @@ void BitmapSkPictureContentLayerUpdater::Resource::Update( paint_begin_time = base::TimeTicks::Now(); updater_->PaintContentsRect(&canvas, source_rect, stats); if (stats) - stats->totalPaintTime += base::TimeTicks::Now() - paint_begin_time; + stats->total_paint_time += base::TimeTicks::Now() - paint_begin_time; ResourceUpdate upload = ResourceUpdate::Create( texture(), &bitmap_, source_rect, source_rect, dest_offset); @@ -77,8 +77,8 @@ void BitmapSkPictureContentLayerUpdater::PaintContentsRect( rasterize_begin_time = base::TimeTicks::Now(); DrawPicture(canvas); if (stats) { - stats->totalRasterizeTime += base::TimeTicks::Now() - rasterize_begin_time; - stats->totalPixelsRasterized += source_rect.width() * source_rect.height(); + stats->total_rasterize_time += base::TimeTicks::Now() - rasterize_begin_time; + stats->total_pixels_rasterized += source_rect.width() * source_rect.height(); } } diff --git a/cc/resources/content_layer_updater.cc b/cc/resources/content_layer_updater.cc index b4eb1d2..4865a49 100644 --- a/cc/resources/content_layer_updater.cc +++ b/cc/resources/content_layer_updater.cc @@ -58,8 +58,8 @@ void ContentLayerUpdater::PaintContents(SkCanvas* canvas, paint_begin_time = base::TimeTicks::Now(); painter_->Paint(canvas, layer_rect, &opaque_layer_rect); if (stats) { - stats->totalPaintTime += base::TimeTicks::Now() - paint_begin_time; - stats->totalPixelsPainted += content_rect.width() * content_rect.height(); + stats->total_paint_time += base::TimeTicks::Now() - paint_begin_time; + stats->total_pixels_painted += content_rect.width() * content_rect.height(); } canvas->restore(); diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc index a343237..ccab893 100644 --- a/cc/resources/picture.cc +++ b/cc/resources/picture.cc @@ -102,8 +102,8 @@ void Picture::Record(ContentLayerClient* painter, begin_paint_time = base::TimeTicks::Now(); painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect); if (stats) { - stats->totalPaintTime += base::TimeTicks::Now() - begin_paint_time; - stats->totalPixelsPainted += + stats->total_paint_time += base::TimeTicks::Now() - begin_paint_time; + stats->total_pixels_painted += layer_rect_.width() * layer_rect_.height(); } diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc index 61e112b..88b7c84 100644 --- a/cc/resources/tile_manager.cc +++ b/cc/resources/tile_manager.cc @@ -505,11 +505,12 @@ void TileManager::SetRecordRenderingStats(bool record_rendering_stats) { void TileManager::GetRenderingStats(RenderingStats* stats) { CHECK(record_rendering_stats_); raster_worker_pool_->GetRenderingStats(stats); - stats->totalDeferredImageCacheHitCount = - rendering_stats_.totalDeferredImageCacheHitCount; - stats->totalImageGatheringCount = rendering_stats_.totalImageGatheringCount; - stats->totalImageGatheringTime = - rendering_stats_.totalImageGatheringTime; + stats->total_deferred_image_cache_hit_count = + rendering_stats_.total_deferred_image_cache_hit_count; + stats->total_image_gathering_count = + rendering_stats_.total_image_gathering_count; + stats->total_image_gathering_time = + rendering_stats_.total_image_gathering_time; } bool TileManager::HasPendingWorkScheduled(WhichTree tree) const { @@ -747,8 +748,8 @@ void TileManager::GatherPixelRefsForTile(Tile* tile) { managed_tile_state.pending_pixel_refs); managed_tile_state.need_to_gather_pixel_refs = false; if (record_rendering_stats_) { - rendering_stats_.totalImageGatheringCount++; - rendering_stats_.totalImageGatheringTime += + rendering_stats_.total_image_gathering_count++; + rendering_stats_.total_image_gathering_time += base::TimeTicks::HighResNow() - gather_begin_time; } } @@ -767,7 +768,7 @@ void TileManager::DispatchImageDecodeTasksForTile(Tile* tile) { } // TODO(qinmin): passing correct image size to PrepareToDecode(). if ((*it)->PrepareToDecode(skia::LazyPixelRef::PrepareParams())) { - rendering_stats_.totalDeferredImageCacheHitCount++; + rendering_stats_.total_deferred_image_cache_hit_count++; pending_pixel_refs.erase(it++); } else { if (pending_tasks_ >= max_pending_tasks_) @@ -1004,13 +1005,13 @@ void TileManager::RunRasterTask(uint8* buffer, &total_pixels_rasterized); if (stats) { - stats->totalPixelsRasterized += total_pixels_rasterized; + stats->total_pixels_rasterized += total_pixels_rasterized; base::TimeTicks end_time = base::TimeTicks::HighResNow(); base::TimeDelta duration = end_time - begin_time; - stats->totalRasterizeTime += duration; + stats->total_rasterize_time += duration; if (metadata.is_tile_in_pending_tree_now_bin) - stats->totalRasterizeTimeForNowBinsOnPendingTree += duration; + stats->total_rasterize_time_for_now_bins_on_pending_tree += duration; UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.PictureRasterTimeMS", duration.InMilliseconds(), @@ -1111,8 +1112,8 @@ void TileManager::RunImageDecodeTask(skia::LazyPixelRef* pixel_ref, decode_begin_time = base::TimeTicks::HighResNow(); pixel_ref->Decode(); if (stats) { - stats->totalDeferredImageDecodeCount++; - stats->totalDeferredImageDecodeTime += + stats->total_deferred_image_decode_count++; + stats->total_deferred_image_decode_time += base::TimeTicks::HighResNow() - decode_begin_time; } } diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 769bac8..4d6727f 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -230,7 +230,7 @@ void LayerTreeHost::UpdateAnimations(base::TimeTicks frame_begin_time) { AnimateLayers(frame_begin_time); animating_ = false; - rendering_stats_.numAnimationFrames++; + rendering_stats_.animation_frame_count++; } void LayerTreeHost::DidStopFlinging() { @@ -346,7 +346,8 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { } if (debug_state_.continuous_painting) - host_impl->SavePaintTime(rendering_stats_.totalPaintTime, commit_number()); + host_impl->SavePaintTime(rendering_stats_.total_paint_time, + commit_number()); commit_number_++; } diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 216f6ce..443e3d7 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1177,7 +1177,7 @@ void LayerTreeHostImpl::ActivatePendingTree() { RenderingStats stats; tile_manager_->GetRenderingStats(&stats); paint_time_counter_->SaveRasterizeTime( - stats.totalRasterizeTimeForNowBinsOnPendingTree, + stats.total_rasterize_time_for_now_bins_on_pending_tree, active_tree_->source_frame_number()); } } @@ -1796,12 +1796,12 @@ int LayerTreeHostImpl::SourceAnimationFrameNumber() const { } void LayerTreeHostImpl::CollectRenderingStats(RenderingStats* stats) const { - stats->numFramesSentToScreen = fps_counter_->current_frame_number(); - stats->droppedFrameCount = fps_counter_->dropped_frame_count(); - stats->numImplThreadScrolls = num_impl_thread_scrolls_; - stats->numMainThreadScrolls = num_main_thread_scrolls_; - stats->numLayersDrawn = cumulative_num_layers_drawn_; - stats->numMissingTiles = cumulative_num_missing_tiles_; + stats->screen_frame_count = fps_counter_->current_frame_number(); + stats->dropped_frame_count = fps_counter_->dropped_frame_count(); + stats->num_impl_thread_scrolls = num_impl_thread_scrolls_; + stats->num_main_thread_scrolls = num_main_thread_scrolls_; + stats->num_layers_drawn = cumulative_num_layers_drawn_; + stats->num_missing_tiles = cumulative_num_missing_tiles_; if (tile_manager_) tile_manager_->GetRenderingStats(stats); diff --git a/cc/trees/single_thread_proxy.cc b/cc/trees/single_thread_proxy.cc index 8dbf352..c615d2d 100644 --- a/cc/trees/single_thread_proxy.cc +++ b/cc/trees/single_thread_proxy.cc @@ -172,8 +172,8 @@ bool SingleThreadProxy::RecreateOutputSurface() { } void SingleThreadProxy::CollectRenderingStats(RenderingStats* stats) { - stats->totalCommitTime = total_commit_time_; - stats->totalCommitCount = total_commit_count_; + stats->total_commit_time = total_commit_time_; + stats->total_commit_count = total_commit_count_; layer_tree_host_impl_->CollectRenderingStats(stats); } diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc index 0974592..22ee71c6 100644 --- a/cc/trees/thread_proxy.cc +++ b/cc/trees/thread_proxy.cc @@ -288,8 +288,8 @@ void ThreadProxy::CollectRenderingStats(RenderingStats* stats) { impl_thread_weak_ptr_, &completion, stats)); - stats->totalCommitTime = total_commit_time_; - stats->totalCommitCount = total_commit_count_; + stats->total_commit_time = total_commit_time_; + stats->total_commit_count = total_commit_count_; completion.Wait(); } |