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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1946403003: Add fixed raster scale use counter histograms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 output_is_secure_(false), 234 output_is_secure_(false),
235 animation_host_(), 235 animation_host_(),
236 rendering_stats_instrumentation_(rendering_stats_instrumentation), 236 rendering_stats_instrumentation_(rendering_stats_instrumentation),
237 micro_benchmark_controller_(this), 237 micro_benchmark_controller_(this),
238 shared_bitmap_manager_(shared_bitmap_manager), 238 shared_bitmap_manager_(shared_bitmap_manager),
239 gpu_memory_buffer_manager_(gpu_memory_buffer_manager), 239 gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
240 task_graph_runner_(task_graph_runner), 240 task_graph_runner_(task_graph_runner),
241 id_(id), 241 id_(id),
242 requires_high_res_to_draw_(false), 242 requires_high_res_to_draw_(false),
243 is_likely_to_require_a_draw_(false), 243 is_likely_to_require_a_draw_(false),
244 mutator_(nullptr) { 244 mutator_(nullptr),
245 has_fixed_raster_scale_blurry_content_(false) {
245 animation_host_ = AnimationHost::Create(ThreadInstance::IMPL); 246 animation_host_ = AnimationHost::Create(ThreadInstance::IMPL);
246 animation_host_->SetMutatorHostClient(this); 247 animation_host_->SetMutatorHostClient(this);
247 animation_host_->SetSupportsScrollAnimations(SupportsImplScrolling()); 248 animation_host_->SetSupportsScrollAnimations(SupportsImplScrolling());
248 249
249 DCHECK(task_runner_provider_->IsImplThread()); 250 DCHECK(task_runner_provider_->IsImplThread());
250 DidVisibilityChange(this, visible_); 251 DidVisibilityChange(this, visible_);
251 252
252 SetDebugState(settings.initial_debug_state); 253 SetDebugState(settings.initial_debug_state);
253 254
254 // LTHI always has an active tree. 255 // LTHI always has an active tree.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 if (CommitToActiveTree()) 348 if (CommitToActiveTree())
348 Animate(); 349 Animate();
349 else 350 else
350 AnimatePendingTreeAfterCommit(); 351 AnimatePendingTreeAfterCommit();
351 352
352 // LayerTreeHost may have changed the GPU rasterization flags state, which 353 // LayerTreeHost may have changed the GPU rasterization flags state, which
353 // may require an update of the tree resources. 354 // may require an update of the tree resources.
354 UpdateTreeResourcesForGpuRasterizationIfNeeded(); 355 UpdateTreeResourcesForGpuRasterizationIfNeeded();
355 sync_tree()->set_needs_update_draw_properties(); 356 sync_tree()->set_needs_update_draw_properties();
356 357
358 // Advance the attempted scale change history before updaring draw properties.
danakj 2016/05/10 22:05:30 updating
vmpstr 2016/05/13 00:13:34 Done.
359 fixed_raster_scale_attempted_scale_change_history_ <<= 1;
360
357 // We need an update immediately post-commit to have the opportunity to create 361 // We need an update immediately post-commit to have the opportunity to create
358 // tilings. Because invalidations may be coming from the main thread, it's 362 // tilings. Because invalidations may be coming from the main thread, it's
359 // safe to do an update for lcd text at this point and see if lcd text needs 363 // safe to do an update for lcd text at this point and see if lcd text needs
360 // to be disabled on any layers. 364 // to be disabled on any layers.
361 bool update_lcd_text = true; 365 bool update_lcd_text = true;
362 sync_tree()->UpdateDrawProperties(update_lcd_text); 366 sync_tree()->UpdateDrawProperties(update_lcd_text);
363 // Start working on newly created tiles immediately if needed. 367 // Start working on newly created tiles immediately if needed.
364 // TODO(vmpstr): Investigate always having PrepareTiles issue 368 // TODO(vmpstr): Investigate always having PrepareTiles issue
365 // NotifyReadyToActivate, instead of handling it here. 369 // NotifyReadyToActivate, instead of handling it here.
366 bool did_prepare_tiles = PrepareTiles(); 370 bool did_prepare_tiles = PrepareTiles();
(...skipping 3594 matching lines...) Expand 10 before | Expand all | Expand 10 after
3961 // Supported in threaded mode. 3965 // Supported in threaded mode.
3962 return task_runner_provider_->HasImplThread(); 3966 return task_runner_provider_->HasImplThread();
3963 } 3967 }
3964 3968
3965 bool LayerTreeHostImpl::CommitToActiveTree() const { 3969 bool LayerTreeHostImpl::CommitToActiveTree() const {
3966 // In single threaded mode we skip the pending tree and commit directly to the 3970 // In single threaded mode we skip the pending tree and commit directly to the
3967 // active tree. 3971 // active tree.
3968 return !task_runner_provider_->HasImplThread(); 3972 return !task_runner_provider_->HasImplThread();
3969 } 3973 }
3970 3974
3975 bool LayerTreeHostImpl::HasFixedRasterScalePotentialPerformanceRegression()
3976 const {
3977 return fixed_raster_scale_attempted_scale_change_history_.count() >=
3978 kFixedRasterScaleAttemptedScaleChangeThreshold;
3979 }
3980
3981 void LayerTreeHostImpl::SetFixedRasterScaleAttemptedToChangeScale() {
3982 fixed_raster_scale_attempted_scale_change_history_.set(0);
3983 }
3984
3971 } // namespace cc 3985 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698