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/pp_completion_callback.h" | 10 #include "ppapi/c/pp_completion_callback.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // In the plugin, this is the current callback set for Flushes. When the | 57 // In the plugin, this is the current callback set for Flushes. When the |
58 // callback function pointer is non-NULL, we're waiting for a flush ACK. | 58 // callback function pointer is non-NULL, we're waiting for a flush ACK. |
59 PP_CompletionCallback current_flush_callback_; | 59 PP_CompletionCallback current_flush_callback_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(Surface3D); | 61 DISALLOW_COPY_AND_ASSIGN(Surface3D); |
62 }; | 62 }; |
63 | 63 |
64 class PPB_Surface3D_Proxy : public InterfaceProxy { | 64 class PPB_Surface3D_Proxy : public InterfaceProxy { |
65 public: | 65 public: |
66 PPB_Surface3D_Proxy(Dispatcher* dispatcher, const void* target_interface); | 66 PPB_Surface3D_Proxy(Dispatcher* dispatcher); |
67 virtual ~PPB_Surface3D_Proxy(); | 67 virtual ~PPB_Surface3D_Proxy(); |
68 | 68 |
69 static const Info* GetInfo(); | 69 static const Info* GetInfo(); |
70 | 70 |
71 static PP_Resource CreateProxyResource(PP_Instance instance, | 71 static PP_Resource CreateProxyResource(PP_Instance instance, |
72 PP_Config3D_Dev config, | 72 PP_Config3D_Dev config, |
73 const int32_t* attrib_list); | 73 const int32_t* attrib_list); |
74 | 74 |
75 // InterfaceProxy implementation. | 75 // InterfaceProxy implementation. |
76 virtual bool OnMessageReceived(const IPC::Message& msg); | 76 virtual bool OnMessageReceived(const IPC::Message& msg); |
77 | 77 |
| 78 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_SURFACE_3D; |
| 79 |
78 private: | 80 private: |
79 // Message handlers. | 81 // Message handlers. |
80 void OnMsgCreate(PP_Instance instance, | 82 void OnMsgCreate(PP_Instance instance, |
81 PP_Config3D_Dev config, | 83 PP_Config3D_Dev config, |
82 const std::vector<int32_t>& attribs, | 84 const std::vector<int32_t>& attribs, |
83 ppapi::HostResource* result); | 85 ppapi::HostResource* result); |
84 void OnMsgSwapBuffers(const ppapi::HostResource& surface); | 86 void OnMsgSwapBuffers(const ppapi::HostResource& surface); |
85 // Renderer->plugin message handlers. | 87 // Renderer->plugin message handlers. |
86 void OnMsgSwapBuffersACK(const ppapi::HostResource& surface, | 88 void OnMsgSwapBuffersACK(const ppapi::HostResource& surface, |
87 int32_t pp_error); | 89 int32_t pp_error); |
88 | 90 |
89 void SendSwapBuffersACKToPlugin(int32_t result, | 91 void SendSwapBuffersACKToPlugin(int32_t result, |
90 const ppapi::HostResource& surface_3d); | 92 const ppapi::HostResource& surface_3d); |
91 | 93 |
92 pp::CompletionCallbackFactory<PPB_Surface3D_Proxy, | 94 pp::CompletionCallbackFactory<PPB_Surface3D_Proxy, |
93 ProxyNonThreadSafeRefCount> callback_factory_; | 95 ProxyNonThreadSafeRefCount> callback_factory_; |
94 }; | 96 }; |
95 | 97 |
96 } // namespace proxy | 98 } // namespace proxy |
97 } // namespace ppapi | 99 } // namespace ppapi |
98 | 100 |
99 #endif // PPAPI_PPB_SURFACE_3D_PROXY_H_ | 101 #endif // PPAPI_PPB_SURFACE_3D_PROXY_H_ |
OLD | NEW |