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

Unified Diff: cc/layer_impl.cc

Issue 11519018: [cc] Make LayerImpls point at LayerTreeImpl instead of LTHI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« cc/layer.h ('K') | « cc/layer_impl.h ('k') | cc/layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_impl.cc
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index 268f0b4bb221cdd39d93c76117930ba148e5fce0..521c5bca21192b7ec63a9eef95994e66c2147bf4 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -10,6 +10,7 @@
#include "cc/debug_border_draw_quad.h"
#include "cc/debug_colors.h"
#include "cc/layer_tree_host_impl.h"
+#include "cc/layer_tree_impl.h"
#include "cc/math_util.h"
#include "cc/proxy.h"
#include "cc/quad_sink.h"
@@ -19,12 +20,12 @@
namespace cc {
-LayerImpl::LayerImpl(LayerTreeHostImpl* hostImpl, int id)
+LayerImpl::LayerImpl(LayerTreeImpl* treeImpl, int id)
: m_parent(0)
, m_maskLayerId(-1)
, m_replicaLayerId(-1)
, m_layerId(id)
- , m_layerTreeHostImpl(hostImpl)
+ , m_layerTreeImpl(treeImpl)
, m_anchorPoint(0.5, 0.5)
, m_anchorPointZ(0)
, m_contentsScaleX(1.0)
@@ -54,7 +55,7 @@ LayerImpl::LayerImpl(LayerTreeHostImpl* hostImpl, int id)
, m_layerAnimationController(LayerAnimationController::create(this))
{
DCHECK(m_layerId > 0);
- DCHECK(m_layerTreeHostImpl);
+ DCHECK(m_layerTreeImpl);
}
LayerImpl::~LayerImpl()
@@ -69,7 +70,7 @@ void LayerImpl::addChild(scoped_ptr<LayerImpl> child)
child->setParent(this);
DCHECK_EQ(layerTreeHostImpl(), child->layerTreeHostImpl());
m_children.append(child.Pass());
- m_layerTreeHostImpl->setNeedsUpdateDrawProperties();
+ layerTreeHostImpl()->setNeedsUpdateDrawProperties();
}
scoped_ptr<LayerImpl> LayerImpl::removeChild(LayerImpl* child)
@@ -78,7 +79,7 @@ scoped_ptr<LayerImpl> LayerImpl::removeChild(LayerImpl* child)
if (m_children[i] == child) {
scoped_ptr<LayerImpl> ret = m_children.take(i);
m_children.remove(i);
- m_layerTreeHostImpl->setNeedsUpdateDrawProperties();
+ layerTreeHostImpl()->setNeedsUpdateDrawProperties();
return ret.Pass();
}
}
@@ -88,7 +89,7 @@ scoped_ptr<LayerImpl> LayerImpl::removeChild(LayerImpl* child)
void LayerImpl::removeAllChildren()
{
m_children.clear();
- m_layerTreeHostImpl->setNeedsUpdateDrawProperties();
+ layerTreeHostImpl()->setNeedsUpdateDrawProperties();
}
void LayerImpl::clearChildList()
@@ -97,7 +98,7 @@ void LayerImpl::clearChildList()
return;
m_children.clear();
- m_layerTreeHostImpl->setNeedsUpdateDrawProperties();
+ layerTreeHostImpl()->setNeedsUpdateDrawProperties();
}
void LayerImpl::createRenderSurface()
@@ -120,6 +121,10 @@ int LayerImpl::descendantsDrawContent()
return result;
}
+LayerTreeHostImpl* LayerImpl::layerTreeHostImpl() const {
+ return m_layerTreeImpl->layer_tree_host_impl();
+}
+
scoped_ptr<SharedQuadState> LayerImpl::createSharedQuadState() const
{
scoped_ptr<SharedQuadState> state = SharedQuadState::Create();
@@ -151,25 +156,25 @@ void LayerImpl::didDraw(ResourceProvider*)
bool LayerImpl::showDebugBorders() const
{
- return m_layerTreeHostImpl->debugState().showDebugBorders;
+ return layerTreeHostImpl()->debugState().showDebugBorders;
}
void LayerImpl::getDebugBorderProperties(SkColor* color, float* width) const
{
if (m_drawsContent) {
*color = DebugColors::ContentLayerBorderColor();
- *width = DebugColors::ContentLayerBorderWidth(m_layerTreeHostImpl);
+ *width = DebugColors::ContentLayerBorderWidth(layerTreeHostImpl());
return;
}
if (m_masksToBounds) {
*color = DebugColors::MaskingLayerBorderColor();
- *width = DebugColors::MaskingLayerBorderWidth(m_layerTreeHostImpl);
+ *width = DebugColors::MaskingLayerBorderWidth(layerTreeHostImpl());
return;
}
*color = DebugColors::ContainerLayerBorderColor();
- *width = DebugColors::ContainerLayerBorderWidth(m_layerTreeHostImpl);
+ *width = DebugColors::ContainerLayerBorderWidth(layerTreeHostImpl());
}
void LayerImpl::appendDebugBorderQuad(QuadSink& quadList, const SharedQuadState* sharedQuadState, AppendQuadsData& appendQuadsData) const
@@ -266,7 +271,7 @@ InputHandlerClient::ScrollStatus LayerImpl::tryScroll(const gfx::PointF& screenS
bool LayerImpl::drawCheckerboardForMissingTiles() const
{
- return m_drawCheckerboardForMissingTiles && !m_layerTreeHostImpl->settings().backgroundColorInsteadOfCheckerboard;
+ return m_drawCheckerboardForMissingTiles && !layerTreeHostImpl()->settings().backgroundColorInsteadOfCheckerboard;
}
gfx::Rect LayerImpl::layerRectToContentRect(const gfx::RectF& layerRect) const
@@ -409,13 +414,13 @@ bool LayerImpl::layerSurfacePropertyChanged() const
void LayerImpl::noteLayerSurfacePropertyChanged()
{
m_layerSurfacePropertyChanged = true;
- m_layerTreeHostImpl->setNeedsUpdateDrawProperties();
+ layerTreeHostImpl()->setNeedsUpdateDrawProperties();
}
void LayerImpl::noteLayerPropertyChanged()
{
m_layerPropertyChanged = true;
- m_layerTreeHostImpl->setNeedsUpdateDrawProperties();
+ layerTreeHostImpl()->setNeedsUpdateDrawProperties();
}
void LayerImpl::noteLayerPropertyChangedForSubtree()
@@ -426,7 +431,7 @@ void LayerImpl::noteLayerPropertyChangedForSubtree()
void LayerImpl::noteLayerPropertyChangedForDescendants()
{
- m_layerTreeHostImpl->setNeedsUpdateDrawProperties();
+ layerTreeHostImpl()->setNeedsUpdateDrawProperties();
for (size_t i = 0; i < m_children.size(); ++i)
m_children[i]->noteLayerPropertyChangedForSubtree();
}
@@ -738,7 +743,7 @@ void LayerImpl::setMaxScrollOffset(gfx::Vector2d maxScrollOffset)
return;
m_maxScrollOffset = maxScrollOffset;
- m_layerTreeHostImpl->setNeedsUpdateDrawProperties();
+ layerTreeHostImpl()->setNeedsUpdateDrawProperties();
if (!m_scrollbarAnimationController)
return;
« cc/layer.h ('K') | « cc/layer_impl.h ('k') | cc/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698