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 19 matching lines...) Expand all Loading... |
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 "public/platform/WebAnimationDelegate.h" | 33 #include "public/platform/WebAnimationDelegate.h" |
34 #include "public/platform/WebContentLayer.h" | 34 #include "public/platform/WebContentLayer.h" |
35 #include "public/platform/WebContentLayerClient.h" | 35 #include "public/platform/WebContentLayerClient.h" |
36 #include "public/platform/WebLayer.h" | 36 #include "public/platform/WebLayer.h" |
37 #include "wtf/OwnPtr.h" | 37 #include "wtf/OwnPtr.h" |
38 #include "wtf/Vector.h" | 38 #include "wtf/Vector.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace blink { |
41 class RenderLayer; | 41 class RenderLayer; |
42 class RenderObject; | 42 class RenderObject; |
43 class Node; | 43 class Node; |
44 } | 44 } |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 | 47 |
48 struct WebFloatRect; | 48 struct WebFloatRect; |
49 struct WebRect; | 49 struct WebRect; |
50 class WebViewImpl; | 50 class WebViewImpl; |
51 | 51 |
52 class LinkHighlight FINAL : public WebContentLayerClient, public WebAnimationDel
egate, WebCore::LinkHighlightClient { | 52 class LinkHighlight FINAL : public WebContentLayerClient, public WebAnimationDel
egate, blink::LinkHighlightClient { |
53 public: | 53 public: |
54 static PassOwnPtr<LinkHighlight> create(WebCore::Node*, WebViewImpl*); | 54 static PassOwnPtr<LinkHighlight> create(blink::Node*, WebViewImpl*); |
55 virtual ~LinkHighlight(); | 55 virtual ~LinkHighlight(); |
56 | 56 |
57 WebContentLayer* contentLayer(); | 57 WebContentLayer* contentLayer(); |
58 WebLayer* clipLayer(); | 58 WebLayer* clipLayer(); |
59 void startHighlightAnimationIfNeeded(); | 59 void startHighlightAnimationIfNeeded(); |
60 void updateGeometry(); | 60 void updateGeometry(); |
61 | 61 |
62 // WebContentLayerClient implementation. | 62 // WebContentLayerClient implementation. |
63 virtual void paintContents(WebCanvas*, const WebRect& clipRect, bool canPain
tLCDText, WebFloatRect& opaque, | 63 virtual void paintContents(WebCanvas*, const WebRect& clipRect, bool canPain
tLCDText, WebFloatRect& opaque, |
64 WebContentLayerClient::GraphicsContextStatus = GraphicsContextEnabled) O
VERRIDE; | 64 WebContentLayerClient::GraphicsContextStatus = GraphicsContextEnabled) O
VERRIDE; |
65 | 65 |
66 // WebAnimationDelegate implementation. | 66 // WebAnimationDelegate implementation. |
67 virtual void notifyAnimationStarted(double monotonicTime, blink::WebAnimatio
n::TargetProperty) OVERRIDE; | 67 virtual void notifyAnimationStarted(double monotonicTime, blink::WebAnimatio
n::TargetProperty) OVERRIDE; |
68 virtual void notifyAnimationFinished(double monotonicTime, blink::WebAnimati
on::TargetProperty) OVERRIDE; | 68 virtual void notifyAnimationFinished(double monotonicTime, blink::WebAnimati
on::TargetProperty) OVERRIDE; |
69 | 69 |
70 // LinkHighlightClient inplementation. | 70 // LinkHighlightClient inplementation. |
71 virtual void invalidate() OVERRIDE; | 71 virtual void invalidate() OVERRIDE; |
72 virtual WebLayer* layer() OVERRIDE; | 72 virtual WebLayer* layer() OVERRIDE; |
73 virtual void clearCurrentGraphicsLayer() OVERRIDE; | 73 virtual void clearCurrentGraphicsLayer() OVERRIDE; |
74 | 74 |
75 WebCore::GraphicsLayer* currentGraphicsLayerForTesting() const { return m_cu
rrentGraphicsLayer; } | 75 blink::GraphicsLayer* currentGraphicsLayerForTesting() const { return m_curr
entGraphicsLayer; } |
76 | 76 |
77 private: | 77 private: |
78 LinkHighlight(WebCore::Node*, WebViewImpl*); | 78 LinkHighlight(blink::Node*, WebViewImpl*); |
79 | 79 |
80 void releaseResources(); | 80 void releaseResources(); |
81 void computeQuads(WebCore::Node*, WTF::Vector<WebCore::FloatQuad>&) const; | 81 void computeQuads(blink::Node*, WTF::Vector<blink::FloatQuad>&) const; |
82 | 82 |
83 WebCore::RenderLayer* computeEnclosingCompositingLayer(); | 83 blink::RenderLayer* computeEnclosingCompositingLayer(); |
84 void clearGraphicsLayerLinkHighlightPointer(); | 84 void clearGraphicsLayerLinkHighlightPointer(); |
85 // This function computes the highlight path, and returns true if it has cha
nged | 85 // This function computes the highlight path, and returns true if it has cha
nged |
86 // size since the last call to this function. | 86 // size since the last call to this function. |
87 bool computeHighlightLayerPathAndPosition(WebCore::RenderLayer*); | 87 bool computeHighlightLayerPathAndPosition(blink::RenderLayer*); |
88 | 88 |
89 OwnPtr<WebContentLayer> m_contentLayer; | 89 OwnPtr<WebContentLayer> m_contentLayer; |
90 OwnPtr<WebLayer> m_clipLayer; | 90 OwnPtr<WebLayer> m_clipLayer; |
91 WebCore::Path m_path; | 91 blink::Path m_path; |
92 | 92 |
93 RefPtrWillBePersistent<WebCore::Node> m_node; | 93 RefPtrWillBePersistent<blink::Node> m_node; |
94 WebViewImpl* m_owningWebViewImpl; | 94 WebViewImpl* m_owningWebViewImpl; |
95 WebCore::GraphicsLayer* m_currentGraphicsLayer; | 95 blink::GraphicsLayer* m_currentGraphicsLayer; |
96 | 96 |
97 bool m_geometryNeedsUpdate; | 97 bool m_geometryNeedsUpdate; |
98 bool m_isAnimating; | 98 bool m_isAnimating; |
99 double m_startTime; | 99 double m_startTime; |
100 }; | 100 }; |
101 | 101 |
102 } // namespace blink | 102 } // namespace blink |
103 | 103 |
104 #endif | 104 #endif |
OLD | NEW |