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

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

Issue 2765053002: Avoid exposing cc::Layer tree to CompositorProxy (Closed)
Patch Set: Minor changes Created 3 years, 9 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/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;
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);
}

Powered by Google App Engine
This is Rietveld 408576698