| 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 int32_t CreateTransferBuffer(uint32_t size, |
| 28 int* shm_handle, |
| 29 uint32_t* shm_size) OVERRIDE; |
| 28 virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE; | 30 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; | 31 virtual PP_Bool Flush(int32_t put_offset) OVERRIDE; |
| 33 virtual gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, | 32 virtual gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, |
| 34 int32_t end) OVERRIDE; | 33 int32_t end) OVERRIDE; |
| 35 virtual gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start, | 34 virtual gpu::CommandBuffer::State WaitForGetOffsetInRange(int32_t start, |
| 36 int32_t end) | 35 int32_t end) |
| 37 OVERRIDE; | 36 OVERRIDE; |
| 38 virtual uint32_t InsertSyncPoint() OVERRIDE; | 37 virtual uint32_t InsertSyncPoint() OVERRIDE; |
| 39 | 38 |
| 40 // Binds/unbinds the graphics of this context with the associated instance. | 39 // Binds/unbinds the graphics of this context with the associated instance. |
| 41 // Returns true if binding/unbinding is successful. | 40 // 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. | 79 // The 3D Context. Responsible for providing the command buffer. |
| 81 scoped_ptr<PlatformContext3D> platform_context_; | 80 scoped_ptr<PlatformContext3D> platform_context_; |
| 82 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; | 81 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; |
| 83 | 82 |
| 84 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); | 83 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); |
| 85 }; | 84 }; |
| 86 | 85 |
| 87 } // namespace content | 86 } // namespace content |
| 88 | 87 |
| 89 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 88 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
| OLD | NEW |