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

Unified Diff: third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
Index: third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp b/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp
index 04f8c9c943afd69b57e341e7bc92c993e66d9a30..5245b4fe6156ff13f4a9bece955a96466bc02fd5 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp
@@ -6,6 +6,8 @@
#include "cc/layers/layer_impl.h"
#include "cc/trees/layer_tree_impl.h"
+#include "platform/graphics/CompositorElementId.h"
+#include "platform/graphics/CompositorMutableProperties.h"
#include "platform/graphics/CompositorMutableState.h"
#include "platform/graphics/CompositorMutation.h"
#include "wtf/PtrUtil.h"
@@ -24,9 +26,10 @@ CompositorMutableStateProvider::~CompositorMutableStateProvider() {}
std::unique_ptr<CompositorMutableState>
CompositorMutableStateProvider::getMutableStateFor(uint64_t elementId)
{
- cc::LayerTreeImpl::ElementLayers layers = m_tree->GetMutableLayers(elementId);
+ cc::LayerImpl* mainLayer = m_tree->LayerByElementId(createCompositorElementId(elementId, CompositorSubElementId::Primary));
+ cc::LayerImpl* scrollLayer = m_tree->LayerByElementId(createCompositorElementId(elementId, CompositorSubElementId::Scroll));
- if (!layers.main && !layers.scroll)
+ if (!mainLayer && !scrollLayer)
return nullptr;
// Ensure that we have an entry in the map for |elementId| but do as few
@@ -38,7 +41,7 @@ CompositorMutableStateProvider::getMutableStateFor(uint64_t elementId)
if (result.isNewEntry)
result.storedValue->value = wrapUnique(new CompositorMutation);
- return wrapUnique(new CompositorMutableState(result.storedValue->value.get(), layers.main, layers.scroll));
+ return wrapUnique(new CompositorMutableState(result.storedValue->value.get(), mainLayer, scrollLayer));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698