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

Unified Diff: cc/scrollbar_layer_impl.cc

Issue 11882037: Activate LayerImpl tree with sync+push instead of pointer swap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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
« no previous file with comments | « cc/scrollbar_layer_impl.h ('k') | cc/solid_color_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scrollbar_layer_impl.cc
diff --git a/cc/scrollbar_layer_impl.cc b/cc/scrollbar_layer_impl.cc
index f82a1dc2b1c0c408cc14502ff1e41923a9da9f64..b57bb255f7c650b39c3b2dd5e938adad54a81566 100644
--- a/cc/scrollbar_layer_impl.cc
+++ b/cc/scrollbar_layer_impl.cc
@@ -28,6 +28,7 @@ ScrollbarLayerImpl::ScrollbarLayerImpl(LayerTreeImpl* treeImpl, int id)
, m_currentPos(0)
, m_totalSize(0)
, m_maximum(0)
+ , m_scrollLayerId(-1)
, m_scrollbarOverlayStyle(WebScrollbar::ScrollbarOverlayStyleDefault)
, m_orientation(WebScrollbar::Horizontal)
, m_controlSize(WebScrollbar::RegularScrollbar)
@@ -45,6 +46,11 @@ ScrollbarLayerImpl::~ScrollbarLayerImpl()
{
}
+ScrollbarLayerImpl* ScrollbarLayerImpl::toScrollbarLayer()
+{
+ return this;
+}
+
void ScrollbarLayerImpl::setScrollbarGeometry(scoped_ptr<ScrollbarGeometryFixedThumb> geometry)
{
m_geometry = geometry.Pass();
@@ -101,6 +107,27 @@ gfx::Rect ScrollbarLayerImpl::scrollbarLayerRectToContentRect(const gfx::Rect& l
return gfx::ToEnclosingRect(contentRect);
}
+scoped_ptr<LayerImpl> ScrollbarLayerImpl::createLayerImpl(LayerTreeImpl* treeImpl)
+{
+ return ScrollbarLayerImpl::create(treeImpl, id()).PassAs<LayerImpl>();
+}
+
+void ScrollbarLayerImpl::pushPropertiesTo(LayerImpl* layer)
+{
+ LayerImpl::pushPropertiesTo(layer);
+
+ ScrollbarLayerImpl* scrollbarLayer = static_cast<ScrollbarLayerImpl*>(layer);
+
+ if (!scrollbarLayer->scrollbarGeometry())
+ scrollbarLayer->setScrollbarGeometry(ScrollbarGeometryFixedThumb::create(make_scoped_ptr(m_geometry->clone())));
+
+ scrollbarLayer->setScrollbarData(&m_scrollbar);
+
+ scrollbarLayer->setBackTrackResourceId(m_backTrackResourceId);
+ scrollbarLayer->setForeTrackResourceId(m_foreTrackResourceId);
+ scrollbarLayer->setThumbResourceId(m_thumbResourceId);
+}
+
void ScrollbarLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& appendQuadsData)
{
bool premultipledAlpha = false;
« no previous file with comments | « cc/scrollbar_layer_impl.h ('k') | cc/solid_color_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698