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 562fed855018528b7c7603680e5d6b6d45869dd7..589895d02dcd94b9e9bac6fa71c25c8dffd00363 100644 |
--- a/third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp |
+++ b/third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp |
@@ -4,74 +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) |
- : mutation_(mutation), main_layer_(main), scroll_layer_(scroll) {} |
+CompositorMutableState::CompositorMutableState( |
+ CompositorMutation* mutation, |
+ CompositorMutableProperties* properties) |
+ : mutation_(mutation), properties_(properties) {} |
CompositorMutableState::~CompositorMutableState() {} |
double CompositorMutableState::Opacity() const { |
- return main_layer_->Opacity(); |
+ return properties_->opacity; |
} |
void CompositorMutableState::SetOpacity(double opacity) { |
- if (!main_layer_) |
- return; |
- main_layer_->layer_tree_impl()->SetOpacityMutated(main_layer_->element_id(), |
- opacity); |
+ properties_->opacity = opacity; |
mutation_->SetOpacity(opacity); |
} |
const SkMatrix44& CompositorMutableState::Transform() const { |
- return main_layer_ ? main_layer_->Transform().matrix() : SkMatrix44::I(); |
+ return properties_->transform; |
} |
void CompositorMutableState::SetTransform(const SkMatrix44& matrix) { |
- if (!main_layer_) |
- return; |
- main_layer_->layer_tree_impl()->SetTransformMutated(main_layer_->element_id(), |
- gfx::Transform(matrix)); |
+ properties_->transform = matrix; |
mutation_->SetTransform(matrix); |
} |
float CompositorMutableState::ScrollLeft() const { |
- return scroll_layer_ ? scroll_layer_->CurrentScrollOffset().x() : 0.0; |
+ return properties_->scroll_left; |
} |
void CompositorMutableState::SetScrollLeft(float scroll_left) { |
- if (!scroll_layer_) |
- return; |
- |
- gfx::ScrollOffset offset = scroll_layer_->CurrentScrollOffset(); |
- offset.set_x(scroll_left); |
- scroll_layer_->layer_tree_impl() |
- ->property_trees() |
- ->scroll_tree.OnScrollOffsetAnimated( |
- scroll_layer_->id(), scroll_layer_->scroll_tree_index(), offset, |
- scroll_layer_->layer_tree_impl()); |
+ properties_->scroll_left = scroll_left; |
mutation_->SetScrollLeft(scroll_left); |
} |
float CompositorMutableState::ScrollTop() const { |
- return scroll_layer_ ? scroll_layer_->CurrentScrollOffset().y() : 0.0; |
+ return properties_->scroll_top; |
} |
void CompositorMutableState::SetScrollTop(float scroll_top) { |
- if (!scroll_layer_) |
- return; |
- gfx::ScrollOffset offset = scroll_layer_->CurrentScrollOffset(); |
- offset.set_y(scroll_top); |
- scroll_layer_->layer_tree_impl() |
- ->property_trees() |
- ->scroll_tree.OnScrollOffsetAnimated( |
- scroll_layer_->id(), scroll_layer_->scroll_tree_index(), offset, |
- scroll_layer_->layer_tree_impl()); |
+ properties_->scroll_top = scroll_top; |
mutation_->SetScrollTop(scroll_top); |
} |