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

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

Issue 13266002: cc: Pass RenderingStatsInstrumentation to ContentLayerUpdater (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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/layer.cc ('k') | cc/layers/tiled_layer_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/scrollbar_layer.h" 5 #include "cc/layers/scrollbar_layer.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "cc/layers/scrollbar_layer_impl.h" 9 #include "cc/layers/scrollbar_layer_impl.h"
10 #include "cc/resources/caching_bitmap_content_layer_updater.h" 10 #include "cc/resources/caching_bitmap_content_layer_updater.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 texture_format_ = 264 texture_format_ =
265 layer_tree_host()->GetRendererCapabilities().best_texture_format; 265 layer_tree_host()->GetRendererCapabilities().best_texture_format;
266 266
267 if (!back_track_updater_) { 267 if (!back_track_updater_) {
268 back_track_updater_ = CachingBitmapContentLayerUpdater::Create( 268 back_track_updater_ = CachingBitmapContentLayerUpdater::Create(
269 ScrollbarBackgroundPainter::Create( 269 ScrollbarBackgroundPainter::Create(
270 scrollbar_.get(), 270 scrollbar_.get(),
271 painter_.get(), 271 painter_.get(),
272 geometry_.get(), 272 geometry_.get(),
273 WebKit::WebScrollbar::BackTrackPart).PassAs<LayerPainter>()); 273 WebKit::WebScrollbar::BackTrackPart).PassAs<LayerPainter>(),
274 rendering_stats_instrumentation());
274 } 275 }
275 if (!back_track_) { 276 if (!back_track_) {
276 back_track_ = back_track_updater_->CreateResource( 277 back_track_ = back_track_updater_->CreateResource(
277 layer_tree_host()->contents_texture_manager()); 278 layer_tree_host()->contents_texture_manager());
278 } 279 }
279 280
280 // Only create two-part track if we think the two parts could be different in 281 // Only create two-part track if we think the two parts could be different in
281 // appearance. 282 // appearance.
282 if (scrollbar_->isCustomScrollbar()) { 283 if (scrollbar_->isCustomScrollbar()) {
283 if (!fore_track_updater_) { 284 if (!fore_track_updater_) {
284 fore_track_updater_ = CachingBitmapContentLayerUpdater::Create( 285 fore_track_updater_ = CachingBitmapContentLayerUpdater::Create(
285 ScrollbarBackgroundPainter::Create( 286 ScrollbarBackgroundPainter::Create(
286 scrollbar_.get(), 287 scrollbar_.get(),
287 painter_.get(), 288 painter_.get(),
288 geometry_.get(), 289 geometry_.get(),
289 WebKit::WebScrollbar::ForwardTrackPart).PassAs<LayerPainter>()); 290 WebKit::WebScrollbar::ForwardTrackPart).PassAs<LayerPainter>(),
291 rendering_stats_instrumentation());
290 } 292 }
291 if (!fore_track_) { 293 if (!fore_track_) {
292 fore_track_ = fore_track_updater_->CreateResource( 294 fore_track_ = fore_track_updater_->CreateResource(
293 layer_tree_host()->contents_texture_manager()); 295 layer_tree_host()->contents_texture_manager());
294 } 296 }
295 } 297 }
296 298
297 if (!thumb_updater_) { 299 if (!thumb_updater_) {
298 thumb_updater_ = CachingBitmapContentLayerUpdater::Create( 300 thumb_updater_ = CachingBitmapContentLayerUpdater::Create(
299 ScrollbarThumbPainter::Create(scrollbar_.get(), 301 ScrollbarThumbPainter::Create(scrollbar_.get(),
300 painter_.get(), 302 painter_.get(),
301 geometry_.get()).PassAs<LayerPainter>()); 303 geometry_.get()).PassAs<LayerPainter>(),
304 rendering_stats_instrumentation());
302 } 305 }
303 if (!thumb_) { 306 if (!thumb_) {
304 thumb_ = thumb_updater_->CreateResource( 307 thumb_ = thumb_updater_->CreateResource(
305 layer_tree_host()->contents_texture_manager()); 308 layer_tree_host()->contents_texture_manager());
306 } 309 }
307 } 310 }
308 311
309 void ScrollbarLayer::UpdatePart(CachingBitmapContentLayerUpdater* painter, 312 void ScrollbarLayer::UpdatePart(CachingBitmapContentLayerUpdater* painter,
310 LayerUpdater::Resource* resource, 313 LayerUpdater::Resource* resource,
311 gfx::Rect rect, 314 gfx::Rect rect,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 thumb_.get(), 435 thumb_.get(),
433 origin_thumb_rect, 436 origin_thumb_rect,
434 queue, 437 queue,
435 stats); 438 stats);
436 } 439 }
437 440
438 dirty_rect_ = gfx::RectF(); 441 dirty_rect_ = gfx::RectF();
439 } 442 }
440 443
441 } // namespace cc 444 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/tiled_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698