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 14 matching lines...) Expand all Loading... |
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/GraphicsLayer.h" |
33 #include "platform/graphics/GraphicsLayerClient.h" | 33 #include "platform/graphics/GraphicsLayerClient.h" |
34 #include "platform/graphics/paint/DisplayItemClient.h" | 34 #include "platform/graphics/paint/DisplayItemClient.h" |
| 35 #include "wtf/FastAllocBase.h" |
35 #include "wtf/OwnPtr.h" | 36 #include "wtf/OwnPtr.h" |
36 #include "wtf/PassOwnPtr.h" | 37 #include "wtf/PassOwnPtr.h" |
37 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 class GraphicsContext; | 42 class GraphicsContext; |
42 class WebPageOverlay; | 43 class WebPageOverlay; |
43 class WebViewImpl; | 44 class WebViewImpl; |
44 class WebGraphicsContext; | 45 class WebGraphicsContext; |
45 | 46 |
46 // Manages a layer that is overlaid on a WebView's content. | 47 // Manages a layer that is overlaid on a WebView's content. |
47 // Clients can paint by implementing WebPageOverlay. | 48 // Clients can paint by implementing WebPageOverlay. |
48 // | 49 // |
49 // With Slimming Paint, internal clients can extract a GraphicsContext to add | 50 // With Slimming Paint, internal clients can extract a GraphicsContext to add |
50 // to the DisplayItemList owned by the GraphicsLayer | 51 // to the DisplayItemList owned by the GraphicsLayer |
51 class PageOverlay : public GraphicsLayerClient { | 52 class PageOverlay : public GraphicsLayerClient { |
| 53 WTF_MAKE_FAST_ALLOCATED(PageOverlay); |
52 public: | 54 public: |
53 class Delegate : public GarbageCollectedFinalized<Delegate> { | 55 class Delegate : public GarbageCollectedFinalized<Delegate> { |
54 public: | 56 public: |
55 DEFINE_INLINE_VIRTUAL_TRACE() { } | 57 DEFINE_INLINE_VIRTUAL_TRACE() { } |
56 | 58 |
57 // Paints page overlay contents. | 59 // Paints page overlay contents. |
58 virtual void paintPageOverlay(WebGraphicsContext*, const WebSize& webVie
wSize) = 0; | 60 virtual void paintPageOverlay(WebGraphicsContext*, const WebSize& webVie
wSize) = 0; |
59 virtual ~Delegate() { } | 61 virtual ~Delegate() { } |
60 }; | 62 }; |
61 | 63 |
(...skipping 15 matching lines...) Expand all Loading... |
77 PageOverlay(WebViewImpl*, PageOverlay::Delegate*); | 79 PageOverlay(WebViewImpl*, PageOverlay::Delegate*); |
78 | 80 |
79 WebViewImpl* m_viewImpl; | 81 WebViewImpl* m_viewImpl; |
80 Persistent<PageOverlay::Delegate> m_delegate; | 82 Persistent<PageOverlay::Delegate> m_delegate; |
81 OwnPtr<GraphicsLayer> m_layer; | 83 OwnPtr<GraphicsLayer> m_layer; |
82 }; | 84 }; |
83 | 85 |
84 } // namespace blink | 86 } // namespace blink |
85 | 87 |
86 #endif // PageOverlay_h | 88 #endif // PageOverlay_h |
OLD | NEW |