| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/animation/CustomCompositorAnimationManager.h" | 5 #include "core/animation/CustomCompositorAnimationManager.h" |
| 6 | 6 |
| 7 #include "core/dom/DOMNodeIds.h" | 7 #include "core/dom/DOMNodeIds.h" |
| 8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
| 9 #include "core/dom/Node.h" | 9 #include "core/dom/Node.h" |
| 10 #include "platform/TraceEvent.h" | |
| 11 #include "platform/graphics/CompositorMutation.h" | 10 #include "platform/graphics/CompositorMutation.h" |
| 11 #include "platform/tracing/TraceEvent.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 CustomCompositorAnimationManager::CustomCompositorAnimationManager() {} | 15 CustomCompositorAnimationManager::CustomCompositorAnimationManager() {} |
| 16 | 16 |
| 17 CustomCompositorAnimationManager::~CustomCompositorAnimationManager() {} | 17 CustomCompositorAnimationManager::~CustomCompositorAnimationManager() {} |
| 18 | 18 |
| 19 void CustomCompositorAnimationManager::applyMutations( | 19 void CustomCompositorAnimationManager::applyMutations( |
| 20 CompositorMutations* mutations) { | 20 CompositorMutations* mutations) { |
| 21 TRACE_EVENT0("compositor-worker", | 21 TRACE_EVENT0("compositor-worker", |
| 22 "CustomCompositorAnimationManager::applyMutations"); | 22 "CustomCompositorAnimationManager::applyMutations"); |
| 23 for (const auto& entry : mutations->map) { | 23 for (const auto& entry : mutations->map) { |
| 24 int elementId = entry.key; | 24 int elementId = entry.key; |
| 25 const CompositorMutation& mutation = *entry.value; | 25 const CompositorMutation& mutation = *entry.value; |
| 26 Node* node = DOMNodeIds::nodeForId(elementId); | 26 Node* node = DOMNodeIds::nodeForId(elementId); |
| 27 if (!node || !node->isElementNode()) | 27 if (!node || !node->isElementNode()) |
| 28 continue; | 28 continue; |
| 29 toElement(node)->updateFromCompositorMutation(mutation); | 29 toElement(node)->updateFromCompositorMutation(mutation); |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 | 32 |
| 33 } // namespace blink | 33 } // namespace blink |
| OLD | NEW |