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 10 matching lines...) Expand all Loading... |
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
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 Canvas2DLayerBridge_h | 26 #ifndef Canvas2DLayerBridge_h |
27 #define Canvas2DLayerBridge_h | 27 #define Canvas2DLayerBridge_h |
28 | 28 |
29 #include "SkDeferredCanvas.h" | 29 #include "SkDeferredCanvas.h" |
30 #include "SkImage.h" | 30 #include "SkImage.h" |
31 #include "core/platform/graphics/GraphicsContext3D.h" | 31 #include "platform/PlatformExport.h" |
32 #include "platform/geometry/IntSize.h" | 32 #include "platform/geometry/IntSize.h" |
| 33 #include "platform/graphics/GraphicsContext3D.h" |
33 #include "public/platform/WebExternalTextureLayer.h" | 34 #include "public/platform/WebExternalTextureLayer.h" |
34 #include "public/platform/WebExternalTextureLayerClient.h" | 35 #include "public/platform/WebExternalTextureLayerClient.h" |
35 #include "public/platform/WebExternalTextureMailbox.h" | 36 #include "public/platform/WebExternalTextureMailbox.h" |
36 #include "wtf/DoublyLinkedList.h" | 37 #include "wtf/DoublyLinkedList.h" |
37 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
38 #include "wtf/RefPtr.h" | 39 #include "wtf/RefPtr.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 class WebGraphicsContext3D; | 42 class WebGraphicsContext3D; |
42 } | 43 } |
43 | 44 |
44 namespace WebCore { | 45 namespace WebCore { |
45 | 46 |
46 class Canvas2DLayerBridge; | 47 class Canvas2DLayerBridge; |
47 class PassCanvas2DLayerBridgePtr; | 48 class PassCanvas2DLayerBridgePtr; |
48 | 49 |
49 class Canvas2DLayerBridgePtr { | 50 class PLATFORM_EXPORT Canvas2DLayerBridgePtr { |
50 public: | 51 public: |
51 Canvas2DLayerBridgePtr() { } | 52 Canvas2DLayerBridgePtr() { } |
52 Canvas2DLayerBridgePtr(const PassRefPtr<Canvas2DLayerBridge>& ptr) { m_ptr =
ptr; } | 53 Canvas2DLayerBridgePtr(const PassRefPtr<Canvas2DLayerBridge>& ptr) { m_ptr =
ptr; } |
53 ~Canvas2DLayerBridgePtr() { clear(); } | 54 ~Canvas2DLayerBridgePtr() { clear(); } |
54 Canvas2DLayerBridge* operator->() const { return m_ptr.get(); } | 55 Canvas2DLayerBridge* operator->() const { return m_ptr.get(); } |
55 Canvas2DLayerBridgePtr& operator=(const PassRefPtr<Canvas2DLayerBridge>&); | 56 Canvas2DLayerBridgePtr& operator=(const PassRefPtr<Canvas2DLayerBridge>&); |
56 Canvas2DLayerBridge* get() const { return m_ptr.get(); } | 57 Canvas2DLayerBridge* get() const { return m_ptr.get(); } |
57 operator bool () const { return m_ptr; } | 58 operator bool () const { return m_ptr; } |
58 void clear(); | 59 void clear(); |
59 PassRefPtr<Canvas2DLayerBridge> release() WARN_UNUSED_RETURN { return m_ptr.
release(); } | 60 PassRefPtr<Canvas2DLayerBridge> release() WARN_UNUSED_RETURN { return m_ptr.
release(); } |
60 private: | 61 private: |
61 RefPtr<Canvas2DLayerBridge> m_ptr; | 62 RefPtr<Canvas2DLayerBridge> m_ptr; |
62 }; | 63 }; |
63 | 64 |
64 class Canvas2DLayerBridge : public blink::WebExternalTextureLayerClient, public
SkDeferredCanvas::NotificationClient, public DoublyLinkedListNode<Canvas2DLayerB
ridge>, public RefCounted<Canvas2DLayerBridge> { | 65 class PLATFORM_EXPORT Canvas2DLayerBridge : public blink::WebExternalTextureLaye
rClient, public SkDeferredCanvas::NotificationClient, public DoublyLinkedListNod
e<Canvas2DLayerBridge>, public RefCounted<Canvas2DLayerBridge> { |
65 WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge); | 66 WTF_MAKE_NONCOPYABLE(Canvas2DLayerBridge); |
66 public: | 67 public: |
67 enum OpacityMode { | 68 enum OpacityMode { |
68 Opaque, | 69 Opaque, |
69 NonOpaque | 70 NonOpaque |
70 }; | 71 }; |
71 | 72 |
72 static PassRefPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D>,
const IntSize&, OpacityMode, int msaaSampleCount); | 73 static PassRefPtr<Canvas2DLayerBridge> create(PassRefPtr<GraphicsContext3D>,
const IntSize&, OpacityMode, int msaaSampleCount); |
73 | 74 |
74 virtual ~Canvas2DLayerBridge(); | 75 virtual ~Canvas2DLayerBridge(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 MailboxInfo(const MailboxInfo&); | 136 MailboxInfo(const MailboxInfo&); |
136 MailboxInfo() {} | 137 MailboxInfo() {} |
137 }; | 138 }; |
138 MailboxInfo* createMailboxInfo(); | 139 MailboxInfo* createMailboxInfo(); |
139 | 140 |
140 uint32_t m_lastImageId; | 141 uint32_t m_lastImageId; |
141 Vector<MailboxInfo> m_mailboxes; | 142 Vector<MailboxInfo> m_mailboxes; |
142 }; | 143 }; |
143 } | 144 } |
144 #endif | 145 #endif |
OLD | NEW |