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_THUNK_PPB_GRAPHICS_3D_API_H_ | 5 #ifndef PPAPI_THUNK_PPB_GRAPHICS_3D_API_H_ |
6 #define PPAPI_THUNK_PPB_GRAPHICS_3D_API_H_ | 6 #define PPAPI_THUNK_PPB_GRAPHICS_3D_API_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "gpu/command_buffer/common/command_buffer.h" | 11 #include "gpu/command_buffer/common/command_buffer.h" |
12 #include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h" | 12 #include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h" |
13 #include "ppapi/c/ppb_graphics_3d.h" | 13 #include "ppapi/c/ppb_graphics_3d.h" |
14 #include "ppapi/thunk/ppapi_thunk_export.h" | 14 #include "ppapi/thunk/ppapi_thunk_export.h" |
15 | 15 |
16 namespace gfx { | |
17 class Size; | |
18 } | |
19 | |
20 namespace gpu { | 16 namespace gpu { |
21 struct SyncToken; | 17 struct SyncToken; |
22 } | 18 } |
23 | 19 |
24 namespace ppapi { | 20 namespace ppapi { |
25 | 21 |
26 class TrackedCallback; | 22 class TrackedCallback; |
27 | 23 |
28 namespace thunk { | 24 namespace thunk { |
29 | 25 |
30 class PPAPI_THUNK_EXPORT PPB_Graphics3D_API { | 26 class PPAPI_THUNK_EXPORT PPB_Graphics3D_API { |
31 public: | 27 public: |
32 virtual ~PPB_Graphics3D_API() {} | 28 virtual ~PPB_Graphics3D_API() {} |
33 | 29 |
34 // Graphics3D API. | 30 // Graphics3D API. |
35 virtual int32_t GetAttribs(int32_t attrib_list[]) = 0; | 31 virtual int32_t GetAttribs(int32_t attrib_list[]) = 0; |
36 virtual int32_t SetAttribs(const int32_t attrib_list[]) = 0; | 32 virtual int32_t SetAttribs(const int32_t attrib_list[]) = 0; |
37 virtual int32_t GetError() = 0; | 33 virtual int32_t GetError() = 0; |
38 virtual int32_t ResizeBuffers(int32_t width, int32_t height) = 0; | 34 virtual int32_t ResizeBuffers(int32_t width, int32_t height) = 0; |
39 virtual int32_t SwapBuffers(scoped_refptr<TrackedCallback> callback) = 0; | 35 virtual int32_t SwapBuffers(scoped_refptr<TrackedCallback> callback) = 0; |
40 virtual int32_t SwapBuffersWithSyncToken( | 36 virtual int32_t SwapBuffersWithSyncToken( |
41 scoped_refptr<TrackedCallback> callback, | 37 scoped_refptr<TrackedCallback> callback, |
42 const gpu::SyncToken& sync_token, | 38 const gpu::SyncToken& sync_token, |
43 const gfx::Size& size) = 0; | 39 int32_t width, |
| 40 int32_t height) = 0; |
44 virtual int32_t GetAttribMaxValue(int32_t attribute, int32_t* value) = 0; | 41 virtual int32_t GetAttribMaxValue(int32_t attribute, int32_t* value) = 0; |
45 | 42 |
46 // Graphics3DTrusted API. | 43 // Graphics3DTrusted API. |
47 virtual PP_Bool SetGetBuffer(int32_t shm_id) = 0; | 44 virtual PP_Bool SetGetBuffer(int32_t shm_id) = 0; |
48 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size, | 45 virtual scoped_refptr<gpu::Buffer> CreateTransferBuffer(uint32_t size, |
49 int32_t* id) = 0; | 46 int32_t* id) = 0; |
50 virtual PP_Bool DestroyTransferBuffer(int32_t id) = 0; | 47 virtual PP_Bool DestroyTransferBuffer(int32_t id) = 0; |
51 virtual PP_Bool Flush(int32_t put_offset) = 0; | 48 virtual PP_Bool Flush(int32_t put_offset) = 0; |
52 virtual gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, | 49 virtual gpu::CommandBuffer::State WaitForTokenInRange(int32_t start, |
53 int32_t end) = 0; | 50 int32_t end) = 0; |
(...skipping 13 matching lines...) Expand all Loading... |
67 virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) = 0; | 64 virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) = 0; |
68 | 65 |
69 virtual void EnsureWorkVisible() = 0; | 66 virtual void EnsureWorkVisible() = 0; |
70 virtual void TakeFrontBuffer() = 0; | 67 virtual void TakeFrontBuffer() = 0; |
71 }; | 68 }; |
72 | 69 |
73 } // namespace thunk | 70 } // namespace thunk |
74 } // namespace ppapi | 71 } // namespace ppapi |
75 | 72 |
76 #endif // PPAPI_THUNK_PPB_GRAPHICS_3D_API_H_ | 73 #endif // PPAPI_THUNK_PPB_GRAPHICS_3D_API_H_ |
OLD | NEW |