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

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

Issue 1599673002: compositor-worker: Remove code from cc_blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer feedback. Created 4 years, 11 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
new file mode 100644
index 0000000000000000000000000000000000000000..84704a587380df3810f12ea0f757d75cb8d8b9fe
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp
@@ -0,0 +1,34 @@
+// 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 "platform/graphics/CompositorMutableStateProvider.h"
+
+#include "cc/layers/layer_impl.h"
+#include "cc/trees/layer_tree_impl.h"
+#include "platform/graphics/CompositorMutableState.h"
+#include "platform/graphics/CompositorMutation.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace blink {
+
+CompositorMutableStateProvider::CompositorMutableStateProvider(cc::LayerTreeImpl* state, CompositorMutations* mutations)
+ : m_state(state)
+ , m_mutations(mutations)
+{
+}
+
+CompositorMutableStateProvider::~CompositorMutableStateProvider() {}
+
+PassOwnPtr<CompositorMutableState>
+CompositorMutableStateProvider::getMutableStateFor(uint64_t element_id)
+{
+ cc::LayerTreeImpl::ElementLayers layers = m_state->GetMutableLayers(element_id);
+
+ if (!layers.main && !layers.scroll)
+ return nullptr;
+
+ return adoptPtr(new CompositorMutableState(&m_mutations->map.find(element_id)->value, layers.main, layers.scroll));
jbroman 2016/01/18 21:40:26 One caveat here: IIUC std::map guarantees that ite
Ian Vollick 2016/01/18 21:56:40 Ah, right. No, this is a problem. I've gone back t
Ian Vollick 2016/01/19 14:49:30 I remembered that Elliott had already suggested th
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698