OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PPB_SURFACE_3D_PROXY_H_ | 5 #ifndef PPAPI_PPB_SURFACE_3D_PROXY_H_ |
6 #define PPAPI_PPB_SURFACE_3D_PROXY_H_ | 6 #define PPAPI_PPB_SURFACE_3D_PROXY_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ppapi/c/dev/pp_graphics_3d_dev.h" | 10 #include "ppapi/c/dev/pp_graphics_3d_dev.h" |
11 #include "ppapi/c/pp_completion_callback.h" | 11 #include "ppapi/c/pp_completion_callback.h" |
12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
13 #include "ppapi/cpp/completion_callback.h" | 13 #include "ppapi/cpp/completion_callback.h" |
14 #include "ppapi/proxy/interface_proxy.h" | 14 #include "ppapi/proxy/interface_proxy.h" |
15 #include "ppapi/proxy/plugin_resource.h" | 15 #include "ppapi/proxy/plugin_resource.h" |
16 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" | 16 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" |
17 #include "ppapi/thunk/ppb_surface_3d_api.h" | 17 #include "ppapi/thunk/ppb_surface_3d_api.h" |
18 | 18 |
19 struct PPB_Surface3D_Dev; | 19 struct PPB_Surface3D_Dev; |
20 | 20 |
21 namespace pp { | 21 namespace pp { |
22 namespace proxy { | 22 namespace proxy { |
23 | 23 |
24 class Context3D; | 24 class Context3D; |
25 | 25 |
26 class Surface3D : public PluginResource, | 26 class Surface3D : public PluginResource, |
27 public ppapi::thunk::PPB_Surface3D_API { | 27 public ppapi::thunk::PPB_Surface3D_API { |
28 public: | 28 public: |
29 explicit Surface3D(const HostResource& host_resource); | 29 explicit Surface3D(const ppapi::HostResource& host_resource); |
30 virtual ~Surface3D(); | 30 virtual ~Surface3D(); |
31 | 31 |
32 // ResourceObjectBase overrides. | 32 // ResourceObjectBase overrides. |
33 virtual PPB_Surface3D_API* AsPPB_Surface3D_API() OVERRIDE; | 33 virtual PPB_Surface3D_API* AsPPB_Surface3D_API() OVERRIDE; |
34 | 34 |
35 // PPB_Surface3D_API implementation. | 35 // PPB_Surface3D_API implementation. |
36 virtual int32_t SetAttrib(int32_t attribute, int32_t value) OVERRIDE; | 36 virtual int32_t SetAttrib(int32_t attribute, int32_t value) OVERRIDE; |
37 virtual int32_t GetAttrib(int32_t attribute, int32_t* value) OVERRIDE; | 37 virtual int32_t GetAttrib(int32_t attribute, int32_t* value) OVERRIDE; |
38 virtual int32_t SwapBuffers(PP_CompletionCallback callback) OVERRIDE; | 38 virtual int32_t SwapBuffers(PP_CompletionCallback callback) OVERRIDE; |
39 | 39 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 const int32_t* attrib_list); | 77 const int32_t* attrib_list); |
78 | 78 |
79 // InterfaceProxy implementation. | 79 // InterfaceProxy implementation. |
80 virtual bool OnMessageReceived(const IPC::Message& msg); | 80 virtual bool OnMessageReceived(const IPC::Message& msg); |
81 | 81 |
82 private: | 82 private: |
83 // Message handlers. | 83 // Message handlers. |
84 void OnMsgCreate(PP_Instance instance, | 84 void OnMsgCreate(PP_Instance instance, |
85 PP_Config3D_Dev config, | 85 PP_Config3D_Dev config, |
86 const std::vector<int32_t>& attribs, | 86 const std::vector<int32_t>& attribs, |
87 HostResource* result); | 87 ppapi::HostResource* result); |
88 void OnMsgSwapBuffers(const HostResource& surface); | 88 void OnMsgSwapBuffers(const ppapi::HostResource& surface); |
89 // Renderer->plugin message handlers. | 89 // Renderer->plugin message handlers. |
90 void OnMsgSwapBuffersACK(const HostResource& surface, int32_t pp_error); | 90 void OnMsgSwapBuffersACK(const ppapi::HostResource& surface, |
| 91 int32_t pp_error); |
91 | 92 |
92 void SendSwapBuffersACKToPlugin(int32_t result, | 93 void SendSwapBuffersACKToPlugin(int32_t result, |
93 const HostResource& surface_3d); | 94 const ppapi::HostResource& surface_3d); |
94 | 95 |
95 CompletionCallbackFactory<PPB_Surface3D_Proxy, | 96 CompletionCallbackFactory<PPB_Surface3D_Proxy, |
96 ProxyNonThreadSafeRefCount> callback_factory_; | 97 ProxyNonThreadSafeRefCount> callback_factory_; |
97 }; | 98 }; |
98 | 99 |
99 } // namespace proxy | 100 } // namespace proxy |
100 } // namespace pp | 101 } // namespace pp |
101 | 102 |
102 #endif // PPAPI_PPB_SURFACE_3D_PROXY_H_ | 103 #endif // PPAPI_PPB_SURFACE_3D_PROXY_H_ |
OLD | NEW |