| 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 12 matching lines...) Expand all Loading... |
| 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef LinkHighlight_h | 26 #ifndef LinkHighlight_h |
| 27 #define LinkHighlight_h | 27 #define LinkHighlight_h |
| 28 | 28 |
| 29 #include "platform/geometry/FloatPoint.h" | 29 #include "platform/geometry/FloatPoint.h" |
| 30 #include "platform/geometry/IntPoint.h" | 30 #include "platform/geometry/IntPoint.h" |
| 31 #include "platform/graphics/GraphicsLayer.h" | 31 #include "platform/graphics/GraphicsLayer.h" |
| 32 #include "platform/graphics/Path.h" | 32 #include "platform/graphics/Path.h" |
| 33 #include "platform/graphics/paint/DisplayItemClient.h" |
| 33 #include "public/platform/WebCompositorAnimationDelegate.h" | 34 #include "public/platform/WebCompositorAnimationDelegate.h" |
| 34 #include "public/platform/WebContentLayer.h" | 35 #include "public/platform/WebContentLayer.h" |
| 35 #include "public/platform/WebContentLayerClient.h" | 36 #include "public/platform/WebContentLayerClient.h" |
| 36 #include "public/platform/WebLayer.h" | 37 #include "public/platform/WebLayer.h" |
| 37 #include "wtf/OwnPtr.h" | 38 #include "wtf/OwnPtr.h" |
| 38 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
| 39 | 40 |
| 40 namespace blink { | 41 namespace blink { |
| 41 | 42 |
| 43 class DisplayItemList; |
| 42 class LayoutBoxModelObject; | 44 class LayoutBoxModelObject; |
| 43 class Node; | 45 class Node; |
| 44 struct WebRect; | 46 struct WebRect; |
| 45 class WebViewImpl; | 47 class WebViewImpl; |
| 46 | 48 |
| 47 class LinkHighlight final : public WebContentLayerClient, public WebCompositorAn
imationDelegate, LinkHighlightClient { | 49 class LinkHighlight final : public WebContentLayerClient, public WebCompositorAn
imationDelegate, LinkHighlightClient { |
| 48 public: | 50 public: |
| 49 static PassOwnPtr<LinkHighlight> create(Node*, WebViewImpl*); | 51 static PassOwnPtr<LinkHighlight> create(Node*, WebViewImpl*); |
| 50 ~LinkHighlight() override; | 52 ~LinkHighlight() override; |
| 51 | 53 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 62 void notifyAnimationStarted(double monotonicTime, int group) override; | 64 void notifyAnimationStarted(double monotonicTime, int group) override; |
| 63 void notifyAnimationFinished(double monotonicTime, int group) override; | 65 void notifyAnimationFinished(double monotonicTime, int group) override; |
| 64 | 66 |
| 65 // LinkHighlightClient implementation. | 67 // LinkHighlightClient implementation. |
| 66 void invalidate() override; | 68 void invalidate() override; |
| 67 WebLayer* layer() override; | 69 WebLayer* layer() override; |
| 68 void clearCurrentGraphicsLayer() override; | 70 void clearCurrentGraphicsLayer() override; |
| 69 | 71 |
| 70 GraphicsLayer* currentGraphicsLayerForTesting() const { return m_currentGrap
hicsLayer; } | 72 GraphicsLayer* currentGraphicsLayerForTesting() const { return m_currentGrap
hicsLayer; } |
| 71 | 73 |
| 74 |
| 72 private: | 75 private: |
| 73 LinkHighlight(Node*, WebViewImpl*); | 76 LinkHighlight(Node*, WebViewImpl*); |
| 74 | 77 |
| 75 void releaseResources(); | 78 void releaseResources(); |
| 76 void computeQuads(const Node&, WTF::Vector<FloatQuad>&) const; | 79 void computeQuads(const Node&, WTF::Vector<FloatQuad>&) const; |
| 77 | 80 |
| 78 void attachLinkHighlightToCompositingLayer(const LayoutBoxModelObject* paint
InvalidationContainer); | 81 void attachLinkHighlightToCompositingLayer(const LayoutBoxModelObject* paint
InvalidationContainer); |
| 79 void clearGraphicsLayerLinkHighlightPointer(); | 82 void clearGraphicsLayerLinkHighlightPointer(); |
| 80 // This function computes the highlight path, and returns true if it has cha
nged | 83 // This function computes the highlight path, and returns true if it has cha
nged |
| 81 // size since the last call to this function. | 84 // size since the last call to this function. |
| 82 bool computeHighlightLayerPathAndPosition(const LayoutBoxModelObject*); | 85 bool computeHighlightLayerPathAndPosition(const LayoutBoxModelObject*); |
| 83 | 86 |
| 84 OwnPtr<WebContentLayer> m_contentLayer; | 87 OwnPtr<WebContentLayer> m_contentLayer; |
| 85 OwnPtr<WebLayer> m_clipLayer; | 88 OwnPtr<WebLayer> m_clipLayer; |
| 86 Path m_path; | 89 Path m_path; |
| 87 | 90 |
| 88 RefPtrWillBePersistent<Node> m_node; | 91 RefPtrWillBePersistent<Node> m_node; |
| 89 WebViewImpl* m_owningWebViewImpl; | 92 WebViewImpl* m_owningWebViewImpl; |
| 90 GraphicsLayer* m_currentGraphicsLayer; | 93 GraphicsLayer* m_currentGraphicsLayer; |
| 91 | 94 |
| 92 bool m_geometryNeedsUpdate; | 95 bool m_geometryNeedsUpdate; |
| 93 bool m_isAnimating; | 96 bool m_isAnimating; |
| 94 double m_startTime; | 97 double m_startTime; |
| 95 }; | 98 }; |
| 96 | 99 |
| 97 } // namespace blink | 100 } // namespace blink |
| 98 | 101 |
| 99 #endif | 102 #endif |
| OLD | NEW |