diff options
| author | loyso <loyso@chromium.org> | 2016-03-01 16:42:56 -0800 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2016-03-02 00:44:20 +0000 |
| commit | 510a9b6ff13b7d569c98c847b2e83155501a4769 (patch) | |
| tree | 2f7f31f56ae401fed2fb7ed2a3283f0b664187e9 | |
| parent | fbba117c73585e84dda88fd8e5b3e751e43bc99c (diff) | |
| download | chromium_src-510a9b6ff13b7d569c98c847b2e83155501a4769.zip chromium_src-510a9b6ff13b7d569c98c847b2e83155501a4769.tar.gz chromium_src-510a9b6ff13b7d569c98c847b2e83155501a4769.tar.bz2 | |
Blink Compositor Animation: Erase old animation system.
Basically, specialize all the code as if use_compositor_animation_timelines is always true.
Next CL: Erase cc::LayerSettings everywhere.
BUG=575041
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1739743003
Cr-Commit-Position: refs/heads/master@{#378629}
54 files changed, 112 insertions, 435 deletions
diff --git a/cc/blink/web_content_layer_impl.cc b/cc/blink/web_content_layer_impl.cc index 458b398..c55f2ec 100644 --- a/cc/blink/web_content_layer_impl.cc +++ b/cc/blink/web_content_layer_impl.cc @@ -9,6 +9,7 @@ #include "base/command_line.h" #include "cc/base/switches.h" #include "cc/blink/web_display_item_list_impl.h" +#include "cc/layers/layer_settings.h" #include "cc/layers/picture_layer.h" #include "cc/playback/display_item_list_settings.h" #include "third_party/WebKit/public/platform/WebContentLayerClient.h" @@ -51,8 +52,8 @@ PaintingControlToWeb( WebContentLayerImpl::WebContentLayerImpl(blink::WebContentLayerClient* client) : client_(client) { - layer_ = make_scoped_ptr(new WebLayerImpl( - PictureLayer::Create(WebLayerImpl::LayerSettings(), this))); + layer_ = make_scoped_ptr( + new WebLayerImpl(PictureLayer::Create(cc::LayerSettings(), this))); layer_->layer()->SetIsDrawable(true); } diff --git a/cc/blink/web_external_texture_layer_impl.cc b/cc/blink/web_external_texture_layer_impl.cc index 3b6f709..e97b50e 100644 --- a/cc/blink/web_external_texture_layer_impl.cc +++ b/cc/blink/web_external_texture_layer_impl.cc @@ -6,6 +6,7 @@ #include "cc/blink/web_external_bitmap_impl.h" #include "cc/blink/web_layer_impl.h" +#include "cc/layers/layer_settings.h" #include "cc/layers/texture_layer.h" #include "cc/resources/single_release_callback.h" #include "cc/resources/texture_mailbox.h" @@ -25,7 +26,7 @@ WebExternalTextureLayerImpl::WebExternalTextureLayerImpl( : client_(client) { cc::TextureLayerClient* cc_client = client_ ? this : nullptr; scoped_refptr<TextureLayer> layer = - TextureLayer::CreateForMailbox(WebLayerImpl::LayerSettings(), cc_client); + TextureLayer::CreateForMailbox(cc::LayerSettings(), cc_client); layer->SetIsDrawable(true); layer_.reset(new WebLayerImpl(layer)); } diff --git a/cc/blink/web_image_layer_impl.cc b/cc/blink/web_image_layer_impl.cc index 8654549..e3b7421 100644 --- a/cc/blink/web_image_layer_impl.cc +++ b/cc/blink/web_image_layer_impl.cc @@ -6,6 +6,7 @@ #include "cc/blink/web_layer_impl.h" #include "cc/blink/web_layer_impl_fixed_bounds.h" +#include "cc/layers/layer_settings.h" #include "cc/layers/picture_image_layer.h" #include "third_party/skia/include/core/SkImage.h" @@ -13,7 +14,7 @@ namespace cc_blink { WebImageLayerImpl::WebImageLayerImpl() { layer_.reset(new WebLayerImplFixedBounds( - cc::PictureImageLayer::Create(WebLayerImpl::LayerSettings()))); + cc::PictureImageLayer::Create(cc::LayerSettings()))); } WebImageLayerImpl::~WebImageLayerImpl() { diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc index 5c5dd2c..0512cf5 100644 --- a/cc/blink/web_layer_impl.cc +++ b/cc/blink/web_layer_impl.cc @@ -11,15 +11,12 @@ #include <vector> #include "base/bind.h" -#include "base/lazy_instance.h" #include "base/strings/string_util.h" #include "base/threading/thread_checker.h" #include "base/trace_event/trace_event_impl.h" -#include "cc/animation/animation.h" #include "cc/base/region.h" #include "cc/base/switches.h" #include "cc/blink/web_blend_mode.h" -#include "cc/blink/web_to_cc_animation_delegate_adapter.h" #include "cc/layers/layer.h" #include "cc/layers/layer_position_constraint.h" #include "cc/layers/layer_settings.h" @@ -43,37 +40,19 @@ using blink::WebSize; using blink::WebColor; namespace cc_blink { -namespace { - -base::LazyInstance<cc::LayerSettings> g_layer_settings = - LAZY_INSTANCE_INITIALIZER; - -} // namespace WebLayerImpl::WebLayerImpl() - : layer_(Layer::Create(LayerSettings())), contents_opaque_is_fixed_(false) { -} + : layer_(Layer::Create(cc::LayerSettings())), + contents_opaque_is_fixed_(false) {} WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) : layer_(layer), contents_opaque_is_fixed_(false) { } WebLayerImpl::~WebLayerImpl() { - if (animation_delegate_adapter_.get()) - layer_->set_layer_animation_delegate(nullptr); layer_->SetLayerClient(nullptr); } -// static -void WebLayerImpl::SetLayerSettings(const cc::LayerSettings& settings) { - g_layer_settings.Get() = settings; -} - -// static -const cc::LayerSettings& WebLayerImpl::LayerSettings() { - return g_layer_settings.Get(); -} - int WebLayerImpl::id() const { return layer_->id(); } @@ -235,35 +214,7 @@ void WebLayerImpl::setBackgroundFilters(const cc::FilterOperations& filters) { layer_->SetBackgroundFilters(filters); } -void WebLayerImpl::setAnimationDelegate( - blink::WebCompositorAnimationDelegate* delegate) { - if (!delegate) { - animation_delegate_adapter_.reset(); - layer_->set_layer_animation_delegate(nullptr); - return; - } - animation_delegate_adapter_.reset( - new WebToCCAnimationDelegateAdapter(delegate)); - layer_->set_layer_animation_delegate(animation_delegate_adapter_.get()); -} - -bool WebLayerImpl::addAnimation(cc::Animation* animation) { - return layer_->AddAnimation(make_scoped_ptr(animation)); -} - -void WebLayerImpl::removeAnimation(int animation_id) { - layer_->RemoveAnimation(animation_id); -} - -void WebLayerImpl::pauseAnimation(int animation_id, double time_offset) { - layer_->PauseAnimation(animation_id, time_offset); -} - -void WebLayerImpl::abortAnimation(int animation_id) { - layer_->AbortAnimation(animation_id); -} - -bool WebLayerImpl::hasActiveAnimation() { +bool WebLayerImpl::hasActiveAnimationForTesting() { return layer_->HasActiveAnimation(); } diff --git a/cc/blink/web_layer_impl.h b/cc/blink/web_layer_impl.h index 04fc7f1..85726d2 100644 --- a/cc/blink/web_layer_impl.h +++ b/cc/blink/web_layer_impl.h @@ -39,7 +39,6 @@ class ConvertableToTraceFormat; } namespace cc { -class Animation; class FilterOperations; class Layer; class LayerSettings; @@ -47,18 +46,12 @@ class LayerSettings; namespace cc_blink { -class WebToCCAnimationDelegateAdapter; - class WebLayerImpl : public blink::WebLayer { public: CC_BLINK_EXPORT WebLayerImpl(); CC_BLINK_EXPORT explicit WebLayerImpl(scoped_refptr<cc::Layer>); ~WebLayerImpl() override; - CC_BLINK_EXPORT static void SetLayerSettings( - const cc::LayerSettings& settings); - CC_BLINK_EXPORT static const cc::LayerSettings& LayerSettings(); - CC_BLINK_EXPORT cc::Layer* layer() const; // If set to true, content opaqueness cannot be changed using setOpaque. @@ -106,13 +99,7 @@ class WebLayerImpl : public blink::WebLayer { blink::WebColor backgroundColor() const override; void setFilters(const cc::FilterOperations& filters) override; void setBackgroundFilters(const cc::FilterOperations& filters) override; - void setAnimationDelegate( - blink::WebCompositorAnimationDelegate* delegate) override; - bool addAnimation(cc::Animation* animation) override; - void removeAnimation(int animation_id) override; - void pauseAnimation(int animation_id, double time_offset) override; - void abortAnimation(int animation_id) override; - bool hasActiveAnimation() override; + bool hasActiveAnimationForTesting() override; void setForceRenderSurface(bool force) override; void setScrollPositionDouble(blink::WebDoublePoint position) override; blink::WebDoublePoint scrollPositionDouble() const override; @@ -162,8 +149,6 @@ class WebLayerImpl : public blink::WebLayer { bool contents_opaque_is_fixed_; private: - scoped_ptr<WebToCCAnimationDelegateAdapter> animation_delegate_adapter_; - DISALLOW_COPY_AND_ASSIGN(WebLayerImpl); }; diff --git a/cc/blink/web_layer_impl_fixed_bounds_unittest.cc b/cc/blink/web_layer_impl_fixed_bounds_unittest.cc index 86b6d314..ad9b1e1 100644 --- a/cc/blink/web_layer_impl_fixed_bounds_unittest.cc +++ b/cc/blink/web_layer_impl_fixed_bounds_unittest.cc @@ -91,7 +91,7 @@ void CompareFixedBoundsLayerAndNormalLayer(const WebFloatPoint& anchor_point, scoped_ptr<WebLayerImplFixedBounds> root_layer(new WebLayerImplFixedBounds()); WebLayerImplFixedBounds* fixed_bounds_layer = new WebLayerImplFixedBounds( - cc::PictureImageLayer::Create(WebLayerImpl::LayerSettings())); + cc::PictureImageLayer::Create(cc::LayerSettings())); fixed_bounds_layer->setBounds(bounds); fixed_bounds_layer->SetFixedBounds(fixed_bounds); fixed_bounds_layer->setTransform(transform.matrix()); diff --git a/cc/blink/web_scrollbar_layer_impl.cc b/cc/blink/web_scrollbar_layer_impl.cc index f96cf89..905d36b 100644 --- a/cc/blink/web_scrollbar_layer_impl.cc +++ b/cc/blink/web_scrollbar_layer_impl.cc @@ -7,6 +7,7 @@ #include "cc/blink/scrollbar_impl.h" #include "cc/blink/web_layer_impl.h" #include "cc/layers/layer.h" +#include "cc/layers/layer_settings.h" #include "cc/layers/painted_scrollbar_layer.h" #include "cc/layers/scrollbar_layer_interface.h" #include "cc/layers/solid_color_scrollbar_layer.h" @@ -31,7 +32,7 @@ WebScrollbarLayerImpl::WebScrollbarLayerImpl( blink::WebScrollbarThemePainter painter, blink::WebScrollbarThemeGeometry* geometry) : layer_(new WebLayerImpl(PaintedScrollbarLayer::Create( - WebLayerImpl::LayerSettings(), + cc::LayerSettings(), scoped_ptr<cc::Scrollbar>( new ScrollbarImpl(make_scoped_ptr(scrollbar), painter, @@ -44,13 +45,12 @@ WebScrollbarLayerImpl::WebScrollbarLayerImpl( int track_start, bool is_left_side_vertical_scrollbar) : layer_(new WebLayerImpl( - SolidColorScrollbarLayer::Create(WebLayerImpl::LayerSettings(), + SolidColorScrollbarLayer::Create(cc::LayerSettings(), ConvertOrientation(orientation), thumb_thickness, track_start, is_left_side_vertical_scrollbar, - 0))) { -} + 0))) {} WebScrollbarLayerImpl::~WebScrollbarLayerImpl() { } diff --git a/cc/layers/video_layer.h b/cc/layers/video_layer.h index a59f1cc..fdc9753 100644 --- a/cc/layers/video_layer.h +++ b/cc/layers/video_layer.h @@ -9,6 +9,7 @@ #include "base/macros.h" #include "cc/base/cc_export.h" #include "cc/layers/layer.h" +#include "cc/layers/layer_settings.h" #include "media/base/video_rotation.h" namespace media { class VideoFrame; } diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index ab1a963..cef7094 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -14570,12 +14570,6 @@ Please check your email at <ph name="ACCOUNT_EMAIL">$2<ex>jane.doe@gmail.com</ex Adjusts scroll position to prevent visible jumps when offscreen content changes. </message> - <message name="IDS_FLAGS_DISABLE_COMPOSITOR_ANIMATION_TIMELINES" desc="Name of the 'Disable Compositor animation timelines' lab."> - Disable compositor animation timelines in renderers. - </message> - <message name="IDS_FLAGS_DISABLE_COMPOSITOR_ANIMATION_TIMELINES_DESCRIPTION" desc="Description of the 'Disable Compositor animation timelines' lab."> - Use old intrusive animation subsystem for composited animations in renderers. - </message> <if expr="not is_android"> <message name="IDS_FLAGS_DISABLE_UI_COMPOSITOR_ANIMATION_TIMELINES" desc="Name of the 'Disable UI Compositor animation timelines' lab."> Disable UI compositor animation timelines diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index dbda6c5..afc2989 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1781,11 +1781,6 @@ const FeatureEntry kFeatureEntries[] = { {"enable-scroll-anchoring", IDS_FLAGS_ENABLE_SCROLL_ANCHORING_NAME, IDS_FLAGS_ENABLE_SCROLL_ANCHORING_DESCRIPTION, kOsAll, FEATURE_VALUE_TYPE(features::kScrollAnchoring)}, - {"disable-compositor-animation-timelines", - IDS_FLAGS_DISABLE_COMPOSITOR_ANIMATION_TIMELINES, - IDS_FLAGS_DISABLE_COMPOSITOR_ANIMATION_TIMELINES_DESCRIPTION, - kOsAll, SINGLE_DISABLE_VALUE_TYPE( - switches::kDisableCompositorAnimationTimelines)}, #if !defined(OS_ANDROID) {"ui-disable-compositor-animation-timelines", IDS_FLAGS_DISABLE_UI_COMPOSITOR_ANIMATION_TIMELINES, diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index 43eb77a..cbbd8c7 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -78,7 +78,6 @@ void DeriveCommandLine(const GURL& start_url, ::switches::kDisableAcceleratedVideoDecode, ::switches::kDisableBlinkFeatures, ::switches::kDisableCastStreamingHWEncoding, - ::switches::kDisableCompositorAnimationTimelines, ::switches::kDisableDistanceFieldText, ::switches::kDisableGpu, ::switches::kDisableGpuMemoryBufferVideoFrames, diff --git a/components/test_runner/test_plugin.cc b/components/test_runner/test_plugin.cc index e12a1ea..df4af24 100644 --- a/components/test_runner/test_plugin.cc +++ b/components/test_runner/test_plugin.cc @@ -13,6 +13,7 @@ #include "base/memory/shared_memory.h" #include "base/strings/stringprintf.h" #include "cc/blink/web_layer_impl.h" +#include "cc/layers/layer_settings.h" #include "cc/layers/texture_layer.h" #include "cc/resources/shared_bitmap_manager.h" #include "components/test_runner/web_test_delegate.h" @@ -208,7 +209,7 @@ bool TestPlugin::initialize(blink::WebPluginContainer* container) { return false; layer_ = cc::TextureLayer::CreateForMailbox( - cc_blink::WebLayerImpl::LayerSettings(), this); + cc::LayerSettings(), this); web_layer_ = make_scoped_ptr(new cc_blink::WebLayerImpl(layer_)); container_ = container; container_->setWebLayer(web_layer_.get()); diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 83ffb22..dff82b6 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1395,7 +1395,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( switches::kDisableAcceleratedVideoDecode, switches::kDisableBlinkFeatures, switches::kDisableBreakpad, - switches::kDisableCompositorAnimationTimelines, switches::kDisablePreferCompositingToLCDText, switches::kDisableDatabases, switches::kDisableDelayAgnosticAec, diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 22afe19..c198a7b 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -96,10 +96,6 @@ const char kDisableBackingStoreLimit[] = "disable-backing-store-limit"; // features. const char kDisableBlinkFeatures[] = "disable-blink-features"; -// Disables new cc/animation system (Project Heaviside). crbug.com/394772 -const char kDisableCompositorAnimationTimelines[] = - "disable-compositor-animation-timelines"; - // Disables HTML5 DB support. const char kDisableDatabases[] = "disable-databases"; diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index aef75bf..c480a26 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -36,7 +36,6 @@ CONTENT_EXPORT extern const char kDisableAcceleratedMjpegDecode[]; CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[]; extern const char kDisableBackingStoreLimit[]; CONTENT_EXPORT extern const char kDisableBlinkFeatures[]; -CONTENT_EXPORT extern const char kDisableCompositorAnimationTimelines[]; CONTENT_EXPORT extern const char kDisableDatabases[]; CONTENT_EXPORT extern const char kDisableDelayAgnosticAec[]; extern const char kDisableDirectNPAPIRequests[]; diff --git a/content/renderer/child_frame_compositing_helper.cc b/content/renderer/child_frame_compositing_helper.cc index 74e7eaa..2392e7b 100644 --- a/content/renderer/child_frame_compositing_helper.cc +++ b/content/renderer/child_frame_compositing_helper.cc @@ -7,6 +7,7 @@ #include <utility> #include "cc/blink/web_layer_impl.h" +#include "cc/layers/layer_settings.h" #include "cc/layers/solid_color_layer.h" #include "cc/layers/surface_layer.h" #include "cc/output/context_provider.h" @@ -112,7 +113,7 @@ void ChildFrameCompositingHelper::OnContainerDestroy() { void ChildFrameCompositingHelper::ChildFrameGone() { scoped_refptr<cc::SolidColorLayer> crashed_layer = - cc::SolidColorLayer::Create(cc_blink::WebLayerImpl::LayerSettings()); + cc::SolidColorLayer::Create(cc::LayerSettings()); crashed_layer->SetMasksToBounds(true); crashed_layer->SetBackgroundColor(SkColorSetARGBInline(255, 0, 128, 0)); blink::WebLayer* layer = new cc_blink::WebLayerImpl(crashed_layer); @@ -184,7 +185,7 @@ void ChildFrameCompositingHelper::OnSetSurface( sender, host_routing_id_, browser_plugin_->browser_plugin_instance_id()); scoped_refptr<cc::SurfaceLayer> surface_layer = - cc::SurfaceLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), + cc::SurfaceLayer::Create(cc::LayerSettings(), satisfy_callback, require_callback); // TODO(oshima): This is a stopgap fix so that the compositor does not // scaledown the content when 2x frame data is added to 1x parent frame data. diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index 2d97eca..6f22034 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -251,12 +251,7 @@ void RenderWidgetCompositor::Initialize(float device_scale_factor) { !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); settings.accelerated_animation_enabled = compositor_deps_->IsThreadedAnimationEnabled(); - - settings.use_compositor_animation_timelines = - !cmd->HasSwitch(switches::kDisableCompositorAnimationTimelines); - blink::WebRuntimeFeatures::enableCompositorAnimationTimelines( - settings.use_compositor_animation_timelines); - + settings.use_compositor_animation_timelines = true; settings.use_mouse_wheel_gestures = UseGestureBasedWheelScrolling(); settings.default_tile_size = CalculateDefaultTileSize(device_scale_factor); @@ -693,11 +688,6 @@ void RenderWidgetCompositor::didStopFlinging() { layer_tree_host_->DidStopFlinging(); } -void RenderWidgetCompositor::registerForAnimations(blink::WebLayer* layer) { - cc::Layer* cc_layer = static_cast<cc_blink::WebLayerImpl*>(layer)->layer(); - cc_layer->RegisterForAnimations(layer_tree_host_->animation_registrar()); -} - void RenderWidgetCompositor::registerViewportLayers( const blink::WebLayer* overscrollElasticityLayer, const blink::WebLayer* pageScaleLayer, diff --git a/content/renderer/gpu/render_widget_compositor.h b/content/renderer/gpu/render_widget_compositor.h index 97b5838..b878a3e 100644 --- a/content/renderer/gpu/render_widget_compositor.h +++ b/content/renderer/gpu/render_widget_compositor.h @@ -126,7 +126,6 @@ class CONTENT_EXPORT RenderWidgetCompositor void compositeAndReadbackAsync( blink::WebCompositeAndReadbackAsyncCallback* callback) override; void setDeferCommits(bool defer_commits) override; - void registerForAnimations(blink::WebLayer* layer) override; void registerViewportLayers( const blink::WebLayer* overscrollElasticityLayer, const blink::WebLayer* pageScaleLayer, diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc index 9047971..4a7dee4 100644 --- a/content/renderer/media/android/webmediaplayer_android.cc +++ b/content/renderer/media/android/webmediaplayer_android.cc @@ -958,7 +958,7 @@ void WebMediaPlayerAndroid::OnVideoSizeChanged(int width, int height) { // Lazily allocate compositing layer. if (!video_weblayer_) { video_weblayer_.reset(new cc_blink::WebLayerImpl( - cc::VideoLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), this, + cc::VideoLayer::Create(cc::LayerSettings(), this, media::VIDEO_ROTATION_0))); client_->setWebLayer(video_weblayer_.get()); } diff --git a/content/renderer/media/webmediaplayer_ms.cc b/content/renderer/media/webmediaplayer_ms.cc index d2ecb54..0a72630 100644 --- a/content/renderer/media/webmediaplayer_ms.cc +++ b/content/renderer/media/webmediaplayer_ms.cc @@ -14,6 +14,7 @@ #include "build/build_config.h" #include "cc/blink/context_provider_web_context.h" #include "cc/blink/web_layer_impl.h" +#include "cc/layers/layer_settings.h" #include "cc/layers/video_frame_provider_client_impl.h" #include "cc/layers/video_layer.h" #include "content/public/renderer/media_stream_audio_renderer.h" @@ -492,7 +493,7 @@ void WebMediaPlayerMS::OnFrameAvailable( if (video_frame_provider_.get()) { video_weblayer_.reset(new cc_blink::WebLayerImpl( - cc::VideoLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), + cc::VideoLayer::Create(cc::LayerSettings(), compositor_.get(), media::VIDEO_ROTATION_0))); video_weblayer_->layer()->SetContentsOpaque(true); video_weblayer_->SetContentsOpaqueIsFixed(true); diff --git a/content/renderer/npapi/webplugin_impl.cc b/content/renderer/npapi/webplugin_impl.cc index 9a7714d..c5a5302 100644 --- a/content/renderer/npapi/webplugin_impl.cc +++ b/content/renderer/npapi/webplugin_impl.cc @@ -19,6 +19,7 @@ #include "build/build_config.h" #include "cc/blink/web_layer_impl.h" #include "cc/layers/io_surface_layer.h" +#include "cc/layers/layer_settings.h" #include "content/child/appcache/web_application_cache_host_impl.h" #include "content/child/multipart_response_delegate.h" #include "content/child/npapi/plugin_host.h" @@ -577,7 +578,7 @@ void WebPluginImpl::AcceleratedPluginSwappedIOSurface() { if (next_io_surface_id_) { if (!io_surface_layer_.get()) { io_surface_layer_ = - cc::IOSurfaceLayer::Create(cc_blink::WebLayerImpl::LayerSettings()); + cc::IOSurfaceLayer::Create(cc::LayerSettings()); web_layer_.reset(new cc_blink::WebLayerImpl(io_surface_layer_)); container_->setWebLayer(web_layer_.get()); } diff --git a/content/renderer/pepper/pepper_compositor_host.cc b/content/renderer/pepper/pepper_compositor_host.cc index 3225424..fa3ef5f 100644 --- a/content/renderer/pepper/pepper_compositor_host.cc +++ b/content/renderer/pepper/pepper_compositor_host.cc @@ -12,6 +12,7 @@ #include "base/memory/shared_memory.h" #include "cc/blink/web_layer_impl.h" #include "cc/layers/layer.h" +#include "cc/layers/layer_settings.h" #include "cc/layers/solid_color_layer.h" #include "cc/layers/texture_layer.h" #include "cc/resources/texture_mailbox.h" @@ -156,7 +157,7 @@ PepperCompositorHost::PepperCompositorHost( : ResourceHost(host->GetPpapiHost(), instance, resource), bound_instance_(NULL), weak_factory_(this) { - layer_ = cc::Layer::Create(cc_blink::WebLayerImpl::LayerSettings()); + layer_ = cc::Layer::Create(cc::LayerSettings()); // TODO(penghuang): SetMasksToBounds() can be expensive if the layer is // transformed. Possibly better could be to explicitly clip the child layers // (by modifying their bounds). @@ -243,7 +244,7 @@ void PepperCompositorHost::UpdateLayer( scoped_refptr<cc::Layer> clip_parent = layer->parent(); if (clip_parent.get() == layer_.get()) { // Create a clip parent layer, if it does not exist. - clip_parent = cc::Layer::Create(cc_blink::WebLayerImpl::LayerSettings()); + clip_parent = cc::Layer::Create(cc::LayerSettings()); clip_parent->SetMasksToBounds(true); clip_parent->SetIsDrawable(true); layer_->ReplaceChild(layer.get(), clip_parent); @@ -387,10 +388,10 @@ int32_t PepperCompositorHost::OnHostMsgCommitLayers( if (!cc_layer.get()) { if (pp_layer->color) cc_layer = cc::SolidColorLayer::Create( - cc_blink::WebLayerImpl::LayerSettings()); + cc::LayerSettings()); else if (pp_layer->texture || pp_layer->image) cc_layer = cc::TextureLayer::CreateForMailbox( - cc_blink::WebLayerImpl::LayerSettings(), NULL); + cc::LayerSettings(), NULL); layer_->AddChild(cc_layer); } diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc index 381a133..8b64ac1 100644 --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc @@ -23,6 +23,7 @@ #include "base/trace_event/trace_event.h" #include "build/build_config.h" #include "cc/blink/web_layer_impl.h" +#include "cc/layers/layer_settings.h" #include "cc/layers/texture_layer.h" #include "content/common/content_constants_internal.h" #include "content/common/frame_messages.h" @@ -2039,14 +2040,14 @@ void PepperPluginInstanceImpl::UpdateLayer(bool force_creation) { if (want_3d_layer) { DCHECK(bound_graphics_3d_.get()); texture_layer_ = cc::TextureLayer::CreateForMailbox( - cc_blink::WebLayerImpl::LayerSettings(), NULL); + cc::LayerSettings(), NULL); opaque = bound_graphics_3d_->IsOpaque(); texture_layer_->SetTextureMailboxWithoutReleaseCallback( cc::TextureMailbox(mailbox, sync_token, GL_TEXTURE_2D)); } else { DCHECK(bound_graphics_2d_platform_); texture_layer_ = cc::TextureLayer::CreateForMailbox( - cc_blink::WebLayerImpl::LayerSettings(), this); + cc::LayerSettings(), this); bound_graphics_2d_platform_->AttachedToNewLayer(); opaque = bound_graphics_2d_platform_->IsAlwaysOpaque(); texture_layer_->SetFlipped(false); diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index b695bc8..946fdb5 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -736,10 +736,6 @@ void RenderThreadImpl::Init() { const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); - cc::LayerSettings layer_settings; - layer_settings.use_compositor_animation_timelines = - !command_line.HasSwitch(switches::kDisableCompositorAnimationTimelines); - cc_blink::WebLayerImpl::SetLayerSettings(layer_settings); cc::SetClientNameForMetrics("Renderer"); is_threaded_animation_enabled_ = diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc index af042d8..b9c6b39 100644 --- a/content/test/test_blink_web_unit_test_support.cc +++ b/content/test/test_blink_web_unit_test_support.cc @@ -131,12 +131,6 @@ TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() { blink::WebConnectionType::WebConnectionTypeUnknown, std::numeric_limits<double>::infinity()); - // External cc::AnimationHost is enabled for unit tests. - cc::LayerSettings layer_settings; - layer_settings.use_compositor_animation_timelines = true; - cc_blink::WebLayerImpl::SetLayerSettings(layer_settings); - blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(true); - // Initialize libraries for media and enable the media player. media::InitializeMediaLibrary(); blink::WebRuntimeFeatures::enableMediaPlayer(true); 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 0c0559c..53e6d44 100644 --- a/content/test/web_layer_tree_view_impl_for_testing.cc +++ b/content/test/web_layer_tree_view_impl_for_testing.cc @@ -149,12 +149,6 @@ void WebLayerTreeViewImplForTesting::DidFailToInitializeOutputSurface() { NOTREACHED(); } -void WebLayerTreeViewImplForTesting::registerForAnimations( - blink::WebLayer* layer) { - cc::Layer* cc_layer = static_cast<cc_blink::WebLayerImpl*>(layer)->layer(); - cc_layer->RegisterForAnimations(layer_tree_host_->animation_registrar()); -} - void WebLayerTreeViewImplForTesting::registerViewportLayers( const blink::WebLayer* overscrollElasticityLayer, const blink::WebLayer* pageScaleLayer, diff --git a/content/test/web_layer_tree_view_impl_for_testing.h b/content/test/web_layer_tree_view_impl_for_testing.h index e309d9c..a67115b 100644 --- a/content/test/web_layer_tree_view_impl_for_testing.h +++ b/content/test/web_layer_tree_view_impl_for_testing.h @@ -56,7 +56,6 @@ class WebLayerTreeViewImplForTesting void setNeedsAnimate() override; void didStopFlinging() override; void setDeferCommits(bool defer_commits) override; - void registerForAnimations(blink::WebLayer* layer) override; void registerViewportLayers( const blink::WebLayer* overscrollElasticityLayer, const blink::WebLayer* pageScaleLayerLayer, diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc index 505ad7e..408569c 100644 --- a/media/blink/webmediaplayer_impl.cc +++ b/media/blink/webmediaplayer_impl.cc @@ -1000,9 +1000,8 @@ void WebMediaPlayerImpl::OnPipelineMetadata( if (hasVideo()) { DCHECK(!video_weblayer_); - scoped_refptr<cc::VideoLayer> layer = - cc::VideoLayer::Create(cc_blink::WebLayerImpl::LayerSettings(), - compositor_, pipeline_metadata_.video_rotation); + scoped_refptr<cc::VideoLayer> layer = cc::VideoLayer::Create( + cc::LayerSettings(), compositor_, pipeline_metadata_.video_rotation); if (pipeline_metadata_.video_rotation == VIDEO_ROTATION_90 || pipeline_metadata_.video_rotation == VIDEO_ROTATION_270) { diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp index d424f09..38bb75c 100644 --- a/third_party/WebKit/Source/core/animation/Animation.cpp +++ b/third_party/WebKit/Source/core/animation/Animation.cpp @@ -901,7 +901,7 @@ void Animation::endUpdatingState() void Animation::createCompositorPlayer() { - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer) { + if (Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer) { ASSERT(Platform::current()->compositorSupport()); m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimationPlayer()); ASSERT(m_compositorPlayer); @@ -943,7 +943,7 @@ void Animation::detachCompositorTimeline() void Animation::attachCompositedLayers() { - if (!RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() || !m_compositorPlayer) + if (!m_compositorPlayer) return; ASSERT(m_content); @@ -961,7 +961,6 @@ void Animation::detachCompositedLayers() void Animation::notifyAnimationStarted(double monotonicTime, int group) { - ASSERT(RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()); timeline()->document()->compositorPendingAnimations().notifyCompositorAnimationStarted(monotonicTime, group); } diff --git a/third_party/WebKit/Source/core/animation/AnimationTimeline.cpp b/third_party/WebKit/Source/core/animation/AnimationTimeline.cpp index 74ab566..cb4fc16 100644 --- a/third_party/WebKit/Source/core/animation/AnimationTimeline.cpp +++ b/third_party/WebKit/Source/core/animation/AnimationTimeline.cpp @@ -79,7 +79,7 @@ AnimationTimeline::AnimationTimeline(Document* document, PlatformTiming* timing) else m_timing = timing; - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platform::current()->isThreadedAnimationEnabled()) + if (Platform::current()->isThreadedAnimationEnabled()) m_compositorTimeline = adoptPtr(CompositorFactory::current().createAnimationTimeline()); ASSERT(document); diff --git a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp index 48a9d87..a25dfd6 100644 --- a/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp +++ b/third_party/WebKit/Source/core/animation/CompositorAnimations.cpp @@ -347,25 +347,14 @@ bool CompositorAnimations::startAnimationOnCompositor(const Element& element, in const KeyframeEffectModelBase& keyframeEffect = toKeyframeEffectModelBase(effect); - PaintLayer* layer = toLayoutBoxModelObject(element.layoutObject())->layer(); - ASSERT(layer); - Vector<OwnPtr<CompositorAnimation>> animations; CompositorAnimationsImpl::getAnimationOnCompositor(timing, group, startTime, timeOffset, keyframeEffect, animations, animationPlaybackRate); ASSERT(!animations.isEmpty()); for (auto& compositorAnimation : animations) { int id = compositorAnimation->id(); - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { - CompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer(); - ASSERT(compositorPlayer); - compositorPlayer->addAnimation(compositorAnimation.leakPtr()); - } else if (!layer->compositedLayerMapping()->mainGraphicsLayer()->addAnimation(compositorAnimation.release())) { - // FIXME: We should know ahead of time whether these animations can be started. - for (int startedAnimationId : startedAnimationIds) - cancelAnimationOnCompositor(element, animation, startedAnimationId); - startedAnimationIds.clear(); - return false; - } + CompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer(); + ASSERT(compositorPlayer); + compositorPlayer->addAnimation(compositorAnimation.leakPtr()); startedAnimationIds.append(id); } ASSERT(!startedAnimationIds.isEmpty()); @@ -382,13 +371,9 @@ void CompositorAnimations::cancelAnimationOnCompositor(const Element& element, c // compositing update. return; } - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { - CompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer(); - if (compositorPlayer) - compositorPlayer->removeAnimation(id); - } else { - toLayoutBoxModelObject(element.layoutObject())->layer()->compositedLayerMapping()->mainGraphicsLayer()->removeAnimation(id); - } + CompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer(); + if (compositorPlayer) + compositorPlayer->removeAnimation(id); } void CompositorAnimations::pauseAnimationForTestingOnCompositor(const Element& element, const Animation& animation, int id, double pauseTime) @@ -401,20 +386,13 @@ void CompositorAnimations::pauseAnimationForTestingOnCompositor(const Element& e ASSERT_NOT_REACHED(); return; } - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { - CompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer(); - ASSERT(compositorPlayer); - compositorPlayer->pauseAnimation(id, pauseTime); - } else { - toLayoutBoxModelObject(element.layoutObject())->layer()->compositedLayerMapping()->mainGraphicsLayer()->pauseAnimation(id, pauseTime); - } + CompositorAnimationPlayer* compositorPlayer = animation.compositorPlayer(); + ASSERT(compositorPlayer); + compositorPlayer->pauseAnimation(id, pauseTime); } bool CompositorAnimations::canAttachCompositedLayers(const Element& element, const Animation& animation) { - if (!RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) - return false; - if (!animation.compositorPlayer()) return false; diff --git a/third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp b/third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp index 1a599a7..de66475 100644 --- a/third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp +++ b/third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp @@ -109,18 +109,16 @@ protected: m_keyframeVector5 = createCompositableFloatKeyframeVector(5); m_keyframeAnimationEffect5 = AnimatableValueKeyframeEffectModel::create(*m_keyframeVector5); - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { - EXPECT_CALL(*m_mockCompositorFactory, createAnimationTimeline()) - .WillOnce(Return(new WebCompositorAnimationTimelineMock())); - } + EXPECT_CALL(*m_mockCompositorFactory, createAnimationTimeline()) + .WillOnce(Return(new WebCompositorAnimationTimelineMock())); + m_pageHolder = DummyPageHolder::create(); m_document = &m_pageHolder->document(); m_document->animationClock().resetTimeForTesting(); - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { - EXPECT_CALL(*m_mockCompositorFactory, createAnimationTimeline()) - .WillOnce(Return(new WebCompositorAnimationTimelineMock())); - } + EXPECT_CALL(*m_mockCompositorFactory, createAnimationTimeline()) + .WillOnce(Return(new WebCompositorAnimationTimelineMock())); + m_timeline = AnimationTimeline::create(m_document.get()); m_timeline->resetForTesting(); m_element = m_document->createElement("test", ASSERT_NO_EXCEPTION); diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp index da338ac..e555738 100644 --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp @@ -2394,11 +2394,6 @@ void CompositedLayerMapping::verifyNotPainting() } #endif -void CompositedLayerMapping::notifyAnimationStarted(const GraphicsLayer*, double monotonicTime, int group) -{ - layoutObject()->node()->document().compositorPendingAnimations().notifyCompositorAnimationStarted(monotonicTime, group); -} - void CompositedLayerMapping::notifyFirstPaint() { if (PaintTiming* timing = m_owningLayer.paintTiming()) diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h index 6c35c33..b4288e7 100644 --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h @@ -152,7 +152,6 @@ public: void updateElementIdAndCompositorMutableProperties(); // GraphicsLayerClient interface - void notifyAnimationStarted(const GraphicsLayer*, double monotonicTime, int group) override; void notifyFirstPaint() override; void notifyFirstTextPaint() override; void notifyFirstImagePaint() override; diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp index 5b625b8..0ce4755 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp @@ -701,7 +701,7 @@ void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainTh void ScrollingCoordinator::layerTreeViewInitialized(WebLayerTreeView& layerTreeView) { - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platform::current()->isThreadedAnimationEnabled()) { + if (Platform::current()->isThreadedAnimationEnabled()) { m_programmaticScrollAnimatorTimeline = adoptPtr(CompositorFactory::current().createAnimationTimeline()); layerTreeView.attachCompositorAnimationTimeline(m_programmaticScrollAnimatorTimeline->animationTimeline()); } diff --git a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in index ee18a6b..734fa68 100644 --- a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in +++ b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in @@ -34,8 +34,6 @@ ClientHints status=stable ColumnFill status=stable CompositedSelectionUpdate CompositorWorker status=experimental -// Unified Chrome Compositor and Blink Animations engine (Project Heaviside). crbug.com/394772 -CompositorAnimationTimelines ContextMenu status=experimental CredentialManager status=stable CSS3Text status=experimental diff --git a/third_party/WebKit/Source/platform/animation/CompositorAnimation.cpp b/third_party/WebKit/Source/platform/animation/CompositorAnimation.cpp index 2e8c2cc0..b76d3c2 100644 --- a/third_party/WebKit/Source/platform/animation/CompositorAnimation.cpp +++ b/third_party/WebKit/Source/platform/animation/CompositorAnimation.cpp @@ -201,10 +201,4 @@ scoped_ptr<cc::Animation> CompositorAnimation::passAnimation() return std::move(m_animation); } -cc::Animation* CompositorAnimation::releaseCCAnimation() -{ - m_animation->set_needs_synchronized_start_time(true); - return m_animation.release(); -} - } // namespace blink diff --git a/third_party/WebKit/Source/platform/animation/CompositorAnimation.h b/third_party/WebKit/Source/platform/animation/CompositorAnimation.h index 17d2a65..e4f2b99 100644 --- a/third_party/WebKit/Source/platform/animation/CompositorAnimation.h +++ b/third_party/WebKit/Source/platform/animation/CompositorAnimation.h @@ -71,10 +71,6 @@ public: scoped_ptr<cc::Animation> passAnimation(); - // Removes ownership over cc animation. Identical to PassAnimation. - // TODO(loyso): Erase this method. crbug.com/575041 - cc::Animation* releaseCCAnimation(); - protected: CompositorAnimation(); diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp index e6e5b91..45b6fac 100644 --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp @@ -32,7 +32,6 @@ #include "platform/DragImage.h" #include "platform/JSONValues.h" #include "platform/TraceEvent.h" -#include "platform/animation/CompositorAnimation.h" #include "platform/geometry/FloatRect.h" #include "platform/geometry/LayoutRect.h" #include "platform/graphics/BitmapImage.h" @@ -1122,28 +1121,6 @@ void GraphicsLayer::setContentsToImage(Image* image, RespectImageOrientationEnum setContentsTo(m_imageLayer ? m_imageLayer->layer() : 0); } -bool GraphicsLayer::addAnimation(PassOwnPtr<CompositorAnimation> animation) -{ - ASSERT(animation); - platformLayer()->setAnimationDelegate(this); - return platformLayer()->addAnimation(animation->releaseCCAnimation()); -} - -void GraphicsLayer::pauseAnimation(int animationId, double timeOffset) -{ - platformLayer()->pauseAnimation(animationId, timeOffset); -} - -void GraphicsLayer::removeAnimation(int animationId) -{ - platformLayer()->removeAnimation(animationId); -} - -void GraphicsLayer::abortAnimation(int animationId) -{ - platformLayer()->abortAnimation(animationId); -} - WebLayer* GraphicsLayer::platformLayer() const { return m_layer->layer(); @@ -1208,24 +1185,6 @@ void GraphicsLayer::setScrollableArea(ScrollableArea* scrollableArea, bool isVie m_layer->layer()->setScrollClient(this); } -void GraphicsLayer::notifyAnimationStarted(double monotonicTime, int group) -{ - if (m_client) - m_client->notifyAnimationStarted(this, monotonicTime, group); -} - -void GraphicsLayer::notifyAnimationFinished(double, int group) -{ - if (m_scrollableArea) - m_scrollableArea->notifyCompositorAnimationFinished(group); -} - -void GraphicsLayer::notifyAnimationAborted(double, int group) -{ - if (m_scrollableArea) - m_scrollableArea->notifyCompositorAnimationAborted(group); -} - void GraphicsLayer::didScroll() { if (m_scrollableArea) { diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h index 9dfdf24..88e1335 100644 --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h @@ -46,7 +46,6 @@ #include "platform/graphics/paint/PaintController.h" #include "platform/heap/Handle.h" #include "platform/transforms/TransformationMatrix.h" -#include "public/platform/WebCompositorAnimationDelegate.h" #include "public/platform/WebContentLayer.h" #include "public/platform/WebImageLayer.h" #include "public/platform/WebLayerScrollClient.h" @@ -65,7 +64,6 @@ class LinkHighlight; class JSONObject; class PaintController; class ScrollableArea; -class CompositorAnimation; class WebLayer; typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; @@ -73,7 +71,7 @@ typedef Vector<GraphicsLayer*, 64> GraphicsLayerVector; // GraphicsLayer is an abstraction for a rendering surface with backing store, // which may have associated transformation and animations. -class PLATFORM_EXPORT GraphicsLayer : public WebCompositorAnimationDelegate, public WebLayerScrollClient, public cc::LayerClient, public DisplayItemClient { +class PLATFORM_EXPORT GraphicsLayer : public WebLayerScrollClient, public cc::LayerClient, public DisplayItemClient { WTF_MAKE_NONCOPYABLE(GraphicsLayer); USING_FAST_MALLOC(GraphicsLayer); public: static PassOwnPtr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient*); @@ -194,14 +192,6 @@ public: // Set that the position/size of the contents (image or video). void setContentsRect(const IntRect&); - // Return true if the animation is handled by the compositing system. If this returns - // false, the animation will be run by AnimationController. - // These methods handle both transitions and keyframe animations. - bool addAnimation(PassOwnPtr<CompositorAnimation>); - void pauseAnimation(int animationId, double /*timeOffset*/); - void removeAnimation(int animationId); - void abortAnimation(int animationId); - // Layer contents void setContentsToImage(Image*, RespectImageOrientationEnum = DoNotRespectImageOrientation); void setContentsToPlatformLayer(WebLayer* layer) { setContentsTo(layer); } @@ -242,11 +232,6 @@ public: IntRect interestRect(); void paint(const IntRect* interestRect, GraphicsContext::DisabledMode = GraphicsContext::NothingDisabled); - // WebCompositorAnimationDelegate implementation. - void notifyAnimationStarted(double monotonicTime, int group) override; - void notifyAnimationFinished(double monotonicTime, int group) override; - void notifyAnimationAborted(double monotonicTime, int group) override; - // WebLayerScrollClient implementation. void didScroll() override; diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayerClient.h b/third_party/WebKit/Source/platform/graphics/GraphicsLayerClient.h index ad43c2f..0599b0c 100644 --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayerClient.h +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayerClient.h @@ -63,9 +63,6 @@ class PLATFORM_EXPORT GraphicsLayerClient { public: virtual ~GraphicsLayerClient() {} - // Callback for when compositor animation started. - virtual void notifyAnimationStarted(const GraphicsLayer*, double monotonicTime, int group) { } - virtual void notifyFirstPaint() { } virtual void notifyFirstTextPaint() { } virtual void notifyFirstImagePaint() { } diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp index 19d00f2..3aed494 100644 --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayerTest.cpp @@ -118,69 +118,47 @@ public: TEST_F(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations) { - ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); + ASSERT_FALSE(m_platformLayer->hasActiveAnimationForTesting()); OwnPtr<CompositorFloatAnimationCurve> curve = adoptPtr(CompositorFactory::current().createFloatAnimationCurve()); curve->add(CompositorFloatKeyframe(0.0, 0.0)); OwnPtr<CompositorAnimation> floatAnimation(adoptPtr(CompositorFactory::current().createAnimation(*curve, CompositorTargetProperty::OPACITY))); int animationId = floatAnimation->id(); - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { - OwnPtr<CompositorAnimationTimeline> compositorTimeline = adoptPtr(CompositorFactory::current().createAnimationTimeline()); - AnimationPlayerForTesting player; + OwnPtr<CompositorAnimationTimeline> compositorTimeline = adoptPtr(CompositorFactory::current().createAnimationTimeline()); + AnimationPlayerForTesting player; - layerTreeView()->attachCompositorAnimationTimeline(compositorTimeline->animationTimeline()); - compositorTimeline->playerAttached(player); + layerTreeView()->attachCompositorAnimationTimeline(compositorTimeline->animationTimeline()); + compositorTimeline->playerAttached(player); - player.compositorPlayer()->attachLayer(m_platformLayer); - ASSERT_TRUE(player.compositorPlayer()->isLayerAttached()); + player.compositorPlayer()->attachLayer(m_platformLayer); + ASSERT_TRUE(player.compositorPlayer()->isLayerAttached()); - player.compositorPlayer()->addAnimation(floatAnimation.leakPtr()); + player.compositorPlayer()->addAnimation(floatAnimation.leakPtr()); - ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); + ASSERT_TRUE(m_platformLayer->hasActiveAnimationForTesting()); - m_graphicsLayer->setShouldFlattenTransform(false); + m_graphicsLayer->setShouldFlattenTransform(false); - m_platformLayer = m_graphicsLayer->platformLayer(); - ASSERT_TRUE(m_platformLayer); - - ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); - player.compositorPlayer()->removeAnimation(animationId); - ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); - - m_graphicsLayer->setShouldFlattenTransform(true); - - m_platformLayer = m_graphicsLayer->platformLayer(); - ASSERT_TRUE(m_platformLayer); - - ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); + m_platformLayer = m_graphicsLayer->platformLayer(); + ASSERT_TRUE(m_platformLayer); - player.compositorPlayer()->detachLayer(); - ASSERT_FALSE(player.compositorPlayer()->isLayerAttached()); + ASSERT_TRUE(m_platformLayer->hasActiveAnimationForTesting()); + player.compositorPlayer()->removeAnimation(animationId); + ASSERT_FALSE(m_platformLayer->hasActiveAnimationForTesting()); - compositorTimeline->playerDestroyed(player); - layerTreeView()->detachCompositorAnimationTimeline(compositorTimeline->animationTimeline()); - } else { - ASSERT_TRUE(m_platformLayer->addAnimation(floatAnimation->releaseCCAnimation())); + m_graphicsLayer->setShouldFlattenTransform(true); - ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); + m_platformLayer = m_graphicsLayer->platformLayer(); + ASSERT_TRUE(m_platformLayer); - m_graphicsLayer->setShouldFlattenTransform(false); + ASSERT_FALSE(m_platformLayer->hasActiveAnimationForTesting()); - m_platformLayer = m_graphicsLayer->platformLayer(); - ASSERT_TRUE(m_platformLayer); - - ASSERT_TRUE(m_platformLayer->hasActiveAnimation()); - m_platformLayer->removeAnimation(animationId); - ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); - - m_graphicsLayer->setShouldFlattenTransform(true); + player.compositorPlayer()->detachLayer(); + ASSERT_FALSE(player.compositorPlayer()->isLayerAttached()); - m_platformLayer = m_graphicsLayer->platformLayer(); - ASSERT_TRUE(m_platformLayer); - - ASSERT_FALSE(m_platformLayer->hasActiveAnimation()); - } + compositorTimeline->playerDestroyed(player); + layerTreeView()->detachCompositorAnimationTimeline(compositorTimeline->animationTimeline()); } class FakeScrollableArea : public NoBaseWillBeGarbageCollectedFinalized<FakeScrollableArea>, public ScrollableArea { diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp index 798d468..a7e33e2 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp +++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimatorCompositorCoordinator.cpp @@ -25,12 +25,9 @@ ScrollAnimatorCompositorCoordinator::ScrollAnimatorCompositorCoordinator() #if ENABLE(OILPAN) ThreadState::current()->registerPreFinalizer(this); #endif - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { - ASSERT(Platform::current()->compositorSupport()); - m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimationPlayer()); - ASSERT(m_compositorPlayer); - m_compositorPlayer->setAnimationDelegate(this); - } + m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimationPlayer()); + ASSERT(m_compositorPlayer); + m_compositorPlayer->setAnimationDelegate(this); } ScrollAnimatorCompositorCoordinator::~ScrollAnimatorCompositorCoordinator() @@ -42,10 +39,8 @@ ScrollAnimatorCompositorCoordinator::~ScrollAnimatorCompositorCoordinator() void ScrollAnimatorCompositorCoordinator::dispose() { - if (m_compositorPlayer) { - m_compositorPlayer->setAnimationDelegate(nullptr); - m_compositorPlayer.clear(); - } + m_compositorPlayer->setAnimationDelegate(nullptr); + m_compositorPlayer.clear(); } void ScrollAnimatorCompositorCoordinator::resetAnimationState() @@ -75,37 +70,23 @@ bool ScrollAnimatorCompositorCoordinator::hasAnimationThatRequiresService() cons bool ScrollAnimatorCompositorCoordinator::addAnimation( PassOwnPtr<CompositorAnimation> animation) { - if (m_compositorPlayer) { - if (m_compositorPlayer->isLayerAttached()) { - m_compositorPlayer->addAnimation(animation.leakPtr()); - return true; - } - } else { - return scrollableArea()->layerForScrolling()->addAnimation(animation); + if (m_compositorPlayer->isLayerAttached()) { + m_compositorPlayer->addAnimation(animation.leakPtr()); + return true; } return false; } void ScrollAnimatorCompositorCoordinator::removeAnimation() { - if (m_compositorPlayer) { - if (m_compositorPlayer->isLayerAttached()) - m_compositorPlayer->removeAnimation(m_compositorAnimationId); - } else { - if (GraphicsLayer* layer = scrollableArea()->layerForScrolling()) - layer->removeAnimation(m_compositorAnimationId); - } + if (m_compositorPlayer->isLayerAttached()) + m_compositorPlayer->removeAnimation(m_compositorAnimationId); } void ScrollAnimatorCompositorCoordinator::abortAnimation() { - if (m_compositorPlayer) { - if (m_compositorPlayer->isLayerAttached()) - m_compositorPlayer->abortAnimation(m_compositorAnimationId); - } else { - if (GraphicsLayer* layer = scrollableArea()->layerForScrolling()) - layer->abortAnimation(m_compositorAnimationId); - } + if (m_compositorPlayer->isLayerAttached()) + m_compositorPlayer->abortAnimation(m_compositorAnimationId); } void ScrollAnimatorCompositorCoordinator::cancelAnimation() diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp index 813316fa..a6939a9 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp +++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp @@ -498,24 +498,6 @@ void ScrollableArea::updateCompositorScrollAnimations() scrollAnimator->updateCompositorAnimations(); } -void ScrollableArea::notifyCompositorAnimationFinished(int groupId) -{ - if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator()) - programmaticScrollAnimator->notifyCompositorAnimationFinished(groupId); - - if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) - scrollAnimator->notifyCompositorAnimationFinished(groupId); -} - -void ScrollableArea::notifyCompositorAnimationAborted(int groupId) -{ - if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator()) - programmaticScrollAnimator->notifyCompositorAnimationAborted(groupId); - - if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) - scrollAnimator->notifyCompositorAnimationAborted(groupId); -} - void ScrollableArea::cancelScrollAnimation() { if (ScrollAnimatorBase* scrollAnimator = existingScrollAnimator()) diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.h b/third_party/WebKit/Source/platform/scroll/ScrollableArea.h index 4182ec8..edef368 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.h +++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.h @@ -218,9 +218,6 @@ public: virtual void registerForAnimation() { } virtual void deregisterForAnimation() { } - void notifyCompositorAnimationFinished(int groupId); - void notifyCompositorAnimationAborted(int groupId); - virtual bool usesCompositedScrolling() const { return false; } virtual bool shouldScrollOnMainThread() const; diff --git a/third_party/WebKit/Source/web/GraphicsLayerFactoryChromium.cpp b/third_party/WebKit/Source/web/GraphicsLayerFactoryChromium.cpp index d3d95b4..8e63390 100644 --- a/third_party/WebKit/Source/web/GraphicsLayerFactoryChromium.cpp +++ b/third_party/WebKit/Source/web/GraphicsLayerFactoryChromium.cpp @@ -26,12 +26,10 @@ #include "web/GraphicsLayerFactoryChromium.h" #include "platform/graphics/GraphicsLayer.h" -#include "web/WebViewImpl.h" namespace blink { -GraphicsLayerFactoryChromium::GraphicsLayerFactoryChromium(WebViewImpl* webView) - : m_webView(webView) +GraphicsLayerFactoryChromium::GraphicsLayerFactoryChromium() { } @@ -42,7 +40,6 @@ GraphicsLayerFactoryChromium::~GraphicsLayerFactoryChromium() PassOwnPtr<GraphicsLayer> GraphicsLayerFactoryChromium::createGraphicsLayer(GraphicsLayerClient* client) { OwnPtr<GraphicsLayer> layer = adoptPtr(new GraphicsLayer(client)); - m_webView->registerForAnimations(layer->platformLayer()); return layer.release(); } diff --git a/third_party/WebKit/Source/web/GraphicsLayerFactoryChromium.h b/third_party/WebKit/Source/web/GraphicsLayerFactoryChromium.h index 8cfe361..7fe0009 100644 --- a/third_party/WebKit/Source/web/GraphicsLayerFactoryChromium.h +++ b/third_party/WebKit/Source/web/GraphicsLayerFactoryChromium.h @@ -29,19 +29,14 @@ #include "platform/graphics/GraphicsLayerFactory.h" namespace blink { -class WebViewImpl; class GraphicsLayerFactoryChromium final : public GraphicsLayerFactory { public: - explicit GraphicsLayerFactoryChromium(WebViewImpl*); + explicit GraphicsLayerFactoryChromium(); ~GraphicsLayerFactoryChromium() override; PassOwnPtr<GraphicsLayer> createGraphicsLayer(GraphicsLayerClient*) override; - -private: - // The owner of this GraphicsLayerFactoryChromium. - WebViewImpl* m_webView; }; } // namespace blink diff --git a/third_party/WebKit/Source/web/LinkHighlightImpl.cpp b/third_party/WebKit/Source/web/LinkHighlightImpl.cpp index 4b4d726..39da22b 100644 --- a/third_party/WebKit/Source/web/LinkHighlightImpl.cpp +++ b/third_party/WebKit/Source/web/LinkHighlightImpl.cpp @@ -83,17 +83,14 @@ LinkHighlightImpl::LinkHighlightImpl(Node* node, WebViewImpl* owningWebViewImpl) m_clipLayer = adoptPtr(compositorSupport->createLayer()); m_clipLayer->setTransformOrigin(WebFloatPoint3D()); m_clipLayer->addChild(m_contentLayer->layer()); - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { - m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimationPlayer()); - ASSERT(m_compositorPlayer); - m_compositorPlayer->setAnimationDelegate(this); - if (m_owningWebViewImpl->linkHighlightsTimeline()) - m_owningWebViewImpl->linkHighlightsTimeline()->playerAttached(*this); - m_compositorPlayer->attachLayer(m_contentLayer->layer()); - } else { - owningWebViewImpl->registerForAnimations(m_contentLayer->layer()); - m_contentLayer->layer()->setAnimationDelegate(this); - } + + m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimationPlayer()); + ASSERT(m_compositorPlayer); + m_compositorPlayer->setAnimationDelegate(this); + if (m_owningWebViewImpl->linkHighlightsTimeline()) + m_owningWebViewImpl->linkHighlightsTimeline()->playerAttached(*this); + m_compositorPlayer->attachLayer(m_contentLayer->layer()); + m_contentLayer->layer()->setDrawsContent(true); m_contentLayer->layer()->setOpacity(1); m_geometryNeedsUpdate = true; @@ -101,13 +98,11 @@ LinkHighlightImpl::LinkHighlightImpl(Node* node, WebViewImpl* owningWebViewImpl) LinkHighlightImpl::~LinkHighlightImpl() { - if (m_compositorPlayer) { - if (m_compositorPlayer->isLayerAttached()) - m_compositorPlayer->detachLayer(); - if (m_owningWebViewImpl->linkHighlightsTimeline()) - m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this); - m_compositorPlayer->setAnimationDelegate(nullptr); - } + if (m_compositorPlayer->isLayerAttached()) + m_compositorPlayer->detachLayer(); + if (m_owningWebViewImpl->linkHighlightsTimeline()) + m_owningWebViewImpl->linkHighlightsTimeline()->playerDestroyed(*this); + m_compositorPlayer->setAnimationDelegate(nullptr); m_compositorPlayer.clear(); clearGraphicsLayerLinkHighlightPointer(); @@ -308,10 +303,7 @@ void LinkHighlightImpl::startHighlightAnimationIfNeeded() OwnPtr<CompositorAnimation> animation = adoptPtr(CompositorFactory::current().createAnimation(*curve, CompositorTargetProperty::OPACITY)); m_contentLayer->layer()->setDrawsContent(true); - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) - m_compositorPlayer->addAnimation(animation.leakPtr()); - else - m_contentLayer->layer()->addAnimation(animation->releaseCCAnimation()); + m_compositorPlayer->addAnimation(animation.leakPtr()); invalidate(); m_owningWebViewImpl->scheduleAnimation(); diff --git a/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp b/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp index f300283..8c4f44d 100644 --- a/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp +++ b/third_party/WebKit/Source/web/WebRuntimeFeatures.cpp @@ -50,11 +50,6 @@ void WebRuntimeFeatures::enableFeatureFromString(const std::string& name, bool e RuntimeEnabledFeatures::setFeatureEnabledFromString(name, enable); } -void WebRuntimeFeatures::enableCompositorAnimationTimelines(bool enable) -{ - RuntimeEnabledFeatures::setCompositorAnimationTimelinesEnabled(enable); -} - void WebRuntimeFeatures::enableTestOnlyFeatures(bool enable) { RuntimeEnabledFeatures::setTestFeaturesEnabled(enable); diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp index 6bdb139..0a2b40e 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.cpp +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp @@ -431,7 +431,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) , m_layerTreeView(nullptr) , m_rootLayer(nullptr) , m_rootGraphicsLayer(nullptr) - , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium(this))) + , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium())) , m_matchesHeuristicsForGpuRasterization(false) , m_flingModifier(0) , m_flingSourceDevice(WebGestureDeviceUninitialized) @@ -4273,12 +4273,6 @@ PaintLayerCompositor* WebViewImpl::compositor() const return document->layoutView()->compositor(); } -void WebViewImpl::registerForAnimations(WebLayer* layer) -{ - if (m_layerTreeView) - m_layerTreeView->registerForAnimations(layer); -} - GraphicsLayer* WebViewImpl::rootGraphicsLayer() { return m_rootGraphicsLayer; @@ -4324,7 +4318,7 @@ void WebViewImpl::initializeLayerTreeView() // make this assert necessary. We should make them not hit this code and then delete allowsBrokenNullLayerTreeView. ASSERT(m_layerTreeView || !m_client || m_client->allowsBrokenNullLayerTreeView()); - if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platform::current()->isThreadedAnimationEnabled() && m_layerTreeView) { + if (Platform::current()->isThreadedAnimationEnabled() && m_layerTreeView) { m_linkHighlightsTimeline = adoptPtr(CompositorFactory::current().createAnimationTimeline()); attachCompositorAnimationTimeline(m_linkHighlightsTimeline.get()); } diff --git a/third_party/WebKit/Source/web/WebViewImpl.h b/third_party/WebKit/Source/web/WebViewImpl.h index adab552..bd97982 100644 --- a/third_party/WebKit/Source/web/WebViewImpl.h +++ b/third_party/WebKit/Source/web/WebViewImpl.h @@ -438,7 +438,6 @@ public: void setRootGraphicsLayer(GraphicsLayer*); GraphicsLayerFactory* graphicsLayerFactory() const; PaintLayerCompositor* compositor() const; - void registerForAnimations(WebLayer*); void scheduleAnimation(); void attachCompositorAnimationTimeline(CompositorAnimationTimeline*); void detachCompositorAnimationTimeline(CompositorAnimationTimeline*); diff --git a/third_party/WebKit/public/platform/WebLayer.h b/third_party/WebKit/public/platform/WebLayer.h index f38144e..023ba97 100644 --- a/third_party/WebKit/public/platform/WebLayer.h +++ b/third_party/WebKit/public/platform/WebLayer.h @@ -41,7 +41,6 @@ class SkMatrix44; class SkImageFilter; namespace cc { -class Animation; class Layer; class LayerClient; class FilterOperations; @@ -49,7 +48,6 @@ class FilterOperations; namespace blink { -class WebCompositorAnimationDelegate; class WebLayerScrollClient; struct WebFloatPoint; struct WebLayerPositionConstraint; @@ -141,30 +139,8 @@ public: // TODO(loyso): This should use CompositorFilterOperation. crbug.com/584551 virtual void setBackgroundFilters(const cc::FilterOperations&) = 0; - // An animation delegate is notified when animations are started and - // stopped. The WebLayer does not take ownership of the delegate, and it is - // the responsibility of the client to reset the layer's delegate before - // deleting the delegate. - virtual void setAnimationDelegate(WebCompositorAnimationDelegate*) = 0; - - // Returns false if the animation cannot be added. - // Takes ownership of the cc::Animation object. - // TODO(loyso): Erase it. crbug.com/575041 - virtual bool addAnimation(cc::Animation*) = 0; - - // Removes all animations with the given id. - virtual void removeAnimation(int animationId) = 0; - - // Pauses all animations with the given id. - virtual void pauseAnimation(int animationId, double timeOffset) = 0; - - // Aborts all animations with the given id. Different from removeAnimation - // in that aborting an animation stops it from affecting both the pending - // and active tree. - virtual void abortAnimation(int animationId) = 0; - // Returns true if this layer has any active animations - useful for tests. - virtual bool hasActiveAnimation() = 0; + virtual bool hasActiveAnimationForTesting() = 0; // If a scroll parent is set, this layer will inherit its parent's scroll // delta and offset even though it will not be a descendant of the scroll diff --git a/third_party/WebKit/public/platform/WebLayerTreeView.h b/third_party/WebKit/public/platform/WebLayerTreeView.h index d44636e..c902c88 100644 --- a/third_party/WebKit/public/platform/WebLayerTreeView.h +++ b/third_party/WebKit/public/platform/WebLayerTreeView.h @@ -130,10 +130,6 @@ public: // Prevents updates to layer tree from becoming visible. virtual void setDeferCommits(bool deferCommits) { } - // Take responsiblity for this layer's animations, even if this layer hasn't yet - // been added to the tree. - virtual void registerForAnimations(WebLayer* layer) { } - // Identify key layers to the compositor when using the pinch virtual viewport. virtual void registerViewportLayers( const WebLayer* overscrollElasticityLayer, diff --git a/third_party/WebKit/public/web/WebRuntimeFeatures.h b/third_party/WebKit/public/web/WebRuntimeFeatures.h index 328e3b7..127fd63 100644 --- a/third_party/WebKit/public/web/WebRuntimeFeatures.h +++ b/third_party/WebKit/public/web/WebRuntimeFeatures.h @@ -73,8 +73,6 @@ public: BLINK_EXPORT static void enableEncryptedMedia(bool); BLINK_EXPORT static bool isEncryptedMediaEnabled(); - BLINK_EXPORT static void enableCompositorAnimationTimelines(bool); - BLINK_EXPORT static void enableExperimentalCanvasFeatures(bool); BLINK_EXPORT static void enableExperimentalFramework(bool); |
