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

Side by Side Diff: Source/core/frame/PinchViewport.h

Issue 308183002: Made root translation layer the root when using pinch virtual viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed unit test Created 6 years, 6 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
« no previous file with comments | « no previous file | Source/core/frame/PinchViewport.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // main FrameView, which corresponds to the outer viewport. The inner viewport i s always contained 62 // main FrameView, which corresponds to the outer viewport. The inner viewport i s always contained
63 // in the outer viewport and can pan within it. 63 // in the outer viewport and can pan within it.
64 class PinchViewport FINAL : public GraphicsLayerClient, public ScrollableArea { 64 class PinchViewport FINAL : public GraphicsLayerClient, public ScrollableArea {
65 public: 65 public:
66 explicit PinchViewport(FrameHost&); 66 explicit PinchViewport(FrameHost&);
67 virtual ~PinchViewport(); 67 virtual ~PinchViewport();
68 68
69 void attachToLayerTree(GraphicsLayer*, GraphicsLayerFactory*); 69 void attachToLayerTree(GraphicsLayer*, GraphicsLayerFactory*);
70 GraphicsLayer* rootGraphicsLayer() 70 GraphicsLayer* rootGraphicsLayer()
71 { 71 {
72 return m_rootTransformLayer.get();
73 }
74 GraphicsLayer* containerLayer()
75 {
72 return m_innerViewportContainerLayer.get(); 76 return m_innerViewportContainerLayer.get();
73 } 77 }
74 78
75 // Sets the location of the inner viewport relative to the outer viewport. T he 79 // Sets the location of the inner viewport relative to the outer viewport. T he
76 // coordinates are in partial CSS pixels. 80 // coordinates are in partial CSS pixels.
77 void setLocation(const FloatPoint&); 81 void setLocation(const FloatPoint&);
78 void move(const FloatPoint&); 82 void move(const FloatPoint&);
79 83
80 // Sets the size of the inner viewport when unscaled in CSS pixels. 84 // Sets the size of the inner viewport when unscaled in CSS pixels.
81 // This will be clamped to the size of the outer viewport (the main frame). 85 // This will be clamped to the size of the outer viewport (the main frame).
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 virtual void notifyAnimationStarted(const GraphicsLayer*, double monotonicTi me) OVERRIDE; 138 virtual void notifyAnimationStarted(const GraphicsLayer*, double monotonicTi me) OVERRIDE;
135 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL ayerPaintingPhase, const IntRect& inClip) OVERRIDE; 139 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL ayerPaintingPhase, const IntRect& inClip) OVERRIDE;
136 virtual String debugName(const GraphicsLayer*) OVERRIDE; 140 virtual String debugName(const GraphicsLayer*) OVERRIDE;
137 141
138 void setupScrollbar(blink::WebScrollbar::Orientation); 142 void setupScrollbar(blink::WebScrollbar::Orientation);
139 FloatPoint clampOffsetToBoundaries(const FloatPoint&); 143 FloatPoint clampOffsetToBoundaries(const FloatPoint&);
140 144
141 LocalFrame* mainFrame() const; 145 LocalFrame* mainFrame() const;
142 146
143 FrameHost& m_frameHost; 147 FrameHost& m_frameHost;
148 OwnPtr<GraphicsLayer> m_rootTransformLayer;
144 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer; 149 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer;
145 OwnPtr<GraphicsLayer> m_pageScaleLayer; 150 OwnPtr<GraphicsLayer> m_pageScaleLayer;
146 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer; 151 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer;
147 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal; 152 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal;
148 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical; 153 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical;
149 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarHorizontal; 154 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarHorizontal;
150 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarVertical; 155 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarVertical;
151 156
152 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. 157 // Offset of the pinch viewport from the main frame's origin, in CSS pixels.
153 FloatPoint m_offset; 158 FloatPoint m_offset;
154 float m_scale; 159 float m_scale;
155 IntSize m_size; 160 IntSize m_size;
156 }; 161 };
157 162
158 } // namespace WebCore 163 } // namespace WebCore
159 164
160 #endif // PinchViewport_h 165 #endif // PinchViewport_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/frame/PinchViewport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698