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

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

Issue 2041193005: [compositorworker] compositor proxy mutation updates underlying layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor-worker-upstream-registration
Patch Set: raise if not initialized 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 cb2d9b1158971a96cff76f152a1fb4f90688a073..82886a1b854c1082c10674990001676ca766ee32 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp
@@ -9,35 +9,36 @@
#include "platform/graphics/CompositorMutableState.h"
#include "platform/graphics/CompositorMutation.h"
#include "wtf/PassOwnPtr.h"
+#include "wtf/PtrUtil.h"
namespace blink {
-CompositorMutableStateProvider::CompositorMutableStateProvider(cc::LayerTreeImpl* state, CompositorMutations* mutations)
- : m_state(state)
+CompositorMutableStateProvider::CompositorMutableStateProvider(cc::LayerTreeImpl* treeImpl, CompositorMutations* mutations)
+ : m_tree(treeImpl)
, m_mutations(mutations)
{
}
CompositorMutableStateProvider::~CompositorMutableStateProvider() {}
-PassOwnPtr<CompositorMutableState>
-CompositorMutableStateProvider::getMutableStateFor(uint64_t element_id)
+std::unique_ptr<CompositorMutableState>
+CompositorMutableStateProvider::getMutableStateFor(uint64_t elementId)
{
- cc::LayerTreeImpl::ElementLayers layers = m_state->GetMutableLayers(element_id);
+ cc::LayerTreeImpl::ElementLayers layers = m_tree->GetMutableLayers(elementId);
if (!layers.main && !layers.scroll)
return nullptr;
- // Ensure that we have an entry in the map for |element_id| but do as few
+ // Ensure that we have an entry in the map for |elementId| but do as few
// allocations and queries as possible. This will update the map only if we
- // have not added a value for |element_id|.
- auto result = m_mutations->map.add(element_id, nullptr);
+ // have not added a value for |elementId|.
+ auto result = m_mutations->map.add(elementId, nullptr);
// Only if this is a new entry do we want to allocate a new mutation.
if (result.isNewEntry)
result.storedValue->value = adoptPtr(new CompositorMutation);
- return adoptPtr(new CompositorMutableState(result.storedValue->value.get(), layers.main, layers.scroll));
+ return wrapUnique(new CompositorMutableState(result.storedValue->value.get(), layers.main, layers.scroll));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698