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

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: 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_innerViewportContainerLayer.get(); 72 return m_rootTransformLayer.get();
73 }
74
75 GraphicsLayer* rootTransformLayer()
76 {
77 return m_rootTransformLayer.get();
Ian Vollick 2014/06/04 13:22:12 why two accessors for the same value?
bokan 2014/06/04 15:12:26 You're right, this is overly verbose. Removed.
73 } 78 }
74 79
75 // Sets the location of the inner viewport relative to the outer viewport. T he 80 // Sets the location of the inner viewport relative to the outer viewport. T he
76 // coordinates are in partial CSS pixels. 81 // coordinates are in partial CSS pixels.
77 void setLocation(const FloatPoint&); 82 void setLocation(const FloatPoint&);
78 void move(const FloatPoint&); 83 void move(const FloatPoint&);
79 84
80 // Sets the size of the inner viewport when unscaled in CSS pixels. 85 // 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). 86 // This will be clamped to the size of the outer viewport (the main frame).
82 void setSize(const IntSize&); 87 void setSize(const IntSize&);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 virtual void notifyAnimationStarted(const GraphicsLayer*, double monotonicTi me) OVERRIDE; 130 virtual void notifyAnimationStarted(const GraphicsLayer*, double monotonicTi me) OVERRIDE;
126 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL ayerPaintingPhase, const IntRect& inClip) OVERRIDE; 131 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL ayerPaintingPhase, const IntRect& inClip) OVERRIDE;
127 virtual String debugName(const GraphicsLayer*) OVERRIDE; 132 virtual String debugName(const GraphicsLayer*) OVERRIDE;
128 133
129 void setupScrollbar(blink::WebScrollbar::Orientation); 134 void setupScrollbar(blink::WebScrollbar::Orientation);
130 FloatPoint clampOffsetToBoundaries(const FloatPoint&); 135 FloatPoint clampOffsetToBoundaries(const FloatPoint&);
131 136
132 LocalFrame* mainFrame() const; 137 LocalFrame* mainFrame() const;
133 138
134 FrameHost& m_frameHost; 139 FrameHost& m_frameHost;
140 OwnPtr<GraphicsLayer> m_rootTransformLayer;
135 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer; 141 OwnPtr<GraphicsLayer> m_innerViewportContainerLayer;
136 OwnPtr<GraphicsLayer> m_pageScaleLayer; 142 OwnPtr<GraphicsLayer> m_pageScaleLayer;
137 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer; 143 OwnPtr<GraphicsLayer> m_innerViewportScrollLayer;
138 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal; 144 OwnPtr<GraphicsLayer> m_overlayScrollbarHorizontal;
139 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical; 145 OwnPtr<GraphicsLayer> m_overlayScrollbarVertical;
140 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarHorizontal; 146 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarHorizontal;
141 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarVertical; 147 OwnPtr<blink::WebScrollbarLayer> m_webOverlayScrollbarVertical;
142 148
143 // Offset of the pinch viewport from the main frame's origin, in CSS pixels. 149 // Offset of the pinch viewport from the main frame's origin, in CSS pixels.
144 FloatPoint m_offset; 150 FloatPoint m_offset;
145 float m_scale; 151 float m_scale;
146 IntSize m_size; 152 IntSize m_size;
147 }; 153 };
148 154
149 } // namespace WebCore 155 } // namespace WebCore
150 156
151 #endif // PinchViewport_h 157 #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