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

Side by Side Diff: third_party/WebKit/Source/core/frame/VisualViewport.h

Issue 2735543002: Separate VisualViewport layer tree creation from attachment. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 class IntRect; 55 class IntRect;
56 class IntSize; 56 class IntSize;
57 class LocalFrame; 57 class LocalFrame;
58 58
59 // Represents the visual viewport the user is currently seeing the page through. 59 // Represents the visual viewport the user is currently seeing the page through.
60 // This class corresponds to the InnerViewport on the compositor. It is a 60 // This class corresponds to the InnerViewport on the compositor. It is a
61 // ScrollableArea; it's offset is set through the GraphicsLayer <-> CC sync 61 // ScrollableArea; it's offset is set through the GraphicsLayer <-> CC sync
62 // mechanisms. Its contents is the page's main FrameView, which corresponds to 62 // mechanisms. Its contents is the page's main FrameView, which corresponds to
63 // the outer viewport. The inner viewport is always contained in the outer 63 // the outer viewport. The inner viewport is always contained in the outer
64 // viewport and can pan within it. 64 // viewport and can pan within it.
65 //
66 // When attached, the tree will look like this:
67 //
68 // VV::m_rootTransformLayer
69 // +- VV::m_innerViewportContainerLayer
70 // +- VV::m_overscrollElasticityLayer
71 // | +- VV::m_pageScaleLayer
72 // | +- VV::m_innerViewportScrollLayer
73 // | +-- PLC::m_overflowControlsHostLayer
74 // | +-- PLC::m_containerLayer (fixed pos container)
75 // | +-- PLC::m_scrollLayer
76 // | +-- PLC::m_rootContentLayer
77 // | +-- LayoutView CompositedLayerMapping layers
78 // +- PageOverlay for InspectorOverlay
79 // +- PageOverlay for ColorOverlay
80 // +- PLC::m_layerForHorizontalScrollbar
81 // +- PLC::m_layerForVerticalScrollbar
82 // +- PLC::m_layerForScrollCorner (non-overlay only)
83 //
65 class CORE_EXPORT VisualViewport final 84 class CORE_EXPORT VisualViewport final
66 : public GarbageCollectedFinalized<VisualViewport>, 85 : public GarbageCollectedFinalized<VisualViewport>,
67 public GraphicsLayerClient, 86 public GraphicsLayerClient,
68 public ScrollableArea { 87 public ScrollableArea {
69 USING_GARBAGE_COLLECTED_MIXIN(VisualViewport); 88 USING_GARBAGE_COLLECTED_MIXIN(VisualViewport);
70 89
71 public: 90 public:
72 static VisualViewport* create(FrameHost& host) { 91 static VisualViewport* create(FrameHost& host) {
73 return new VisualViewport(host); 92 return new VisualViewport(host);
74 } 93 }
75 ~VisualViewport() override; 94 ~VisualViewport() override;
76 95
77 DECLARE_VIRTUAL_TRACE(); 96 DECLARE_VIRTUAL_TRACE();
78 97
79 void attachToLayerTree(GraphicsLayer*); 98 void createLayerTree();
99 void attachLayerTree(GraphicsLayer*);
80 100
81 GraphicsLayer* rootGraphicsLayer() { return m_rootTransformLayer.get(); } 101 GraphicsLayer* rootGraphicsLayer() { return m_rootTransformLayer.get(); }
82 GraphicsLayer* containerLayer() { 102 GraphicsLayer* containerLayer() {
83 return m_innerViewportContainerLayer.get(); 103 return m_innerViewportContainerLayer.get();
84 } 104 }
85 GraphicsLayer* scrollLayer() { return m_innerViewportScrollLayer.get(); } 105 GraphicsLayer* scrollLayer() { return m_innerViewportScrollLayer.get(); }
86 GraphicsLayer* pageScaleLayer() { return m_pageScaleLayer.get(); } 106 GraphicsLayer* pageScaleLayer() { return m_pageScaleLayer.get(); }
87 GraphicsLayer* overscrollElasticityLayer() { 107 GraphicsLayer* overscrollElasticityLayer() {
88 return m_overscrollElasticityLayer.get(); 108 return m_overscrollElasticityLayer.get();
89 } 109 }
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 float m_scale; 285 float m_scale;
266 IntSize m_size; 286 IntSize m_size;
267 float m_browserControlsAdjustment; 287 float m_browserControlsAdjustment;
268 float m_maxPageScale; 288 float m_maxPageScale;
269 bool m_trackPinchZoomStatsForPage; 289 bool m_trackPinchZoomStatsForPage;
270 }; 290 };
271 291
272 } // namespace blink 292 } // namespace blink
273 293
274 #endif // VisualViewport_h 294 #endif // VisualViewport_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698