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 "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" | 9 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" |
10 #include "ppapi/shared_impl/resource.h" | 10 #include "ppapi/shared_impl/resource.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 class PlatformContext3D; | 13 class PlatformContext3D; |
14 | 14 |
15 class PPB_Graphics3D_Impl : public ppapi::PPB_Graphics3D_Shared { | 15 class PPB_Graphics3D_Impl : public ppapi::PPB_Graphics3D_Shared { |
16 public: | 16 public: |
17 static PP_Resource Create(PP_Instance instance, | 17 static PP_Resource Create(PP_Instance instance, |
18 PP_Resource share_context, | 18 PP_Resource share_context, |
19 const int32_t* attrib_list); | 19 const int32_t* attrib_list); |
20 static PP_Resource CreateRaw(PP_Instance instance, | 20 static PP_Resource CreateRaw(PP_Instance instance, |
21 PP_Resource share_context, | 21 PP_Resource share_context, |
22 const int32_t* attrib_list); | 22 const int32_t* attrib_list); |
23 | 23 |
24 // PPB_Graphics3D_API trusted implementation. | 24 // PPB_Graphics3D_API trusted implementation. |
25 virtual PP_Bool SetGetBuffer(int32_t transfer_buffer_id) OVERRIDE; | 25 virtual PP_Bool SetGetBuffer(int32_t transfer_buffer_id) OVERRIDE; |
26 virtual gpu::CommandBuffer::State GetState() OVERRIDE; | 26 virtual gpu::CommandBuffer::State GetState() OVERRIDE; |
27 virtual int32_t CreateTransferBuffer(uint32_t size) OVERRIDE; | 27 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size, |
| 28 int32* id) OVERRIDE; |
28 virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE; | 29 virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE; |
29 virtual PP_Bool GetTransferBuffer(int32_t id, | |
30 int* shm_handle, | |
31 uint32_t* shm_size) OVERRIDE; | |
32 virtual PP_Bool Flush(int32_t put_offset) OVERRIDE; | 30 virtual PP_Bool Flush(int32_t put_offset) OVERRIDE; |
33 virtual gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, | 31 virtual gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, |
34 int32_t end) OVERRIDE; | 32 int32_t end) OVERRIDE; |
35 virtual gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start, | 33 virtual gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start, |
36 int32_t end) | 34 int32_t end) |
37 OVERRIDE; | 35 OVERRIDE; |
38 virtual uint32_t InsertSyncPoint() OVERRIDE; | 36 virtual uint32_t InsertSyncPoint() OVERRIDE; |
39 | 37 |
40 // Binds/unbinds the graphics of this context with the associated instance. | 38 // Binds/unbinds the graphics of this context with the associated instance. |
41 // Returns true if binding/unbinding is successful. | 39 // Returns true if binding/unbinding is successful. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // The 3D Context. Responsible for providing the command buffer. | 78 // The 3D Context. Responsible for providing the command buffer. |
81 scoped_ptr<PlatformContext3D> platform_context_; | 79 scoped_ptr<PlatformContext3D> platform_context_; |
82 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; | 80 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; |
83 | 81 |
84 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); | 82 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); |
85 }; | 83 }; |
86 | 84 |
87 } // namespace content | 85 } // namespace content |
88 | 86 |
89 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 87 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
OLD | NEW |