Chromium Code Reviews| Index: third_party/WebKit/Source/core/animation/CustomCompositorAnimationManager.cpp |
| diff --git a/third_party/WebKit/Source/core/animation/CustomCompositorAnimationManager.cpp b/third_party/WebKit/Source/core/animation/CustomCompositorAnimationManager.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c4a027c4f6af60415f132aa381fc91ecd33e8438 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/animation/CustomCompositorAnimationManager.cpp |
| @@ -0,0 +1,28 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "core/animation/CustomCompositorAnimationManager.h" |
| + |
| +#include "core/dom/DOMNodeIds.h" |
| +#include "core/dom/Element.h" |
| +#include "core/dom/Node.h" |
| +#include "platform/TraceEvent.h" |
| +#include "platform/graphics/CompositorMutation.h" |
| + |
| +namespace blink { |
| + |
| +void CustomCompositorAnimationManager::applyMutations(CompositorMutations* mutations) |
| +{ |
| + TRACE_EVENT0("compositor-worker", "CustomCompositorAnimationManager::applyMutations"); |
| + for (const auto& entry : mutations->map) { |
| + int elementId = entry.key; |
| + const CompositorMutation& mutation = *entry.value; |
| + Node* node = DOMNodeIds::nodeForId(elementId); |
| + if (!node || !toElement(node)) |
|
esprehn
2016/03/22 21:16:49
toElement crashes if it's not an Element, do you m
majidvp
2016/03/23 22:24:53
Yes indeed.
|
| + continue; |
| + toElement(node)->updateFromCompositorMutation(mutation); |
| + } |
| +} |
| + |
| +} // namespace blink |