Chromium Code Reviews| 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 d80dd61f5d2d94cb5f8e3a4c91e88c0358440e2a..ed7dc55b3ad4518062d9a6e07924da87b34028e0 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp |
| @@ -5,10 +5,7 @@ |
| #include "platform/graphics/CompositorMutableStateProvider.h" |
| #include <memory> |
| -#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 "platform/wtf/PtrUtil.h" |
| @@ -16,33 +13,31 @@ |
| namespace blink { |
| CompositorMutableStateProvider::CompositorMutableStateProvider( |
| - cc::LayerTreeImpl* tree_impl, |
| + ProxyCompositorMutablePropertiesMap* input_properties, |
| CompositorMutations* mutations) |
| - : tree_(tree_impl), mutations_(mutations) {} |
| + : input_properties_(input_properties), mutations_(mutations) {} |
| CompositorMutableStateProvider::~CompositorMutableStateProvider() {} |
| std::unique_ptr<CompositorMutableState> |
| -CompositorMutableStateProvider::GetMutableStateFor(uint64_t element_id) { |
| - cc::LayerImpl* main_layer = tree_->LayerByElementId( |
| - CreateCompositorElementId(element_id, CompositorSubElementId::kPrimary)); |
| - cc::LayerImpl* scroll_layer = tree_->LayerByElementId( |
| - CreateCompositorElementId(element_id, CompositorSubElementId::kScroll)); |
| - |
| - if (!main_layer && !scroll_layer) |
| +CompositorMutableStateProvider::GetMutableStateFor(uint64_t proxy_id) { |
|
flackr
2017/04/11 17:51:36
I'm not sure I understand why the change to gettin
smcgruer
2017/04/19 15:38:38
I might not be following you correctly, but the CL
flackr
2017/04/20 06:54:14
Ah I see now, can we intead store the "current" va
smcgruer
2017/04/21 14:42:25
I'm looking at this, but I don't really see how it
|
| + const auto it = input_properties_->find(proxy_id); |
| + if (it == input_properties_->end()) |
| return nullptr; |
| + CompositorMutableProperties* properties = &it->second; |
| + |
| // 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 |elementId|. |
| - auto result = mutations_->map.insert(element_id, nullptr); |
| + auto result = mutations_->map.insert(properties->element_id, nullptr); |
| // Only if this is a new entry do we want to allocate a new mutation. |
| if (result.is_new_entry) |
| result.stored_value->value = WTF::WrapUnique(new CompositorMutation); |
| - return WTF::WrapUnique(new CompositorMutableState( |
| - result.stored_value->value.get(), main_layer, scroll_layer)); |
| + return WTF::WrapUnique( |
| + new CompositorMutableState(result.stored_value->value.get(), properties)); |
| } |
| } // namespace blink |