summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorloyso <loyso@chromium.org>2015-12-02 21:00:18 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-03 05:01:00 +0000
commit7f32365dc607c8db0d211e67ef71d2f0fa3dbd3b (patch)
treedb165fc1004c9b78fc79b3efa0f073b176fdfb30
parent27f0872193b01629cbd041d07a78fc014970e03a (diff)
downloadchromium_src-7f32365dc607c8db0d211e67ef71d2f0fa3dbd3b.zip
chromium_src-7f32365dc607c8db0d211e67ef71d2f0fa3dbd3b.tar.gz
chromium_src-7f32365dc607c8db0d211e67ef71d2f0fa3dbd3b.tar.bz2
CC Animations: Make sure that HtmlViewer uses compositor-animation-timelines
In general, we want to enable external animation system for blink here: https://codereview.chromium.org/1308053006/ Make sure that HtmlViewer always uses the new animation system for CC and Blink (cc::AnimationHost). Eventually, we will delete LayerSettings everywhere. BUG=394777 Review URL: https://codereview.chromium.org/1481343002 Cr-Commit-Position: refs/heads/master@{#362911}
-rw-r--r--components/html_viewer/global_state.cc8
-rw-r--r--components/html_viewer/web_layer_tree_view_impl.cc3
2 files changed, 11 insertions, 0 deletions
diff --git a/components/html_viewer/global_state.cc b/components/html_viewer/global_state.cc
index 4bbf4db..2a2261b 100644
--- a/components/html_viewer/global_state.cc
+++ b/components/html_viewer/global_state.cc
@@ -9,6 +9,8 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/logging.h"
+#include "cc/blink/web_layer_impl.h"
+#include "cc/layers/layer_settings.h"
#include "components/html_viewer/blink_platform_impl.h"
#include "components/html_viewer/blink_settings_impl.h"
#include "components/html_viewer/media_factory.h"
@@ -128,6 +130,12 @@ void GlobalState::InitIfNecessary(const gfx::Size& screen_size_in_pixels,
gpu_service_->GetGpuInfo(base::Bind(&GlobalState::GetGpuInfoCallback,
base::Unretained(this)));
+ // Use new animation system (cc::AnimationHost).
+ cc::LayerSettings layer_settings;
+ layer_settings.use_compositor_animation_timelines = true;
+ cc_blink::WebLayerImpl::SetLayerSettings(layer_settings);
+ blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(true);
+
renderer_scheduler_ = scheduler::RendererScheduler::Create();
blink_platform_.reset(
new BlinkPlatformImpl(this, app_, renderer_scheduler_.get()));
diff --git a/components/html_viewer/web_layer_tree_view_impl.cc b/components/html_viewer/web_layer_tree_view_impl.cc
index c379bc9..2f793b8 100644
--- a/components/html_viewer/web_layer_tree_view_impl.cc
+++ b/components/html_viewer/web_layer_tree_view_impl.cc
@@ -41,6 +41,9 @@ WebLayerTreeViewImpl::WebLayerTreeViewImpl(
// to keep content always crisp when possible.
settings.layer_transforms_should_scale_layer_contents = true;
+ // Use new animation system (cc::AnimationHost).
+ settings.use_compositor_animation_timelines = true;
+
// TODO(rjkroege): Not having a shared tile transport breaks
// software compositing. Add bitmap transport support.
cc::SharedBitmapManager* shared_bitmap_manager = nullptr;