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

Unified Diff: Source/WebKit/chromium/src/PinchViewports.h

Issue 16799005: Insert pinch zoom virtual viewport layers to graphics layer tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: Source/WebKit/chromium/src/PinchViewports.h
diff --git a/Source/WebKit/chromium/src/ViewportAnchor.h b/Source/WebKit/chromium/src/PinchViewports.h
similarity index 50%
copy from Source/WebKit/chromium/src/ViewportAnchor.h
copy to Source/WebKit/chromium/src/PinchViewports.h
index 5cbc120c566a6939b848484aac53dbf11fe8aef0..642603460781ca6d628255d219b3c513bc80da4e 100644
--- a/Source/WebKit/chromium/src/ViewportAnchor.h
+++ b/Source/WebKit/chromium/src/PinchViewports.h
@@ -28,51 +28,61 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ViewportAnchor_h
-#define ViewportAnchor_h
+#ifndef PinchViewports_h
+#define PinchViewports_h
#include "core/platform/graphics/FloatSize.h"
-#include "core/platform/graphics/IntPoint.h"
-#include "core/platform/graphics/IntRect.h"
-#include "core/platform/graphics/LayoutRect.h"
-#include <wtf/RefCounted.h>
+#include "core/platform/graphics/GraphicsLayerClient.h"
+#include "public/platform/WebScrollbar.h"
+#include "public/platform/WebSize.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
namespace WebCore {
-class EventHandler;
-class IntSize;
-class Node;
+class FloatSize;
+class GraphicsContext;
+class GraphicsLayer;
+class IntRect;
}
namespace WebKit {
-// ViewportAnchor provides a way to anchor a viewport origin to a DOM node.
-// In particular, the user supplies the current viewport (in CSS coordinates)
-// and an anchor point (in view coordinates, e.g., (0, 0) == viewport origin,
-// (0.5, 0) == viewport top center). The anchor point tracks the underlying DOM
-// node; as the node moves or the view is resized, the viewport anchor maintains
-// its orientation relative to the node, and the viewport origin maintains its
-// orientation relative to the anchor.
-class ViewportAnchor {
- WTF_MAKE_NONCOPYABLE(ViewportAnchor);
+class WebLayerTreeView;
+class WebScrollbarLayer;
+class WebViewImpl;
+
+class PinchViewports : WebCore::GraphicsLayerClient {
public:
- explicit ViewportAnchor(WebCore::EventHandler* eventHandler);
+ static PassOwnPtr<PinchViewports> create(WebViewImpl* owner);
+ ~PinchViewports();
- void setAnchor(const WebCore::IntRect& viewRect, const WebCore::FloatSize& anchorInViewCoords);
+ void setOverflowControlsHostLayer(WebCore::GraphicsLayer*);
+ WebCore::GraphicsLayer* rootGraphicsLayer()
+ {
+ return m_innerViewportClipLayer.get();
+ }
+ void setViewportSize(const WebSize&);
aelias_OOO_until_Jul13 2013/06/18 19:52:28 nit: use WebCore::IntSize since this isn't a Chrom
wjmaclean 2013/06/18 20:11:40 Done.
- WebCore::IntPoint computeOrigin(const WebCore::IntSize& currentViewSize) const;
+ void registerViewportLayersWithTreeView(WebLayerTreeView*) const;
+ void clearViewportLayersForTreeView(WebLayerTreeView*) const;
-private:
- WebCore::EventHandler* m_eventHandler;
+ // GraphicsLayerClient implementation.
+ virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) OVERRIDE;
+ virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& inClip) OVERRIDE;
- WebCore::IntRect m_viewRect;
+private:
+ explicit PinchViewports(WebViewImpl* owner);
- RefPtr<WebCore::Node> m_anchorNode;
- WebCore::LayoutRect m_anchorNodeBounds;
+ void setupScrollbar(WebKit::WebScrollbar::Orientation);
- WebCore::FloatSize m_anchorInViewCoords;
- WebCore::FloatSize m_anchorInNodeCoords;
+ WebViewImpl* m_owner;
+ OwnPtr<WebCore::GraphicsLayer> m_innerViewportClipLayer;
+ OwnPtr<WebCore::GraphicsLayer> m_pageScaleLayer;
+ OwnPtr<WebCore::GraphicsLayer> m_innerViewportScrollLayer;
+ OwnPtr<WebCore::GraphicsLayer> m_overlayScrollbarHorizontal;
+ OwnPtr<WebCore::GraphicsLayer> m_overlayScrollbarVertical;
};
} // namespace WebKit
- #endif
+#endif // PinchViewports_h

Powered by Google App Engine
This is Rietveld 408576698