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

Unified Diff: third_party/WebKit/Source/core/animation/Animation.cpp

Issue 2890953002: [SPv1] Always set a CompositorElementId on main graphics layers; use PaintLayer id. (Closed)
Patch Set: none Created 3 years, 7 months 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 | « no previous file | third_party/WebKit/Source/core/animation/AnimationTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/Animation.cpp
diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp
index af5fdce15eb55b9ed1d6e028a1e8068be0649b55..6950a9261e13653e1fdaef41837d5532bad0322a 100644
--- a/third_party/WebKit/Source/core/animation/Animation.cpp
+++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -43,6 +43,7 @@
#include "core/events/AnimationPlaybackEvent.h"
#include "core/frame/UseCounter.h"
#include "core/inspector/InspectorTraceEvents.h"
+#include "core/paint/PaintLayer.h"
#include "core/probe/CoreProbes.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/ScriptForbiddenScope.h"
@@ -752,11 +753,19 @@ bool Animation::CanStartAnimationOnCompositor(
if (!target_element)
return false;
- CompositorElementId target_element_id = CompositorElementIdFromDOMNodeId(
- DOMNodeIds::IdForNode(target_element),
- CompositorElementIdNamespace::kPrimary);
- if (!composited_element_ids->Contains(target_element_id))
+ if (target_element->GetLayoutObject() &&
+ target_element->GetLayoutObject()->IsBoxModelObject() &&
+ target_element->GetLayoutObject()->HasLayer()) {
+ PaintLayer* paint_layer =
+ ToLayoutBoxModelObject(target_element->GetLayoutObject())->Layer();
+ CompositorElementId target_element_id =
+ CompositorElementIdFromPaintLayerId(
+ paint_layer->UniqueId(), CompositorElementIdNamespace::kPrimary);
+ if (!composited_element_ids->Contains(target_element_id))
+ return false;
+ } else {
return false;
+ }
}
return Playing();
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/AnimationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698