OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // Returns true if binding/unbinding is successful. | 53 // Returns true if binding/unbinding is successful. |
54 bool BindToInstance(bool bind); | 54 bool BindToInstance(bool bind); |
55 | 55 |
56 // Returns true if the backing texture is always opaque. | 56 // Returns true if the backing texture is always opaque. |
57 bool IsOpaque(); | 57 bool IsOpaque(); |
58 | 58 |
59 // Notifications about the view's progress painting. See PluginInstance. | 59 // Notifications about the view's progress painting. See PluginInstance. |
60 // These messages are used to send Flush callbacks to the plugin. | 60 // These messages are used to send Flush callbacks to the plugin. |
61 void ViewInitiatedPaint(); | 61 void ViewInitiatedPaint(); |
62 | 62 |
63 void GetBackingMailbox(gpu::Mailbox* mailbox, gpu::SyncToken* sync_token) { | 63 bool TakeBackingMailbox(gpu::Mailbox* mailbox, gpu::SyncToken* sync_token); |
64 *mailbox = mailbox_; | 64 void ReturnBackingMailbox(const gpu::Mailbox& mailbox, |
65 *sync_token = sync_token_; | 65 const gpu::SyncToken& sync_token, |
66 } | 66 bool is_lost); |
67 | 67 |
68 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); | 68 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
69 | 69 |
70 gpu::GpuChannelHost* channel() { return channel_.get(); } | 70 gpu::GpuChannelHost* channel() { return channel_.get(); } |
71 | 71 |
72 protected: | 72 protected: |
73 ~PPB_Graphics3D_Impl() override; | 73 ~PPB_Graphics3D_Impl() override; |
74 // ppapi::PPB_Graphics3D_Shared overrides. | 74 // ppapi::PPB_Graphics3D_Shared overrides. |
75 gpu::CommandBuffer* GetCommandBuffer() override; | 75 gpu::CommandBuffer* GetCommandBuffer() override; |
76 gpu::GpuControl* GetGpuControl() override; | 76 gpu::GpuControl* GetGpuControl() override; |
(...skipping 19 matching lines...) Expand all Loading... |
96 | 96 |
97 // True if context is bound to instance. | 97 // True if context is bound to instance. |
98 bool bound_to_instance_; | 98 bool bound_to_instance_; |
99 // True when waiting for compositor to commit our backing texture. | 99 // True when waiting for compositor to commit our backing texture. |
100 bool commit_pending_; | 100 bool commit_pending_; |
101 | 101 |
102 #if DCHECK_IS_ON() | 102 #if DCHECK_IS_ON() |
103 bool lost_context_ = false; | 103 bool lost_context_ = false; |
104 #endif | 104 #endif |
105 | 105 |
106 gpu::Mailbox mailbox_; | |
107 gpu::SyncToken sync_token_; | |
108 bool has_alpha_; | 106 bool has_alpha_; |
109 scoped_refptr<gpu::GpuChannelHost> channel_; | 107 scoped_refptr<gpu::GpuChannelHost> channel_; |
110 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; | 108 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; |
111 | 109 |
112 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; | 110 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; |
113 | 111 |
114 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); | 112 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); |
115 }; | 113 }; |
116 | 114 |
117 } // namespace content | 115 } // namespace content |
118 | 116 |
119 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 117 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
OLD | NEW |