Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp b/third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp |
| index 87c1ea20661c2dfbf718f444623743a0a1b67b24..250678c5173a0efdf51a257fa9ae4709e69297bc 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp |
| @@ -4,79 +4,50 @@ |
| #include "platform/graphics/CompositorMutableState.h" |
| -#include "cc/layers/layer_impl.h" |
| -#include "cc/trees/layer_tree_impl.h" |
| +#include "platform/graphics/CompositorMutableProperties.h" |
| #include "platform/graphics/CompositorMutation.h" |
| namespace blink { |
| -CompositorMutableState::CompositorMutableState(CompositorMutation* mutation, |
| - cc::LayerImpl* main, |
| - cc::LayerImpl* scroll) |
| - : m_mutation(mutation), m_mainLayer(main), m_scrollLayer(scroll) {} |
| +CompositorMutableState::CompositorMutableState( |
| + CompositorMutation* mutation, |
| + CompositorMutableProperties* properties) |
| + : m_mutation(mutation), m_properties(properties) {} |
| CompositorMutableState::~CompositorMutableState() {} |
| double CompositorMutableState::opacity() const { |
| - return m_mainLayer->Opacity(); |
| + return m_properties->opacity; |
| } |
| void CompositorMutableState::setOpacity(double opacity) { |
| - if (!m_mainLayer) |
| - return; |
| - m_mainLayer->layer_tree_impl() |
| - ->property_trees() |
| - ->effect_tree.OnOpacityAnimated(opacity, m_mainLayer->effect_tree_index(), |
| - m_mainLayer->layer_tree_impl()); |
| + m_properties->opacity = opacity; |
|
smcgruer
2017/03/20 14:31:50
I may be thinking about this incorrectly, but I be
Scott Funkenhauser
2017/03/21 19:31:11
Yes your interpretation is correct.
Since it was
|
| m_mutation->setOpacity(opacity); |
| } |
| const SkMatrix44& CompositorMutableState::transform() const { |
| - return m_mainLayer ? m_mainLayer->Transform().matrix() : SkMatrix44::I(); |
| + return m_properties->transform; |
| } |
| void CompositorMutableState::setTransform(const SkMatrix44& matrix) { |
| - if (!m_mainLayer) |
| - return; |
| - m_mainLayer->layer_tree_impl() |
| - ->property_trees() |
| - ->transform_tree.OnTransformAnimated(gfx::Transform(matrix), |
| - m_mainLayer->transform_tree_index(), |
| - m_mainLayer->layer_tree_impl()); |
| + m_properties->transform = matrix; |
| m_mutation->setTransform(matrix); |
| } |
| float CompositorMutableState::scrollLeft() const { |
| - return m_scrollLayer ? m_scrollLayer->CurrentScrollOffset().x() : 0.0; |
| + return m_properties->scrollLeft; |
| } |
| void CompositorMutableState::setScrollLeft(float scrollLeft) { |
| - if (!m_scrollLayer) |
| - return; |
| - |
| - gfx::ScrollOffset offset = m_scrollLayer->CurrentScrollOffset(); |
| - offset.set_x(scrollLeft); |
| - m_scrollLayer->layer_tree_impl() |
| - ->property_trees() |
| - ->scroll_tree.OnScrollOffsetAnimated( |
| - m_scrollLayer->id(), m_scrollLayer->scroll_tree_index(), offset, |
| - m_scrollLayer->layer_tree_impl()); |
| + m_properties->scrollLeft = scrollLeft; |
| m_mutation->setScrollLeft(scrollLeft); |
| } |
| float CompositorMutableState::scrollTop() const { |
| - return m_scrollLayer ? m_scrollLayer->CurrentScrollOffset().y() : 0.0; |
| + return m_properties->scrollTop; |
| } |
| void CompositorMutableState::setScrollTop(float scrollTop) { |
| - if (!m_scrollLayer) |
| - return; |
| - gfx::ScrollOffset offset = m_scrollLayer->CurrentScrollOffset(); |
| - offset.set_y(scrollTop); |
| - m_scrollLayer->layer_tree_impl() |
| - ->property_trees() |
| - ->scroll_tree.OnScrollOffsetAnimated( |
| - m_scrollLayer->id(), m_scrollLayer->scroll_tree_index(), offset, |
| - m_scrollLayer->layer_tree_impl()); |
| + m_properties->scrollTop = scrollTop; |
| m_mutation->setScrollTop(scrollTop); |
| } |