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 PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ | 5 #ifndef PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ |
6 #define PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ | 6 #define PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
10 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
11 #include "ppapi/shared_impl/ppapi_shared_export.h" | 13 #include "ppapi/shared_impl/ppapi_shared_export.h" |
12 #include "ppapi/shared_impl/resource.h" | 14 #include "ppapi/shared_impl/resource.h" |
13 #include "ppapi/shared_impl/tracked_callback.h" | 15 #include "ppapi/shared_impl/tracked_callback.h" |
14 #include "ppapi/thunk/ppb_graphics_3d_api.h" | 16 #include "ppapi/thunk/ppb_graphics_3d_api.h" |
15 | 17 |
16 namespace gpu { | 18 namespace gpu { |
17 class CommandBuffer; | 19 class CommandBuffer; |
18 class GpuControl; | 20 class GpuControl; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Sends swap-buffers notification to the plugin. | 58 // Sends swap-buffers notification to the plugin. |
57 void SwapBuffersACK(int32_t pp_error); | 59 void SwapBuffersACK(int32_t pp_error); |
58 | 60 |
59 protected: | 61 protected: |
60 PPB_Graphics3D_Shared(PP_Instance instance); | 62 PPB_Graphics3D_Shared(PP_Instance instance); |
61 PPB_Graphics3D_Shared(const HostResource& host_resource); | 63 PPB_Graphics3D_Shared(const HostResource& host_resource); |
62 ~PPB_Graphics3D_Shared() override; | 64 ~PPB_Graphics3D_Shared() override; |
63 | 65 |
64 virtual gpu::CommandBuffer* GetCommandBuffer() = 0; | 66 virtual gpu::CommandBuffer* GetCommandBuffer() = 0; |
65 virtual gpu::GpuControl* GetGpuControl() = 0; | 67 virtual gpu::GpuControl* GetGpuControl() = 0; |
66 virtual int32 DoSwapBuffers() = 0; | 68 virtual int32_t DoSwapBuffers() = 0; |
67 | 69 |
68 bool HasPendingSwap() const; | 70 bool HasPendingSwap() const; |
69 bool CreateGLES2Impl(int32 command_buffer_size, | 71 bool CreateGLES2Impl(int32_t command_buffer_size, |
70 int32 transfer_buffer_size, | 72 int32_t transfer_buffer_size, |
71 gpu::gles2::GLES2Implementation* share_gles2); | 73 gpu::gles2::GLES2Implementation* share_gles2); |
72 void DestroyGLES2Impl(); | 74 void DestroyGLES2Impl(); |
73 | 75 |
74 private: | 76 private: |
75 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 77 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
76 scoped_ptr<gpu::TransferBuffer> transfer_buffer_; | 78 scoped_ptr<gpu::TransferBuffer> transfer_buffer_; |
77 scoped_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; | 79 scoped_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; |
78 | 80 |
79 // Callback that needs to be executed when swap-buffers is completed. | 81 // Callback that needs to be executed when swap-buffers is completed. |
80 scoped_refptr<TrackedCallback> swap_callback_; | 82 scoped_refptr<TrackedCallback> swap_callback_; |
81 | 83 |
82 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Shared); | 84 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Shared); |
83 }; | 85 }; |
84 | 86 |
85 } // namespace ppapi | 87 } // namespace ppapi |
86 | 88 |
87 #endif // PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ | 89 #endif // PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ |
OLD | NEW |