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

Unified Diff: Source/core/rendering/RenderLayerCompositor.cpp

Issue 23874019: Web Animations CSS: Start running animations on the compositor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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
Index: Source/core/rendering/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp
index 0215204f02e0813b97bd4627c0eccb1f038a325c..7dbf2e305f8562b0532c03c203603ef26a94f725 100644
--- a/Source/core/rendering/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/RenderLayerCompositor.cpp
@@ -30,6 +30,7 @@
#include "CSSPropertyNames.h"
#include "HTMLNames.h"
#include "RuntimeEnabledFeatures.h"
+#include "core/animation/ActiveAnimations.h"
#include "core/dom/FullscreenElementStack.h"
#include "core/dom/NodeList.h"
#include "core/html/HTMLCanvasElement.h"
@@ -1677,7 +1678,17 @@ bool RenderLayerCompositor::requiresCompositingForAnimation(RenderObject* render
{
if (!(m_compositingTriggers & ChromeClient::AnimationTrigger))
return false;
- return renderer->animation().isRunningAcceleratableAnimationOnRenderer(renderer);
+
+ if (!RuntimeEnabledFeatures::webAnimationsEnabled())
+ return renderer->animation().isRunningAcceleratableAnimationOnRenderer(renderer);
+
+ if (!renderer->node() || !renderer->node()->isElementNode())
+ return false;
+
+ if (const ActiveAnimations* activeAnimations = toElement(renderer->node())->activeAnimations())
+ return activeAnimations->hasCandidateForCompositorAnimation();
+
+ return false;
}
bool RenderLayerCompositor::requiresCompositingForTransition(RenderObject* renderer) const
@@ -1868,7 +1879,7 @@ bool RenderLayerCompositor::isRunningAcceleratedTransformAnimation(RenderObject*
{
if (!(m_compositingTriggers & ChromeClient::AnimationTrigger))
return false;
- return renderer->animation().isRunningAnimationOnRenderer(renderer, CSSPropertyWebkitTransform);
+ return isRunningCompositorAnimation(*renderer, CSSPropertyWebkitTransform);
}
// If an element has negative z-index children, those children render in front of the

Powered by Google App Engine
This is Rietveld 408576698