diff options
author | loyso <loyso@chromium.org> | 2016-03-15 00:38:46 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-15 07:40:08 +0000 |
commit | f0099ca2bacbc5e23747344f5c8de7651933ab76 (patch) | |
tree | 42166de6f6e8a85967d37e6bbc47ae3d7bb504f4 | |
parent | 93edc00ba647814fd9b6157b37a96410ec2964d1 (diff) | |
download | chromium_src-f0099ca2bacbc5e23747344f5c8de7651933ab76.zip chromium_src-f0099ca2bacbc5e23747344f5c8de7651933ab76.tar.gz chromium_src-f0099ca2bacbc5e23747344f5c8de7651933ab76.tar.bz2 |
CC Animation: Erase LayerTreeSettings::accelerated_animation_enabled flag.
We use disable-threaded-animation command line switch for
testing purposes.
Now blink knows ahead of time, whether we support threaded animations.
See
RendererBlinkPlatformImpl::isThreadedAnimationEnabled()
BUG=575041
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1798503004
Cr-Commit-Position: refs/heads/master@{#381192}
-rw-r--r-- | blimp/client/feature/compositor/blimp_layer_tree_settings.cc | 1 | ||||
-rw-r--r-- | cc/trees/layer_tree_host.cc | 109 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 37 | ||||
-rw-r--r-- | cc/trees/layer_tree_impl.cc | 116 | ||||
-rw-r--r-- | cc/trees/layer_tree_settings.cc | 4 | ||||
-rw-r--r-- | cc/trees/layer_tree_settings.h | 1 | ||||
-rw-r--r-- | cc/trees/layer_tree_settings_unittest.cc | 3 | ||||
-rw-r--r-- | content/renderer/gpu/render_widget_compositor.cc | 2 | ||||
-rw-r--r-- | content/test/web_layer_tree_view_impl_for_testing.cc | 3 |
9 files changed, 79 insertions, 197 deletions
diff --git a/blimp/client/feature/compositor/blimp_layer_tree_settings.cc b/blimp/client/feature/compositor/blimp_layer_tree_settings.cc index a259150..b0ebd5b 100644 --- a/blimp/client/feature/compositor/blimp_layer_tree_settings.cc +++ b/blimp/client/feature/compositor/blimp_layer_tree_settings.cc @@ -28,7 +28,6 @@ void PopulateCommonLayerTreeSettings(cc::LayerTreeSettings* settings) { settings->layer_transforms_should_scale_layer_contents = true; settings->main_frame_before_activation_enabled = false; - settings->accelerated_animation_enabled = true; settings->default_tile_size = gfx::Size(256, 256); settings->gpu_rasterization_msaa_sample_count = 0; settings->gpu_rasterization_forced = false; diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 437ca4b..e669e27 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -197,10 +197,8 @@ LayerTreeHost::LayerTreeHost(InitParams* params, CompositorMode mode) next_surface_sequence_(1u) { DCHECK(task_graph_runner_); - if (settings_.accelerated_animation_enabled) { - animation_host_ = AnimationHost::Create(ThreadInstance::MAIN); - animation_host_->SetMutatorHostClient(this); - } + animation_host_ = AnimationHost::Create(ThreadInstance::MAIN); + animation_host_->SetMutatorHostClient(this); rendering_stats_instrumentation_->set_record_rendering_stats( debug_state_.RecordRenderingStats()); @@ -285,17 +283,14 @@ void LayerTreeHost::InitializeProxy( proxy_ = std::move(proxy); proxy_->Start(std::move(external_begin_frame_source)); - if (settings_.accelerated_animation_enabled) { - animation_host_->SetSupportsScrollAnimations( - proxy_->SupportsImplScrolling()); - } + + animation_host_->SetSupportsScrollAnimations(proxy_->SupportsImplScrolling()); } LayerTreeHost::~LayerTreeHost() { TRACE_EVENT0("cc", "LayerTreeHost::~LayerTreeHost"); - if (animation_host_) - animation_host_->SetMutatorHostClient(nullptr); + animation_host_->SetMutatorHostClient(nullptr); if (root_layer_.get()) root_layer_->SetLayerTreeHost(NULL); @@ -473,11 +468,9 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { TRACE_EVENT0("cc", "LayerTreeHost::PushProperties"); TreeSynchronizer::PushProperties(root_layer(), sync_tree->root_layer()); - if (animation_host_) { - TRACE_EVENT0("cc", "LayerTreeHost::AnimationHost::PushProperties"); - DCHECK(host_impl->animation_host()); - animation_host_->PushPropertiesTo(host_impl->animation_host()); - } + TRACE_EVENT0("cc", "LayerTreeHost::AnimationHost::PushProperties"); + DCHECK(host_impl->animation_host()); + animation_host_->PushPropertiesTo(host_impl->animation_host()); } // This must happen after synchronizing property trees and after push @@ -1048,11 +1041,8 @@ void LayerTreeHost::UpdateTopControlsState(TopControlsState constraints, } void LayerTreeHost::AnimateLayers(base::TimeTicks monotonic_time) { - if (!settings_.accelerated_animation_enabled) - return; + scoped_ptr<AnimationEvents> events = animation_host_->CreateEvents(); - scoped_ptr<AnimationEvents> events; - events = animation_host_->CreateEvents(); if (animation_host_->AnimateLayers(monotonic_time)) animation_host_->UpdateAnimationState(true, events.get()); @@ -1236,15 +1226,13 @@ void LayerTreeHost::RegisterLayer(Layer* layer) { DCHECK(!LayerById(layer->id())); DCHECK(!in_paint_layer_contents_); layer_id_map_[layer->id()] = layer; - if (animation_host_) - animation_host_->RegisterLayer(layer->id(), LayerTreeType::ACTIVE); + animation_host_->RegisterLayer(layer->id(), LayerTreeType::ACTIVE); } void LayerTreeHost::UnregisterLayer(Layer* layer) { DCHECK(LayerById(layer->id())); DCHECK(!in_paint_layer_contents_); - if (animation_host_) - animation_host_->UnregisterLayer(layer->id(), LayerTreeType::ACTIVE); + animation_host_->UnregisterLayer(layer->id(), LayerTreeType::ACTIVE); layer_id_map_.erase(layer->id()); } @@ -1311,103 +1299,76 @@ gfx::ScrollOffset LayerTreeHost::GetScrollOffsetForAnimation( bool LayerTreeHost::ScrollOffsetAnimationWasInterrupted( const Layer* layer) const { - return animation_host_ - ? animation_host_->ScrollOffsetAnimationWasInterrupted(layer->id()) - : false; + return animation_host_->ScrollOffsetAnimationWasInterrupted(layer->id()); } bool LayerTreeHost::IsAnimatingFilterProperty(const Layer* layer) const { - return animation_host_ - ? animation_host_->IsAnimatingFilterProperty(layer->id(), - LayerTreeType::ACTIVE) - : false; + return animation_host_->IsAnimatingFilterProperty(layer->id(), + LayerTreeType::ACTIVE); } bool LayerTreeHost::IsAnimatingOpacityProperty(const Layer* layer) const { - return animation_host_ - ? animation_host_->IsAnimatingOpacityProperty( - layer->id(), LayerTreeType::ACTIVE) - : false; + return animation_host_->IsAnimatingOpacityProperty(layer->id(), + LayerTreeType::ACTIVE); } bool LayerTreeHost::IsAnimatingTransformProperty(const Layer* layer) const { - return animation_host_ - ? animation_host_->IsAnimatingTransformProperty( - layer->id(), LayerTreeType::ACTIVE) - : false; + return animation_host_->IsAnimatingTransformProperty(layer->id(), + LayerTreeType::ACTIVE); } bool LayerTreeHost::HasPotentiallyRunningFilterAnimation( const Layer* layer) const { - return animation_host_ - ? animation_host_->HasPotentiallyRunningFilterAnimation( - layer->id(), LayerTreeType::ACTIVE) - : false; + return animation_host_->HasPotentiallyRunningFilterAnimation( + layer->id(), LayerTreeType::ACTIVE); } bool LayerTreeHost::HasPotentiallyRunningOpacityAnimation( const Layer* layer) const { - return animation_host_ - ? animation_host_->HasPotentiallyRunningOpacityAnimation( - layer->id(), LayerTreeType::ACTIVE) - : false; + return animation_host_->HasPotentiallyRunningOpacityAnimation( + layer->id(), LayerTreeType::ACTIVE); } bool LayerTreeHost::HasPotentiallyRunningTransformAnimation( const Layer* layer) const { - return animation_host_ - ? animation_host_->HasPotentiallyRunningTransformAnimation( - layer->id(), LayerTreeType::ACTIVE) - : false; + return animation_host_->HasPotentiallyRunningTransformAnimation( + layer->id(), LayerTreeType::ACTIVE); } bool LayerTreeHost::HasOnlyTranslationTransforms(const Layer* layer) const { - return animation_host_ - ? animation_host_->HasOnlyTranslationTransforms( - layer->id(), LayerTreeType::ACTIVE) - : false; + return animation_host_->HasOnlyTranslationTransforms(layer->id(), + LayerTreeType::ACTIVE); } bool LayerTreeHost::MaximumTargetScale(const Layer* layer, float* max_scale) const { - return animation_host_ - ? animation_host_->MaximumTargetScale( - layer->id(), LayerTreeType::ACTIVE, max_scale) - : false; + return animation_host_->MaximumTargetScale(layer->id(), LayerTreeType::ACTIVE, + max_scale); } bool LayerTreeHost::AnimationStartScale(const Layer* layer, float* start_scale) const { - return animation_host_ - ? animation_host_->AnimationStartScale( - layer->id(), LayerTreeType::ACTIVE, start_scale) - : false; + return animation_host_->AnimationStartScale( + layer->id(), LayerTreeType::ACTIVE, start_scale); } bool LayerTreeHost::HasAnyAnimationTargetingProperty( const Layer* layer, TargetProperty::Type property) const { - return animation_host_ - ? animation_host_->HasAnyAnimationTargetingProperty(layer->id(), - property) - : false; + return animation_host_->HasAnyAnimationTargetingProperty(layer->id(), + property); } bool LayerTreeHost::AnimationsPreserveAxisAlignment(const Layer* layer) const { - return animation_host_ - ? animation_host_->AnimationsPreserveAxisAlignment(layer->id()) - : true; + return animation_host_->AnimationsPreserveAxisAlignment(layer->id()); } bool LayerTreeHost::HasAnyAnimation(const Layer* layer) const { - return animation_host_ ? animation_host_->HasAnyAnimation(layer->id()) - : false; + return animation_host_->HasAnyAnimation(layer->id()); } bool LayerTreeHost::HasActiveAnimationForTesting(const Layer* layer) const { - return animation_host_ - ? animation_host_->HasActiveAnimationForTesting(layer->id()) - : false; + return animation_host_->HasActiveAnimationForTesting(layer->id()); } bool LayerTreeHost::IsSingleThreaded() const { diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 0a9fdb3..5e21974 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -236,11 +236,9 @@ LayerTreeHostImpl::LayerTreeHostImpl( requires_high_res_to_draw_(false), is_likely_to_require_a_draw_(false), frame_timing_tracker_(FrameTimingTracker::Create(this)) { - if (settings.accelerated_animation_enabled) { - animation_host_ = AnimationHost::Create(ThreadInstance::IMPL); - animation_host_->SetMutatorHostClient(this); - animation_host_->SetSupportsScrollAnimations(SupportsImplScrolling()); - } + animation_host_ = AnimationHost::Create(ThreadInstance::IMPL); + animation_host_->SetMutatorHostClient(this); + animation_host_->SetSupportsScrollAnimations(SupportsImplScrolling()); DCHECK(task_runner_provider_->IsImplThread()); DidVisibilityChange(this, visible_); @@ -289,10 +287,8 @@ LayerTreeHostImpl::~LayerTreeHostImpl() { pending_tree_ = nullptr; active_tree_ = nullptr; - if (animation_host_) { - animation_host_->ClearTimelines(); - animation_host_->SetMutatorHostClient(nullptr); - } + animation_host_->ClearTimelines(); + animation_host_->SetMutatorHostClient(nullptr); CleanUpTileManagerAndUIResources(); renderer_ = nullptr; @@ -3389,12 +3385,7 @@ bool LayerTreeHostImpl::AnimateScrollbars(base::TimeTicks monotonic_time) { } bool LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) { - if (!settings_.accelerated_animation_enabled) - return false; - - bool animated = false; - if (animation_host_->AnimateLayers(monotonic_time)) - animated = true; + const bool animated = animation_host_->AnimateLayers(monotonic_time); // TODO(crbug.com/551134): Only do this if the animations are on the active // tree, or if they are on the pending tree waiting for some future time to @@ -3411,14 +3402,9 @@ bool LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) { } void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) { - if (!settings_.accelerated_animation_enabled) - return; - - bool has_active_animations = false; - scoped_ptr<AnimationEvents> events; + scoped_ptr<AnimationEvents> events = animation_host_->CreateEvents(); - events = animation_host_->CreateEvents(); - has_active_animations = animation_host_->UpdateAnimationState( + const bool has_active_animations = animation_host_->UpdateAnimationState( start_ready_animations, events.get()); if (!events->events_.empty()) @@ -3429,9 +3415,6 @@ void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) { } void LayerTreeHostImpl::ActivateAnimations() { - if (!settings_.accelerated_animation_enabled) - return; - const bool activated = animation_host_->ActivateAnimations(); if (activated) { // Activating an animation changes layer draw properties, such as @@ -3849,9 +3832,7 @@ void LayerTreeHostImpl::TreeLayerTransformIsPotentiallyAnimatingChanged( bool LayerTreeHostImpl::AnimationsPreserveAxisAlignment( const LayerImpl* layer) const { - return animation_host_ - ? animation_host_->AnimationsPreserveAxisAlignment(layer->id()) - : true; + return animation_host_->AnimationsPreserveAxisAlignment(layer->id()); } void LayerTreeHostImpl::SetLayerFilterMutated(int layer_id, diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index f5702ed..dae2e2c 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc @@ -981,18 +981,16 @@ bool LayerTreeImpl::LayerNeedsPushPropertiesForTesting(LayerImpl* layer) { void LayerTreeImpl::RegisterLayer(LayerImpl* layer) { DCHECK(!LayerById(layer->id())); layer_id_map_[layer->id()] = layer; - if (layer_tree_host_impl_->animation_host()) - layer_tree_host_impl_->animation_host()->RegisterLayer( - layer->id(), - IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING); + layer_tree_host_impl_->animation_host()->RegisterLayer( + layer->id(), + IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING); } void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) { DCHECK(LayerById(layer->id())); - if (layer_tree_host_impl_->animation_host()) - layer_tree_host_impl_->animation_host()->UnregisterLayer( - layer->id(), - IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING); + layer_tree_host_impl_->animation_host()->UnregisterLayer( + layer->id(), + IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING); layer_id_map_.erase(layer->id()); } @@ -1887,28 +1885,22 @@ LayerTreeImpl::TakePendingPageScaleAnimation() { bool LayerTreeImpl::IsAnimatingFilterProperty(const LayerImpl* layer) const { LayerTreeType tree_type = IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; - return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->IsAnimatingFilterProperty(layer->id(), tree_type) - : false; + return layer_tree_host_impl_->animation_host()->IsAnimatingFilterProperty( + layer->id(), tree_type); } bool LayerTreeImpl::IsAnimatingOpacityProperty(const LayerImpl* layer) const { LayerTreeType tree_type = IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; - return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->IsAnimatingOpacityProperty(layer->id(), tree_type) - : false; + return layer_tree_host_impl_->animation_host()->IsAnimatingOpacityProperty( + layer->id(), tree_type); } bool LayerTreeImpl::IsAnimatingTransformProperty(const LayerImpl* layer) const { LayerTreeType tree_type = IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; - return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->IsAnimatingTransformProperty(layer->id(), tree_type) - : false; + return layer_tree_host_impl_->animation_host()->IsAnimatingTransformProperty( + layer->id(), tree_type); } bool LayerTreeImpl::HasPotentiallyRunningFilterAnimation( @@ -1916,10 +1908,7 @@ bool LayerTreeImpl::HasPotentiallyRunningFilterAnimation( LayerTreeType tree_type = IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->HasPotentiallyRunningFilterAnimation(layer->id(), - tree_type) - : false; + ->HasPotentiallyRunningFilterAnimation(layer->id(), tree_type); } bool LayerTreeImpl::HasPotentiallyRunningOpacityAnimation( @@ -1927,10 +1916,7 @@ bool LayerTreeImpl::HasPotentiallyRunningOpacityAnimation( LayerTreeType tree_type = IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->HasPotentiallyRunningOpacityAnimation(layer->id(), - tree_type) - : false; + ->HasPotentiallyRunningOpacityAnimation(layer->id(), tree_type); } bool LayerTreeImpl::HasPotentiallyRunningTransformAnimation( @@ -1938,66 +1924,49 @@ bool LayerTreeImpl::HasPotentiallyRunningTransformAnimation( LayerTreeType tree_type = IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->HasPotentiallyRunningTransformAnimation(layer->id(), - tree_type) - : false; + ->HasPotentiallyRunningTransformAnimation(layer->id(), tree_type); } bool LayerTreeImpl::HasAnyAnimationTargetingProperty( const LayerImpl* layer, TargetProperty::Type property) const { return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->HasAnyAnimationTargetingProperty(layer->id(), property) - : false; + ->HasAnyAnimationTargetingProperty(layer->id(), property); } bool LayerTreeImpl::FilterIsAnimatingOnImplOnly(const LayerImpl* layer) const { - return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->FilterIsAnimatingOnImplOnly(layer->id()) - : false; + return layer_tree_host_impl_->animation_host()->FilterIsAnimatingOnImplOnly( + layer->id()); } bool LayerTreeImpl::OpacityIsAnimatingOnImplOnly(const LayerImpl* layer) const { - return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->OpacityIsAnimatingOnImplOnly(layer->id()) - : false; + return layer_tree_host_impl_->animation_host()->OpacityIsAnimatingOnImplOnly( + layer->id()); } bool LayerTreeImpl::ScrollOffsetIsAnimatingOnImplOnly( const LayerImpl* layer) const { return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->ScrollOffsetIsAnimatingOnImplOnly(layer->id()) - : false; + ->ScrollOffsetIsAnimatingOnImplOnly(layer->id()); } bool LayerTreeImpl::TransformIsAnimatingOnImplOnly( const LayerImpl* layer) const { return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->TransformIsAnimatingOnImplOnly(layer->id()) - : false; + ->TransformIsAnimatingOnImplOnly(layer->id()); } bool LayerTreeImpl::AnimationsPreserveAxisAlignment( const LayerImpl* layer) const { return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->AnimationsPreserveAxisAlignment(layer->id()) - : true; + ->AnimationsPreserveAxisAlignment(layer->id()); } bool LayerTreeImpl::HasOnlyTranslationTransforms(const LayerImpl* layer) const { LayerTreeType tree_type = IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; - return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->HasOnlyTranslationTransforms(layer->id(), tree_type) - : true; + return layer_tree_host_impl_->animation_host()->HasOnlyTranslationTransforms( + layer->id(), tree_type); } bool LayerTreeImpl::MaximumTargetScale(const LayerImpl* layer, @@ -2005,10 +1974,8 @@ bool LayerTreeImpl::MaximumTargetScale(const LayerImpl* layer, *max_scale = 0.f; LayerTreeType tree_type = IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; - return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host()->MaximumTargetScale( - layer->id(), tree_type, max_scale) - : true; + return layer_tree_host_impl_->animation_host()->MaximumTargetScale( + layer->id(), tree_type, max_scale); } bool LayerTreeImpl::AnimationStartScale(const LayerImpl* layer, @@ -2016,43 +1983,33 @@ bool LayerTreeImpl::AnimationStartScale(const LayerImpl* layer, *start_scale = 0.f; LayerTreeType tree_type = IsActiveTree() ? LayerTreeType::ACTIVE : LayerTreeType::PENDING; - return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host()->AnimationStartScale( - layer->id(), tree_type, start_scale) - : true; + return layer_tree_host_impl_->animation_host()->AnimationStartScale( + layer->id(), tree_type, start_scale); } bool LayerTreeImpl::HasFilterAnimationThatInflatesBounds( const LayerImpl* layer) const { return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->HasFilterAnimationThatInflatesBounds(layer->id()) - : false; + ->HasFilterAnimationThatInflatesBounds(layer->id()); } bool LayerTreeImpl::HasTransformAnimationThatInflatesBounds( const LayerImpl* layer) const { return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->HasTransformAnimationThatInflatesBounds(layer->id()) - : false; + ->HasTransformAnimationThatInflatesBounds(layer->id()); } bool LayerTreeImpl::HasAnimationThatInflatesBounds( const LayerImpl* layer) const { return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->HasAnimationThatInflatesBounds(layer->id()) - : false; + ->HasAnimationThatInflatesBounds(layer->id()); } bool LayerTreeImpl::FilterAnimationBoundsForBox(const LayerImpl* layer, const gfx::BoxF& box, gfx::BoxF* bounds) const { - return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->FilterAnimationBoundsForBox(layer->id(), box, bounds) - : false; + return layer_tree_host_impl_->animation_host()->FilterAnimationBoundsForBox( + layer->id(), box, bounds); } bool LayerTreeImpl::TransformAnimationBoundsForBox(const LayerImpl* layer, @@ -2060,13 +2017,10 @@ bool LayerTreeImpl::TransformAnimationBoundsForBox(const LayerImpl* layer, gfx::BoxF* bounds) const { *bounds = gfx::BoxF(); return layer_tree_host_impl_->animation_host() - ? layer_tree_host_impl_->animation_host() - ->TransformAnimationBoundsForBox(layer->id(), box, bounds) - : true; + ->TransformAnimationBoundsForBox(layer->id(), box, bounds); } void LayerTreeImpl::ScrollAnimationAbort(bool needs_completion) { - DCHECK(layer_tree_host_impl_->animation_host()); layer_tree_host_impl_->animation_host()->ScrollAnimationAbort( needs_completion); } diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc index eb2a649..cb4d427 100644 --- a/cc/trees/layer_tree_settings.cc +++ b/cc/trees/layer_tree_settings.cc @@ -59,7 +59,6 @@ LayerTreeSettings::LayerTreeSettings() use_external_begin_frame_source(false), main_frame_before_activation_enabled(false), using_synchronous_renderer_compositor(false), - accelerated_animation_enabled(true), can_use_lcd_text(true), use_distance_field_text(false), gpu_rasterization_enabled(false), @@ -120,7 +119,6 @@ bool LayerTreeSettings::operator==(const LayerTreeSettings& other) const { other.main_frame_before_activation_enabled && using_synchronous_renderer_compositor == other.using_synchronous_renderer_compositor && - accelerated_animation_enabled == other.accelerated_animation_enabled && can_use_lcd_text == other.can_use_lcd_text && use_distance_field_text == other.use_distance_field_text && gpu_rasterization_enabled == other.gpu_rasterization_enabled && @@ -184,7 +182,6 @@ void LayerTreeSettings::ToProtobuf(proto::LayerTreeSettings* proto) const { main_frame_before_activation_enabled); proto->set_using_synchronous_renderer_compositor( using_synchronous_renderer_compositor); - proto->set_accelerated_animation_enabled(accelerated_animation_enabled); proto->set_can_use_lcd_text(can_use_lcd_text); proto->set_use_distance_field_text(use_distance_field_text); proto->set_gpu_rasterization_enabled(gpu_rasterization_enabled); @@ -247,7 +244,6 @@ void LayerTreeSettings::FromProtobuf(const proto::LayerTreeSettings& proto) { proto.main_frame_before_activation_enabled(); using_synchronous_renderer_compositor = proto.using_synchronous_renderer_compositor(); - accelerated_animation_enabled = proto.accelerated_animation_enabled(); can_use_lcd_text = proto.can_use_lcd_text(); use_distance_field_text = proto.use_distance_field_text(); gpu_rasterization_enabled = proto.gpu_rasterization_enabled(); diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h index 3343c37..2aadbbc 100644 --- a/cc/trees/layer_tree_settings.h +++ b/cc/trees/layer_tree_settings.h @@ -41,7 +41,6 @@ class CC_EXPORT LayerTreeSettings { bool use_external_begin_frame_source; bool main_frame_before_activation_enabled; bool using_synchronous_renderer_compositor; - bool accelerated_animation_enabled; bool can_use_lcd_text; bool use_distance_field_text; bool gpu_rasterization_enabled; diff --git a/cc/trees/layer_tree_settings_unittest.cc b/cc/trees/layer_tree_settings_unittest.cc index 2d48596..8c10a1a 100644 --- a/cc/trees/layer_tree_settings_unittest.cc +++ b/cc/trees/layer_tree_settings_unittest.cc @@ -37,8 +37,6 @@ TEST(LayerTreeSettingsTest, AllMembersChanged) { !settings.main_frame_before_activation_enabled; settings.using_synchronous_renderer_compositor = !settings.using_synchronous_renderer_compositor; - settings.accelerated_animation_enabled = - !settings.accelerated_animation_enabled; settings.can_use_lcd_text = !settings.can_use_lcd_text; settings.use_distance_field_text = !settings.use_distance_field_text; settings.gpu_rasterization_enabled = !settings.gpu_rasterization_enabled; @@ -109,7 +107,6 @@ TEST(LayerTreeSettingsTest, ArbitraryValues) { settings.use_external_begin_frame_source = true; settings.main_frame_before_activation_enabled = true; settings.using_synchronous_renderer_compositor = false; - settings.accelerated_animation_enabled = true; settings.can_use_lcd_text = false; settings.use_distance_field_text = false; settings.gpu_rasterization_enabled = false; diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index 57d02bc..7828dcb 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -249,8 +249,6 @@ void RenderWidgetCompositor::Initialize(float device_scale_factor) { settings.main_frame_before_activation_enabled = cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); - settings.accelerated_animation_enabled = - compositor_deps_->IsThreadedAnimationEnabled(); settings.use_mouse_wheel_gestures = UseGestureBasedWheelScrolling(); settings.default_tile_size = CalculateDefaultTileSize(device_scale_factor); diff --git a/content/test/web_layer_tree_view_impl_for_testing.cc b/content/test/web_layer_tree_view_impl_for_testing.cc index 8a42c14..7e05571 100644 --- a/content/test/web_layer_tree_view_impl_for_testing.cc +++ b/content/test/web_layer_tree_view_impl_for_testing.cc @@ -40,9 +40,6 @@ void WebLayerTreeViewImplForTesting::Initialize() { // to keep content always crisp when possible. settings.layer_transforms_should_scale_layer_contents = true; - // Accelerated animations are enabled for unit tests. - settings.accelerated_animation_enabled = true; - cc::LayerTreeHost::InitParams params; params.client = this; params.settings = &settings; |