| OLD | NEW |
| 1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2011 The Native Client 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 #include "native_client/src/include/nacl_scoped_ptr.h" | 5 #include "native_client/src/include/nacl_scoped_ptr.h" |
| 6 #include "native_client/src/include/portability.h" | 6 #include "native_client/src/include/portability.h" |
| 7 #include "native_client/src/shared/ppapi_proxy/browser_callback.h" | 7 #include "native_client/src/shared/ppapi_proxy/browser_callback.h" |
| 8 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" | 8 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" |
| 9 #include "native_client/src/shared/ppapi_proxy/plugin_resource.h" | 9 #include "native_client/src/shared/ppapi_proxy/plugin_resource.h" |
| 10 #include "native_client/src/shared/ppapi_proxy/utility.h" | 10 #include "native_client/src/shared/ppapi_proxy/utility.h" |
| 11 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | 11 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
| 12 #include "native_client/src/third_party/ppapi/c/dev/ppb_context_3d_dev.h" | 12 #include "native_client/src/third_party/ppapi/c/dev/ppb_context_3d_dev.h" |
| 13 #include "native_client/src/third_party/ppapi/c/dev/ppb_context_3d_trusted_dev.h
" | 13 #include "native_client/src/third_party/ppapi/c/dev/ppb_context_3d_trusted_dev.h
" |
| 14 #include "native_client/src/third_party/ppapi/c/pp_errors.h" | 14 #include "native_client/src/third_party/ppapi/c/pp_errors.h" |
| 15 #include "srpcgen/ppb_rpc.h" | 15 #include "srpcgen/ppb_rpc.h" |
| 16 | 16 |
| 17 using ppapi_proxy::DebugPrintf; | 17 using ppapi_proxy::DebugPrintf; |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 /// Check that the attribute list is well formed. | 21 /// Check that the attribute list is well formed. |
| 22 bool VerifyAttribList(nacl_abi_size_t attrib_list_count, int32_t* attrib_list) { | 22 bool VerifyAttribList(nacl_abi_size_t attrib_list_count, int32_t* attrib_list) { |
| 23 // Attrib list must either be NULL, or must have odd size and the last item | 23 // Attrib list must either be NULL, or must have odd size and the last item |
| 24 // must be the terminator. | 24 // must be the terminator. |
| 25 DebugPrintf("VerifyAttribList: count = %d, ptr_null = %d\n", | 25 DebugPrintf("VerifyAttribList: count = %d, ptr_null = %d\n", |
| 26 (int) attrib_list_count, attrib_list == NULL ? 1 : 0); | 26 (int) attrib_list_count, attrib_list == NULL ? 1 : 0); |
| 27 | 27 |
| 28 return (!attrib_list_count /* && !attrib_list*/) || | 28 return (!attrib_list_count /* && !attrib_list*/) || |
| 29 ((attrib_list_count & 1) | 29 ((attrib_list_count & 1) |
| 30 && (attrib_list[attrib_list_count - 1] == PP_GRAPHICS3DATTRIBVALUE_NONE)); | 30 && (attrib_list[attrib_list_count - 1] == PP_GRAPHICS3DATTRIB_NONE)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 } // namespace | 33 } // namespace |
| 34 | 34 |
| 35 //@{ | 35 //@{ |
| 36 /// The following methods are the SRPC dispatchers for ppapi/c/ppb_context_3d.h. | 36 /// The following methods are the SRPC dispatchers for ppapi/c/ppb_context_3d.h. |
| 37 void PpbGraphics3DRpcServer::PPB_Context3D_BindSurfaces( | 37 void PpbGraphics3DRpcServer::PPB_Context3D_BindSurfaces( |
| 38 NaClSrpcRpc* rpc, | 38 NaClSrpcRpc* rpc, |
| 39 NaClSrpcClosure* done, | 39 NaClSrpcClosure* done, |
| 40 PP_Resource context, | 40 PP_Resource context, |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 &native_size); | 248 &native_size); |
| 249 desc_wrapper.reset(factory.ImportShmHandle((NaClHandle)native_handle, | 249 desc_wrapper.reset(factory.ImportShmHandle((NaClHandle)native_handle, |
| 250 native_size)); | 250 native_size)); |
| 251 *shm_desc = desc_wrapper->desc(); | 251 *shm_desc = desc_wrapper->desc(); |
| 252 *shm_size = native_size; | 252 *shm_size = native_size; |
| 253 rpc->result = NACL_SRPC_RESULT_OK; | 253 rpc->result = NACL_SRPC_RESULT_OK; |
| 254 | 254 |
| 255 } | 255 } |
| 256 | 256 |
| 257 //@} | 257 //@} |
| OLD | NEW |