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

Unified Diff: Source/core/rendering/RenderLayerCompositor.cpp

Issue 16136004: Add graphics layers for pinch virtual viewport. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 | « Source/core/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderLayerCompositor.cpp
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp
index 4b2c4d051671c05c0ec5db745f3f36cc37cec263..aee304ccb13bb08e0eca3374b47af4482eaea1ac 100644
--- a/Source/core/rendering/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/RenderLayerCompositor.cpp
@@ -1119,7 +1119,12 @@ void RenderLayerCompositor::frameViewDidChangeSize()
{
if (m_clipLayer) {
FrameView* frameView = m_renderView->frameView();
- m_clipLayer->setSize(frameView->unscaledVisibleContentSize());
+ FloatSize visibleContentSize = frameView->unscaledVisibleContentSize();
trchen 2013/05/29 21:32:56 FloatSize unscaledVisibleContentSize = ...
wjmaclean 2013/05/30 14:19:09 Done.
+ m_clipLayer->setSize(visibleContentSize);
+ if (m_pinchVirtualViewportClipLayer) {
trchen 2013/05/29 21:32:56 FloatSize visibleContentSize = unscaledVisibleCont
wjmaclean 2013/05/30 14:19:09 Done.
+ visibleContentSize.scale(frameView->visibleContentScaleFactor());
+ m_pinchVirtualViewportClipLayer->setSize(visibleContentSize);
+ }
frameViewDidScroll();
updateOverflowControlsLayers();
@@ -2393,11 +2398,29 @@ void RenderLayerCompositor::ensureRootLayer()
#endif
if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(m_scrollLayer.get(), true);
-
// Hook them up
m_overflowControlsHostLayer->addChild(m_clipLayer.get());
m_clipLayer->addChild(m_scrollLayer.get());
- m_scrollLayer->addChild(m_rootContentLayer.get());
+ if (isMainFrame() && m_renderView->document()->settings()->pinchVirtualViewportEnabled()) {
enne (OOO) 2013/05/29 19:57:10 Can you add a outline diagram in a comment here of
wjmaclean 2013/05/29 21:00:30 Will do.
+ m_pinchVirtualViewportClipLayer = GraphicsLayer::create(graphicsLayerFactory(), this);
+#ifndef NDEBUG
+ m_pinchVirtualViewportClipLayer->setName("pinch virtual viewport clip");
+#endif
+ m_pinchVirtualViewportClipLayer->setMasksToBounds(true);
+
+ m_pinchVirtualViewportScrollLayer = GraphicsLayer::create(graphicsLayerFactory(), this);
+#ifndef NDEBUG
+ m_pinchVirtualViewportScrollLayer->setName("pinch virtual viewport scroll");
+#endif
+
+ if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
+ scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(m_pinchVirtualViewportScrollLayer.get(), true);
+
+ m_scrollLayer->addChild(m_pinchVirtualViewportClipLayer.get());
+ m_pinchVirtualViewportClipLayer->addChild(m_pinchVirtualViewportScrollLayer.get());
+ m_pinchVirtualViewportScrollLayer->addChild(m_rootContentLayer.get());
trchen 2013/05/29 21:32:56 This doesn't look right. According to enne's desig
wjmaclean 2013/05/30 14:19:09 The layer named m_pinchVirtualViewportScrollLayer
+ } else
enne (OOO) 2013/05/29 19:57:10 Can you add braces for this else to be in line wit
wjmaclean 2013/05/29 21:00:30 Will do.
+ m_scrollLayer->addChild(m_rootContentLayer.get());
frameViewDidChangeSize();
frameViewDidScroll();
@@ -2451,6 +2474,8 @@ void RenderLayerCompositor::destroyRootLayer()
m_overflowControlsHostLayer = nullptr;
m_clipLayer = nullptr;
m_scrollLayer = nullptr;
+ m_pinchVirtualViewportClipLayer = nullptr;
+ m_pinchVirtualViewportScrollLayer = nullptr;
}
ASSERT(!m_scrollLayer);
m_rootContentLayer = nullptr;
@@ -2734,6 +2759,8 @@ void RenderLayerCompositor::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo
info.addMember(m_rootContentLayer, "rootContentLayer");
info.addMember(m_clipLayer, "clipLayer");
info.addMember(m_scrollLayer, "scrollLayer");
+ info.addMember(m_pinchVirtualViewportClipLayer, "pinch virtual viewport clip layer");
enne (OOO) 2013/05/29 19:57:10 For consistency, maybe this should be pinchVirtual
wjmaclean 2013/05/29 21:00:30 I'll rename everything to be inner/out as in the d
+ info.addMember(m_pinchVirtualViewportScrollLayer, "pinch virtual viewport scroll layer");
info.addMember(m_viewportConstrainedLayers, "viewportConstrainedLayers");
info.addMember(m_overflowControlsHostLayer, "overflowControlsHostLayer");
info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar");
« no previous file with comments | « Source/core/rendering/RenderLayerCompositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698