Index: cc/resources/picture_pile.cc |
diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc |
index 4858d247bab590dd766b50e054bb07340e3bf4ea..e5a613950c304c6108654754ca8a5ca12c319f39 100644 |
--- a/cc/resources/picture_pile.cc |
+++ b/cc/resources/picture_pile.cc |
@@ -166,6 +166,7 @@ bool PicturePile::UpdateAndExpandInvalidation( |
int frame_number, |
Picture::RecordingMode recording_mode, |
RenderingStatsInstrumentation* stats_instrumentation) { |
+ TRACE_EVENT0("cc", "PicturePile::UpdateAndExpandInvalidation"); |
ajuma
2014/10/10 15:43:03
Did you mean to add these trace events, or is this
danakj
2014/10/10 16:07:15
Oh thanks that's from debugging the next bug, they
|
background_color_ = background_color; |
contents_opaque_ = contents_opaque; |
contents_fill_bounds_completely_ = contents_fill_bounds_completely; |
@@ -192,6 +193,7 @@ bool PicturePile::UpdateAndExpandInvalidation( |
tiling_.ExpandRectToTileBounds(interest_rect); |
if (old_tiling_size != layer_size) { |
+ TRACE_EVENT0("cc", "PicturePile::SizeChanged"); |
has_any_recordings_ = false; |
// Drop recordings that are outside the new layer bounds or that changed |
@@ -207,6 +209,8 @@ bool PicturePile::UpdateAndExpandInvalidation( |
min_toss_y = |
tiling_.FirstBorderTileYIndexFromSrcCoord(old_tiling_size.height()); |
} |
+ { |
+ TRACE_EVENT0("cc", "PicturePile::FindingKeys"); |
for (PictureMap::const_iterator it = picture_map_.begin(); |
it != picture_map_.end(); |
++it) { |
@@ -217,9 +221,13 @@ bool PicturePile::UpdateAndExpandInvalidation( |
} |
to_erase.push_back(key); |
} |
+ } |
+ { |
+ TRACE_EVENT0("cc", "PicturePile::DeletingKeys"); |
for (size_t i = 0; i < to_erase.size(); ++i) |
picture_map_.erase(to_erase[i]); |
+ } |
// If a recording is dropped and not re-recorded below, invalidate that |
// full recording to cause any raster tiles that would use it to be |
@@ -381,6 +389,8 @@ bool PicturePile::UpdateAndExpandInvalidation( |
Region invalidation_expanded_to_full_tiles; |
for (Region::Iterator i(*invalidation); i.has_rect(); i.next()) { |
gfx::Rect invalid_rect = i.rect(); |
+ TRACE_EVENT1( |
+ "cc", "PicturePile::Invalidating", "rect", invalid_rect.ToString()); |
// Expand invalidation that is outside tiles that intersect the interest |
// rect. These tiles are no longer valid and should be considerered fully |
@@ -397,9 +407,11 @@ bool PicturePile::UpdateAndExpandInvalidation( |
// Split this inflated invalidation across tile boundaries and apply it |
// to all tiles that it touches. |
bool include_borders = true; |
+ int n = 0; |
for (TilingData::Iterator iter(&tiling_, invalid_rect, include_borders); |
iter; |
++iter) { |
+ ++n; |
const PictureMapKey& key = iter.index(); |
PictureMap::iterator picture_it = picture_map_.find(key); |
@@ -415,10 +427,14 @@ bool PicturePile::UpdateAndExpandInvalidation( |
invalidation_expanded_to_full_tiles.Contains( |
tiling_.TileBounds(key.first, key.second))); |
} |
+ TRACE_EVENT1("cc", "PicturePile::InvalidatingTiles", "tiles", n); |
} |
+ { |
+ TRACE_EVENT0("cc", "PicturePile::Unioning"); |
invalidation->Union(invalidation_expanded_to_full_tiles); |
invalidation->Union(resize_invalidation); |
+ } |
// Make a list of all invalid tiles; we will attempt to |
// cluster these into multiple invalidation regions. |
@@ -426,6 +442,7 @@ bool PicturePile::UpdateAndExpandInvalidation( |
bool include_borders = true; |
for (TilingData::Iterator it(&tiling_, interest_rect, include_borders); it; |
++it) { |
+ TRACE_EVENT0("cc", "PicturePile::ListingTiles"); |
const PictureMapKey& key = it.index(); |
PictureInfo& info = picture_map_[key]; |
@@ -453,7 +470,10 @@ bool PicturePile::UpdateAndExpandInvalidation( |
} |
std::vector<gfx::Rect> record_rects; |
+ { |
+ TRACE_EVENT0("cc", "PicturePile::Clustering"); |
ClusterTiles(invalid_tiles, &record_rects); |
+ } |
if (record_rects.empty()) |
return updated; |
@@ -474,6 +494,7 @@ bool PicturePile::UpdateAndExpandInvalidation( |
bool gather_pixel_refs = RasterWorkerPool::GetNumRasterThreads() > 1; |
{ |
+ TRACE_EVENT0("cc", "PicturePile::Record"); |
base::TimeDelta best_duration = base::TimeDelta::Max(); |
for (int i = 0; i < repeat_count; i++) { |
base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
@@ -513,6 +534,7 @@ bool PicturePile::UpdateAndExpandInvalidation( |
found_tile_for_recorded_picture = true; |
} |
} |
+ TRACE_EVENT0("cc", "PicturePile::DetermineIfSolidColor"); |
DetermineIfSolidColor(); |
DCHECK(found_tile_for_recorded_picture); |
} |