OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "platform/animation/CompositorAnimationDelegate.h" | 29 #include "platform/animation/CompositorAnimationDelegate.h" |
30 #include "platform/animation/CompositorAnimationPlayer.h" | 30 #include "platform/animation/CompositorAnimationPlayer.h" |
31 #include "platform/animation/CompositorAnimationPlayerClient.h" | 31 #include "platform/animation/CompositorAnimationPlayerClient.h" |
32 #include "platform/graphics/LinkHighlight.h" | 32 #include "platform/graphics/LinkHighlight.h" |
33 #include "platform/graphics/Path.h" | 33 #include "platform/graphics/Path.h" |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "public/platform/WebContentLayer.h" | 35 #include "public/platform/WebContentLayer.h" |
36 #include "public/platform/WebContentLayerClient.h" | 36 #include "public/platform/WebContentLayerClient.h" |
37 #include "web/WebExport.h" | 37 #include "web/WebExport.h" |
38 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
39 #include <memory> | 39 #include "wtf/OwnPtr.h" |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 class GraphicsLayer; | 43 class GraphicsLayer; |
44 class LayoutBoxModelObject; | 44 class LayoutBoxModelObject; |
45 class Node; | 45 class Node; |
46 class WebContentLayer; | 46 class WebContentLayer; |
47 class WebLayer; | 47 class WebLayer; |
48 class WebViewImpl; | 48 class WebViewImpl; |
49 | 49 |
50 class WEB_EXPORT LinkHighlightImpl final : public LinkHighlight | 50 class WEB_EXPORT LinkHighlightImpl final : public LinkHighlight |
51 , public WebContentLayerClient | 51 , public WebContentLayerClient |
52 , public CompositorAnimationDelegate | 52 , public CompositorAnimationDelegate |
53 , public CompositorAnimationPlayerClient { | 53 , public CompositorAnimationPlayerClient { |
54 public: | 54 public: |
55 static std::unique_ptr<LinkHighlightImpl> create(Node*, WebViewImpl*); | 55 static PassOwnPtr<LinkHighlightImpl> create(Node*, WebViewImpl*); |
56 ~LinkHighlightImpl() override; | 56 ~LinkHighlightImpl() override; |
57 | 57 |
58 WebContentLayer* contentLayer(); | 58 WebContentLayer* contentLayer(); |
59 WebLayer* clipLayer(); | 59 WebLayer* clipLayer(); |
60 void startHighlightAnimationIfNeeded(); | 60 void startHighlightAnimationIfNeeded(); |
61 void updateGeometry(); | 61 void updateGeometry(); |
62 | 62 |
63 // WebContentLayerClient implementation. | 63 // WebContentLayerClient implementation. |
64 gfx::Rect paintableRegion() override; | 64 gfx::Rect paintableRegion() override; |
65 void paintContents(WebDisplayItemList*, WebContentLayerClient::PaintingContr
olSetting) override; | 65 void paintContents(WebDisplayItemList*, WebContentLayerClient::PaintingContr
olSetting) override; |
(...skipping 18 matching lines...) Expand all Loading... |
84 | 84 |
85 void releaseResources(); | 85 void releaseResources(); |
86 void computeQuads(const Node&, Vector<FloatQuad>&) const; | 86 void computeQuads(const Node&, Vector<FloatQuad>&) const; |
87 | 87 |
88 void attachLinkHighlightToCompositingLayer(const LayoutBoxModelObject& paint
InvalidationContainer); | 88 void attachLinkHighlightToCompositingLayer(const LayoutBoxModelObject& paint
InvalidationContainer); |
89 void clearGraphicsLayerLinkHighlightPointer(); | 89 void clearGraphicsLayerLinkHighlightPointer(); |
90 // This function computes the highlight path, and returns true if it has cha
nged | 90 // This function computes the highlight path, and returns true if it has cha
nged |
91 // size since the last call to this function. | 91 // size since the last call to this function. |
92 bool computeHighlightLayerPathAndPosition(const LayoutBoxModelObject&); | 92 bool computeHighlightLayerPathAndPosition(const LayoutBoxModelObject&); |
93 | 93 |
94 std::unique_ptr<WebContentLayer> m_contentLayer; | 94 OwnPtr<WebContentLayer> m_contentLayer; |
95 std::unique_ptr<WebLayer> m_clipLayer; | 95 OwnPtr<WebLayer> m_clipLayer; |
96 Path m_path; | 96 Path m_path; |
97 | 97 |
98 Persistent<Node> m_node; | 98 Persistent<Node> m_node; |
99 WebViewImpl* m_owningWebViewImpl; | 99 WebViewImpl* m_owningWebViewImpl; |
100 GraphicsLayer* m_currentGraphicsLayer; | 100 GraphicsLayer* m_currentGraphicsLayer; |
101 bool m_isScrollingGraphicsLayer; | 101 bool m_isScrollingGraphicsLayer; |
102 std::unique_ptr<CompositorAnimationPlayer> m_compositorPlayer; | 102 OwnPtr<CompositorAnimationPlayer> m_compositorPlayer; |
103 | 103 |
104 bool m_geometryNeedsUpdate; | 104 bool m_geometryNeedsUpdate; |
105 bool m_isAnimating; | 105 bool m_isAnimating; |
106 double m_startTime; | 106 double m_startTime; |
107 }; | 107 }; |
108 | 108 |
109 } // namespace blink | 109 } // namespace blink |
110 | 110 |
111 #endif // LinkHighlightImpl_h | 111 #endif // LinkHighlightImpl_h |
OLD | NEW |