| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * 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 * | 10 * |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #ifndef PageOverlay_h | 29 #ifndef PageOverlay_h |
| 30 #define PageOverlay_h | 30 #define PageOverlay_h |
| 31 | 31 |
| 32 #include "platform/graphics/GraphicsLayer.h" |
| 32 #include "platform/graphics/GraphicsLayerClient.h" | 33 #include "platform/graphics/GraphicsLayerClient.h" |
| 33 #include "platform/graphics/paint/DisplayItemClient.h" | 34 #include "platform/graphics/paint/DisplayItemClient.h" |
| 34 #include "wtf/OwnPtr.h" | 35 #include "wtf/OwnPtr.h" |
| 35 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" |
| 36 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 class GraphicsContext; | 41 class GraphicsContext; |
| 41 class GraphicsLayer; | |
| 42 class WebPageOverlay; | 42 class WebPageOverlay; |
| 43 class WebViewImpl; | 43 class WebViewImpl; |
| 44 | 44 |
| 45 // Manages a layer that is overlaid on a WebView's content. | 45 // Manages a layer that is overlaid on a WebView's content. |
| 46 // Clients can paint by implementing WebPageOverlay. | 46 // Clients can paint by implementing WebPageOverlay. |
| 47 // | 47 // |
| 48 // With Slimming Paint, internal clients can extract a GraphicsContext to add | 48 // With Slimming Paint, internal clients can extract a GraphicsContext to add |
| 49 // to the DisplayItemList owned by the GraphicsLayer. | 49 // to the DisplayItemList owned by the GraphicsLayer. |
| 50 class PageOverlay : public GraphicsLayerClient { | 50 class PageOverlay : public GraphicsLayerClient { |
| 51 public: | 51 public: |
| 52 static PassOwnPtr<PageOverlay> create(WebViewImpl*, WebPageOverlay*); | 52 static PassOwnPtr<PageOverlay> create(WebViewImpl*, WebPageOverlay*); |
| 53 | 53 |
| 54 ~PageOverlay() { } | 54 ~PageOverlay() { } |
| 55 | 55 |
| 56 WebPageOverlay* overlay() const { return m_overlay; } | 56 WebPageOverlay* overlay() const { return m_overlay; } |
| 57 void setOverlay(WebPageOverlay* overlay) { m_overlay = overlay; } | 57 void setOverlay(WebPageOverlay* overlay) { m_overlay = overlay; } |
| 58 | 58 |
| 59 int zOrder() const { return m_zOrder; } | |
| 60 void setZOrder(int zOrder) { m_zOrder = zOrder; } | |
| 61 | |
| 62 void clear(); | 59 void clear(); |
| 63 void update(); | 60 void update(); |
| 64 void paintWebFrame(GraphicsContext&); | 61 void paintWebFrame(GraphicsContext&); |
| 65 | 62 |
| 66 GraphicsLayer* graphicsLayer() const { return m_layer.get(); } | 63 GraphicsLayer* graphicsLayer() const { return m_layer.get(); } |
| 67 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } | 64 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi
s); } |
| 68 String debugName() const { return "PageOverlay"; } | 65 String debugName() const { return "PageOverlay"; } |
| 69 | 66 |
| 70 // GraphicsLayerClient implementation | 67 // GraphicsLayerClient implementation |
| 71 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain
tingPhase, const IntRect& inClip) override; | 68 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain
tingPhase, const IntRect& inClip) override; |
| 72 String debugName(const GraphicsLayer*) override; | 69 String debugName(const GraphicsLayer*) override; |
| 73 | 70 |
| 74 private: | 71 private: |
| 75 PageOverlay(WebViewImpl*, WebPageOverlay*); | 72 PageOverlay(WebViewImpl*, WebPageOverlay*); |
| 76 void invalidateWebFrame(); | 73 void invalidateWebFrame(); |
| 77 | 74 |
| 78 WebViewImpl* m_viewImpl; | 75 WebViewImpl* m_viewImpl; |
| 79 WebPageOverlay* m_overlay; | 76 WebPageOverlay* m_overlay; |
| 80 OwnPtr<GraphicsLayer> m_layer; | 77 OwnPtr<GraphicsLayer> m_layer; |
| 81 int m_zOrder; | |
| 82 }; | 78 }; |
| 83 | 79 |
| 84 } // namespace blink | 80 } // namespace blink |
| 85 | 81 |
| 86 #endif // PageOverlay_h | 82 #endif // PageOverlay_h |
| OLD | NEW |