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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // These messages are used to send Flush callbacks to the plugin. | 63 // These messages are used to send Flush callbacks to the plugin. |
64 void ViewInitiatedPaint(); | 64 void ViewInitiatedPaint(); |
65 | 65 |
66 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); | 66 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
67 | 67 |
68 protected: | 68 protected: |
69 ~PPB_Graphics3D_Impl() override; | 69 ~PPB_Graphics3D_Impl() override; |
70 // ppapi::PPB_Graphics3D_Shared overrides. | 70 // ppapi::PPB_Graphics3D_Shared overrides. |
71 gpu::CommandBuffer* GetCommandBuffer() override; | 71 gpu::CommandBuffer* GetCommandBuffer() override; |
72 gpu::GpuControl* GetGpuControl() override; | 72 gpu::GpuControl* GetGpuControl() override; |
73 int32_t DoSwapBuffers(const gpu::SyncToken& sync_token) override; | 73 int32_t DoSwapBuffers(const gpu::SyncToken& sync_token, |
| 74 int32_t width, |
| 75 int32_t height) override; |
74 | 76 |
75 private: | 77 private: |
76 explicit PPB_Graphics3D_Impl(PP_Instance instance); | 78 explicit PPB_Graphics3D_Impl(PP_Instance instance); |
77 | 79 |
78 bool InitRaw(PPB_Graphics3D_API* share_context, | 80 bool InitRaw(PPB_Graphics3D_API* share_context, |
79 const int32_t* attrib_list, | 81 const int32_t* attrib_list, |
80 gpu::Capabilities* capabilities, | 82 gpu::Capabilities* capabilities, |
81 base::SharedMemoryHandle* shared_state_handle, | 83 base::SharedMemoryHandle* shared_state_handle, |
82 gpu::CommandBufferId* command_buffer_id); | 84 gpu::CommandBufferId* command_buffer_id); |
83 | 85 |
(...skipping 19 matching lines...) Expand all Loading... |
103 | 105 |
104 // True if context is bound to instance. | 106 // True if context is bound to instance. |
105 bool bound_to_instance_; | 107 bool bound_to_instance_; |
106 // True when waiting for compositor to commit our backing texture. | 108 // True when waiting for compositor to commit our backing texture. |
107 bool commit_pending_; | 109 bool commit_pending_; |
108 | 110 |
109 #if DCHECK_IS_ON() | 111 #if DCHECK_IS_ON() |
110 bool lost_context_ = false; | 112 bool lost_context_ = false; |
111 #endif | 113 #endif |
112 | 114 |
| 115 // The width and height of the command buffer back buffer are first sized from |
| 116 // this process, but then resized by the pepper process. Cache the original |
| 117 // size. |
| 118 int32_t original_width_ = 0; |
| 119 int32_t original_height_ = 0; |
| 120 |
113 bool has_alpha_; | 121 bool has_alpha_; |
| 122 bool use_image_chromium_; |
114 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; | 123 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; |
115 | 124 |
116 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; | 125 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; |
117 | 126 |
118 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); | 127 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); |
119 }; | 128 }; |
120 | 129 |
121 } // namespace content | 130 } // namespace content |
122 | 131 |
123 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 132 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
OLD | NEW |