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

Side by Side Diff: cc/layers/picture_layer.cc

Issue 12426024: cc: Switch RenderingStats collection in Layer::Update() to RenderingStatsInstrumentation (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 190965 Created 7 years, 9 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
« no previous file with comments | « cc/layers/picture_layer.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | 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/layers/picture_layer.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include "cc/debug/devtools_instrumentation.h" 7 #include "cc/debug/devtools_instrumentation.h"
8 #include "cc/layers/picture_layer_impl.h" 8 #include "cc/layers/picture_layer_impl.h"
9 #include "cc/trees/layer_tree_impl.h" 9 #include "cc/trees/layer_tree_impl.h"
10 #include "ui/gfx/rect_conversions.h" 10 #include "ui/gfx/rect_conversions.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 gfx::Rect rect = gfx::ToEnclosedRect(layer_rect); 61 gfx::Rect rect = gfx::ToEnclosedRect(layer_rect);
62 if (!rect.IsEmpty()) { 62 if (!rect.IsEmpty()) {
63 // Clamp invalidation to the layer bounds. 63 // Clamp invalidation to the layer bounds.
64 rect.Intersect(gfx::Rect(bounds())); 64 rect.Intersect(gfx::Rect(bounds()));
65 pending_invalidation_.Union(rect); 65 pending_invalidation_.Union(rect);
66 } 66 }
67 Layer::SetNeedsDisplayRect(layer_rect); 67 Layer::SetNeedsDisplayRect(layer_rect);
68 } 68 }
69 69
70 void PictureLayer::Update(ResourceUpdateQueue*, 70 void PictureLayer::Update(ResourceUpdateQueue*,
71 const OcclusionTracker*, 71 const OcclusionTracker*) {
72 RenderingStats* stats) {
73 // Do not early-out of this function so that PicturePile::Update has a chance 72 // Do not early-out of this function so that PicturePile::Update has a chance
74 // to record pictures due to changing visibility of this layer. 73 // to record pictures due to changing visibility of this layer.
75 74
76 pile_->Resize(bounds()); 75 pile_->Resize(bounds());
77 76
78 // Calling paint in WebKit can sometimes cause invalidations, so save 77 // Calling paint in WebKit can sometimes cause invalidations, so save
79 // off the invalidation prior to calling update. 78 // off the invalidation prior to calling update.
80 pile_invalidation_.Swap(&pending_invalidation_); 79 pile_invalidation_.Swap(&pending_invalidation_);
81 pending_invalidation_.Clear(); 80 pending_invalidation_.Clear();
82 81
83 gfx::Rect visible_layer_rect = gfx::ToEnclosingRect( 82 gfx::Rect visible_layer_rect = gfx::ToEnclosingRect(
84 gfx::ScaleRect(visible_content_rect(), 1.f / contents_scale_x())); 83 gfx::ScaleRect(visible_content_rect(), 1.f / contents_scale_x()));
85 devtools_instrumentation::ScopedPaintLayer paint_layer(id()); 84 devtools_instrumentation::ScopedPaintLayer paint_layer(id());
86 pile_->Update(client_, 85 pile_->Update(client_,
87 background_color(), 86 background_color(),
88 pile_invalidation_, 87 pile_invalidation_,
89 visible_layer_rect, 88 visible_layer_rect,
90 stats); 89 rendering_stats_instrumentation());
91 } 90 }
92 91
93 void PictureLayer::SetIsMask(bool is_mask) { 92 void PictureLayer::SetIsMask(bool is_mask) {
94 is_mask_ = is_mask; 93 is_mask_ = is_mask;
95 } 94 }
96 95
97 } // namespace cc 96 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698