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 /cc/blink | |
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}
Diffstat (limited to 'cc/blink')
-rw-r--r-- | cc/blink/web_content_layer_impl.cc | 5 | ||||
-rw-r--r-- | cc/blink/web_external_texture_layer_impl.cc | 3 | ||||
-rw-r--r-- | cc/blink/web_image_layer_impl.cc | 3 | ||||
-rw-r--r-- | cc/blink/web_layer_impl.cc | 55 | ||||
-rw-r--r-- | cc/blink/web_layer_impl.h | 17 | ||||
-rw-r--r-- | cc/blink/web_layer_impl_fixed_bounds_unittest.cc | 2 | ||||
-rw-r--r-- | cc/blink/web_scrollbar_layer_impl.cc | 8 |
7 files changed, 16 insertions, 77 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() { } |