diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-19 02:09:15 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-19 02:09:15 +0000 |
commit | be62465ee01dffe0e9d91190ff7be5e5bf92808a (patch) | |
tree | 358fcf256dc5e56f8a551e8c407aa2dc761f2877 /cc/resources | |
parent | 0867730119d70f5adef8de1c20e2a485dca2e9a0 (diff) | |
download | chromium_src-be62465ee01dffe0e9d91190ff7be5e5bf92808a.zip chromium_src-be62465ee01dffe0e9d91190ff7be5e5bf92808a.tar.gz chromium_src-be62465ee01dffe0e9d91190ff7be5e5bf92808a.tar.bz2 |
cc: add picture id to Picture::Record
This allows you to easily click on an expensive record in frame viewer,
click on the picture id link, and then investigate the skia commands for
that picture.
R=ernstm@chromium.org, nduca@chromium.org
BUG=261476
Review URL: https://chromiumcodereview.appspot.com/19771008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212504 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources')
-rw-r--r-- | cc/resources/picture.cc | 18 | ||||
-rw-r--r-- | cc/resources/picture.h | 4 |
2 files changed, 17 insertions, 5 deletions
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc index a21db75..8c5d851 100644 --- a/cc/resources/picture.cc +++ b/cc/resources/picture.cc @@ -185,10 +185,9 @@ void Picture::CloneForDrawing(int num_threads) { void Picture::Record(ContentLayerClient* painter, const SkTileGridPicture::TileGridInfo& tile_grid_info, RenderingStatsInstrumentation* stats_instrumentation) { - TRACE_EVENT2(benchmark_instrumentation::kCategory, + TRACE_EVENT1(benchmark_instrumentation::kCategory, benchmark_instrumentation::kPictureRecord, - benchmark_instrumentation::kWidth, layer_rect_.width(), - benchmark_instrumentation::kHeight, layer_rect_.height()); + benchmark_instrumentation::kData, AsTraceableRecordData()); DCHECK(!tile_grid_info.fTileInterval.isEmpty()); picture_ = skia::AdoptRef(new SkTileGridPicture( @@ -448,7 +447,7 @@ Picture::PixelRefIterator& Picture::PixelRefIterator::operator++() { } scoped_ptr<base::debug::ConvertableToTraceFormat> - Picture::AsTraceableRasterData(gfx::Rect rect, float scale) { + Picture::AsTraceableRasterData(gfx::Rect rect, float scale) const { scoped_ptr<base::DictionaryValue> raster_data(new base::DictionaryValue()); raster_data->Set("picture_id", TracedValue::CreateIDRef(this).release()); raster_data->SetDouble("scale", scale); @@ -459,4 +458,15 @@ scoped_ptr<base::debug::ConvertableToTraceFormat> return TracedValue::FromValue(raster_data.release()); } +scoped_ptr<base::debug::ConvertableToTraceFormat> + Picture::AsTraceableRecordData() const { + scoped_ptr<base::DictionaryValue> record_data(new base::DictionaryValue()); + record_data->Set("picture_id", TracedValue::CreateIDRef(this).release()); + record_data->SetInteger(benchmark_instrumentation::kWidth, + layer_rect_.width()); + record_data->SetInteger(benchmark_instrumentation::kHeight, + layer_rect_.height()); + return TracedValue::FromValue(record_data.release()); +} + } // namespace cc diff --git a/cc/resources/picture.h b/cc/resources/picture.h index 1ee813c..15a6c9d 100644 --- a/cc/resources/picture.h +++ b/cc/resources/picture.h @@ -143,7 +143,9 @@ class CC_EXPORT Picture gfx::Size cell_size_; scoped_ptr<base::debug::ConvertableToTraceFormat> - AsTraceableRasterData(gfx::Rect rect, float scale); + AsTraceableRasterData(gfx::Rect rect, float scale) const; + scoped_ptr<base::debug::ConvertableToTraceFormat> + AsTraceableRecordData() const; friend class base::RefCountedThreadSafe<Picture>; friend class PixelRefIterator; |