| 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 int32_t width, | 78 const gfx::Size& size) override; |
| 79 int32_t height) override; | |
| 80 | 79 |
| 81 private: | 80 private: |
| 82 explicit PPB_Graphics3D_Impl(PP_Instance instance); | 81 explicit PPB_Graphics3D_Impl(PP_Instance instance); |
| 83 | 82 |
| 84 bool InitRaw(PPB_Graphics3D_API* share_context, | 83 bool InitRaw(PPB_Graphics3D_API* share_context, |
| 85 const gpu::gles2::ContextCreationAttribHelper& requested_attribs, | 84 const gpu::gles2::ContextCreationAttribHelper& requested_attribs, |
| 86 gpu::Capabilities* capabilities, | 85 gpu::Capabilities* capabilities, |
| 87 base::SharedMemoryHandle* shared_state_handle, | 86 base::SharedMemoryHandle* shared_state_handle, |
| 88 gpu::CommandBufferId* command_buffer_id); | 87 gpu::CommandBufferId* command_buffer_id); |
| 89 | 88 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 109 | 108 |
| 110 // True if context is bound to instance. | 109 // True if context is bound to instance. |
| 111 bool bound_to_instance_; | 110 bool bound_to_instance_; |
| 112 // True when waiting for compositor to commit our backing texture. | 111 // True when waiting for compositor to commit our backing texture. |
| 113 bool commit_pending_; | 112 bool commit_pending_; |
| 114 | 113 |
| 115 #if DCHECK_IS_ON() | 114 #if DCHECK_IS_ON() |
| 116 bool lost_context_ = false; | 115 bool lost_context_ = false; |
| 117 #endif | 116 #endif |
| 118 | 117 |
| 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 | |
| 125 bool has_alpha_; | 118 bool has_alpha_; |
| 126 bool use_image_chromium_; | 119 bool use_image_chromium_; |
| 127 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; | 120 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; |
| 128 | 121 |
| 129 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; | 122 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; |
| 130 | 123 |
| 131 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); | 124 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); |
| 132 }; | 125 }; |
| 133 | 126 |
| 134 } // namespace content | 127 } // namespace content |
| 135 | 128 |
| 136 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 129 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
| OLD | NEW |