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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void ViewInitiatedPaint(); | 68 void ViewInitiatedPaint(); |
69 | 69 |
70 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); | 70 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
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; |
77 int32_t DoSwapBuffers(const gpu::SyncToken& sync_token, | 77 int32_t DoSwapBuffers(const gpu::SyncToken& sync_token, |
78 const gfx::Size& size) override; | 78 int32_t width, |
| 79 int32_t height) override; |
79 | 80 |
80 private: | 81 private: |
81 explicit PPB_Graphics3D_Impl(PP_Instance instance); | 82 explicit PPB_Graphics3D_Impl(PP_Instance instance); |
82 | 83 |
83 bool InitRaw(PPB_Graphics3D_API* share_context, | 84 bool InitRaw(PPB_Graphics3D_API* share_context, |
84 const gpu::gles2::ContextCreationAttribHelper& requested_attribs, | 85 const gpu::gles2::ContextCreationAttribHelper& requested_attribs, |
85 gpu::Capabilities* capabilities, | 86 gpu::Capabilities* capabilities, |
86 base::SharedMemoryHandle* shared_state_handle, | 87 base::SharedMemoryHandle* shared_state_handle, |
87 gpu::CommandBufferId* command_buffer_id); | 88 gpu::CommandBufferId* command_buffer_id); |
88 | 89 |
(...skipping 19 matching lines...) Expand all Loading... |
108 | 109 |
109 // True if context is bound to instance. | 110 // True if context is bound to instance. |
110 bool bound_to_instance_; | 111 bool bound_to_instance_; |
111 // True when waiting for compositor to commit our backing texture. | 112 // True when waiting for compositor to commit our backing texture. |
112 bool commit_pending_; | 113 bool commit_pending_; |
113 | 114 |
114 #if DCHECK_IS_ON() | 115 #if DCHECK_IS_ON() |
115 bool lost_context_ = false; | 116 bool lost_context_ = false; |
116 #endif | 117 #endif |
117 | 118 |
| 119 // The width and height of the command buffer back buffer are first sized from |
| 120 // this process, but then resized by the pepper process. Cache the original |
| 121 // size. |
| 122 int32_t original_width_ = 0; |
| 123 int32_t original_height_ = 0; |
| 124 |
118 bool has_alpha_; | 125 bool has_alpha_; |
119 bool use_image_chromium_; | 126 bool use_image_chromium_; |
120 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; | 127 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; |
121 | 128 |
122 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; | 129 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; |
123 | 130 |
124 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); | 131 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); |
125 }; | 132 }; |
126 | 133 |
127 } // namespace content | 134 } // namespace content |
128 | 135 |
129 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 136 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
OLD | NEW |