Skip to content

Commit

Permalink
cc: Remove noisy UpdateTiles traces.
Browse files Browse the repository at this point in the history
This patch removes some traces that add more overhead than information.
In particular, PLI traces UpdateTiles, UpdateTilePriorities, and
SyncFromActiveLayer are all fairly quick now, but tend to add a lot
of overhead when there are a lot of layers. Instead, these are replaced
with a layer count in the LTI UpdateTilePriorities trace.

R=danakj
BUG=430270

Review URL: https://codereview.chromium.org/704513005

Cr-Commit-Position: refs/heads/master@{#302835}
  • Loading branch information
vmpstr authored and Commit bot committed Nov 5, 2014
1 parent b5e1c45 commit d616620
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
7 changes: 0 additions & 7 deletions cc/layers/picture_layer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,

void PictureLayerImpl::UpdateTiles(const Occlusion& occlusion_in_content_space,
bool resourceless_software_draw) {
TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTiles");
DCHECK_EQ(1.f, contents_scale_x());
DCHECK_EQ(1.f, contents_scale_y());

Expand Down Expand Up @@ -516,9 +515,6 @@ void PictureLayerImpl::UpdateTiles(const Occlusion& occlusion_in_content_space,
void PictureLayerImpl::UpdateTilePriorities(
const Occlusion& occlusion_in_content_space) {
DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings());

TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities");

double current_frame_time_in_seconds =
(layer_tree_impl()->CurrentBeginFrameArgs().frame_time -
base::TimeTicks()).InSecondsF();
Expand Down Expand Up @@ -790,7 +786,6 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
}

void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) {
TRACE_EVENT0("cc", "SyncFromActiveLayer");
DCHECK(!other->needs_post_commit_initialization_);
DCHECK(other->tilings_);

Expand Down Expand Up @@ -1408,8 +1403,6 @@ bool PictureLayerImpl::HasValidTilePriorities() const {
}

bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const {
TRACE_EVENT0("cc",
"PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw");
if (!layer_tree_impl()->IsPendingTree())
return true;

Expand Down
1 change: 1 addition & 0 deletions cc/resources/tile_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@ void TileManager::SetRasterizerForTesting(Rasterizer* rasterizer) {
}

bool TileManager::IsReadyToActivate() const {
TRACE_EVENT0("cc", "TileManager::IsReadyToActivate");
const std::vector<PictureLayerImpl*>& layers = client_->GetPictureLayers();

for (std::vector<PictureLayerImpl*>::const_iterator it = layers.begin();
Expand Down
16 changes: 10 additions & 6 deletions cc/trees/layer_tree_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,9 @@ bool LayerTreeImpl::UpdateDrawProperties() {
}

{
TRACE_EVENT2("cc",
"LayerTreeImpl::UpdateTilePriorities",
"IsActive",
IsActiveTree(),
"SourceFrameNumber",
source_frame_number_);
TRACE_EVENT_BEGIN2("cc", "LayerTreeImpl::UpdateTilePriorities", "IsActive",
IsActiveTree(), "SourceFrameNumber",
source_frame_number_);
scoped_ptr<OcclusionTracker<LayerImpl>> occlusion_tracker;
if (settings().use_occlusion_for_tile_prioritization) {
occlusion_tracker.reset(new OcclusionTracker<LayerImpl>(
Expand All @@ -528,6 +525,7 @@ bool LayerTreeImpl::UpdateDrawProperties() {
// draw properties) and not because any ordering is required.
typedef LayerIterator<LayerImpl> LayerIteratorType;
LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_);
size_t layers_updated_count = 0;
for (LayerIteratorType it =
LayerIteratorType::Begin(&render_surface_layer_list_);
it != end;
Expand All @@ -544,6 +542,7 @@ bool LayerTreeImpl::UpdateDrawProperties() {
if (it.represents_itself()) {
layer->UpdateTiles(occlusion_in_content_space,
resourceless_software_draw);
++layers_updated_count;
}

if (!it.represents_contributing_render_surface()) {
Expand All @@ -555,15 +554,20 @@ bool LayerTreeImpl::UpdateDrawProperties() {
if (layer->mask_layer()) {
layer->mask_layer()->UpdateTiles(occlusion_in_content_space,
resourceless_software_draw);
++layers_updated_count;
}
if (layer->replica_layer() && layer->replica_layer()->mask_layer()) {
layer->replica_layer()->mask_layer()->UpdateTiles(
occlusion_in_content_space, resourceless_software_draw);
++layers_updated_count;
}

if (occlusion_tracker)
occlusion_tracker->LeaveLayer(it);
}

TRACE_EVENT_END1("cc", "LayerTreeImpl::UpdateTilePriorities",
"layers_updated_count", layers_updated_count);
}

DCHECK(!needs_update_draw_properties_) <<
Expand Down

0 comments on commit d616620

Please sign in to comment.