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

Unified Diff: cc/test/layer_tree_test_common.cc

Issue 11598005: Ref count layer animation controllers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/layer_tree_test_common.h ('k') | cc/thread_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/layer_tree_test_common.cc
diff --git a/cc/test/layer_tree_test_common.cc b/cc/test/layer_tree_test_common.cc
index ebc726cf82f286e7af137ee06151915c3b6f3529..29e81e8bd1a0edbf1ce59a5821fb2ac0630f9d31 100644
--- a/cc/test/layer_tree_test_common.cc
+++ b/cc/test/layer_tree_test_common.cc
@@ -5,6 +5,7 @@
#include "cc/test/layer_tree_test_common.h"
#include "cc/active_animation.h"
+#include "cc/animation_registrar.h"
#include "cc/content_layer.h"
#include "cc/font_atlas.h"
#include "cc/input_handler.h"
@@ -73,7 +74,15 @@ void MockLayerTreeHostImpl::animateLayers(base::TimeTicks monotonicTime, base::T
{
m_testHooks->willAnimateLayers(this, monotonicTime);
LayerTreeHostImpl::animateLayers(monotonicTime, wallClockTime);
- m_testHooks->animateLayers(this, monotonicTime);
+ bool hasUnfinishedAnimation = false;
+ AnimationRegistrar::AnimationControllerMap::const_iterator iter = activeAnimationControllers().begin();
+ for (; iter != activeAnimationControllers().end(); ++iter) {
+ if (iter->second->hasActiveAnimation()) {
+ hasUnfinishedAnimation = true;
+ break;
+ }
+ }
+ m_testHooks->animateLayers(this, monotonicTime, hasUnfinishedAnimation);
}
base::TimeDelta MockLayerTreeHostImpl::lowFrequencyAnimationInterval() const
@@ -103,12 +112,6 @@ public:
return MockLayerTreeHostImpl::create(m_testHooks, settings(), client, proxy()).PassAs<cc::LayerTreeHostImpl>();
}
- virtual void didAddAnimation() OVERRIDE
- {
- LayerTreeHost::didAddAnimation();
- m_testHooks->didAddAnimation();
- }
-
virtual void setNeedsCommit() OVERRIDE
{
if (!m_testStarted)
@@ -279,11 +282,6 @@ void ThreadedTest::postSetVisibleToMainThread(bool visible)
m_mainThreadProxy->postTask(FROM_HERE, base::Bind(&ThreadedTest::dispatchSetVisible, base::Unretained(this), visible));
}
-void ThreadedTest::postDidAddAnimationToMainThread()
-{
- m_mainThreadProxy->postTask(FROM_HERE, base::Bind(&ThreadedTest::dispatchDidAddAnimation, base::Unretained(this)));
-}
-
void ThreadedTest::doBeginTest()
{
m_client = ThreadedMockLayerTreeHostClient::create(this);
@@ -411,14 +409,6 @@ void ThreadedTest::dispatchComposite()
m_layerTreeHost->composite();
}
-void ThreadedTest::dispatchDidAddAnimation()
-{
- DCHECK(!proxy() || proxy()->isMainThread());
-
- if (m_layerTreeHost.get())
- m_layerTreeHost->didAddAnimation();
-}
-
void ThreadedTest::runTest(bool threaded)
{
if (threaded) {
« no previous file with comments | « cc/test/layer_tree_test_common.h ('k') | cc/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698