OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Native Client Authors. All rights reserved. | 2 * Copyright 2010 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #include "native_client/src/shared/ppapi_proxy/plugin_graphics_2d.h" | 7 #include "native_client/src/shared/ppapi_proxy/plugin_graphics_2d.h" |
8 | 8 |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 is_always_opaque_as_int, | 47 is_always_opaque_as_int, |
48 &resource); | 48 &resource); |
49 if (retval == NACL_SRPC_RESULT_OK) { | 49 if (retval == NACL_SRPC_RESULT_OK) { |
50 return static_cast<PP_Resource>(resource); | 50 return static_cast<PP_Resource>(resource); |
51 } else { | 51 } else { |
52 return kInvalidResourceId; | 52 return kInvalidResourceId; |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 PP_Bool IsGraphics2D(PP_Resource resource) { | 56 PP_Bool IsGraphics2D(PP_Resource resource) { |
57 int32_t result; | 57 return PluginResource::GetAs<PluginGraphics2D>(resource).get() |
58 NaClSrpcError retval = | 58 ? PP_TRUE : PP_FALSE; |
59 PpbGraphics2DRpcClient::PPB_Graphics2D_IsGraphics2D( | |
60 GetMainSrpcChannel(), | |
61 static_cast<int64_t>(resource), | |
62 &result); | |
63 if (retval == NACL_SRPC_RESULT_OK) { | |
64 return result ? PP_TRUE : PP_FALSE; | |
65 } else { | |
66 return PP_FALSE; | |
67 } | |
68 } | 59 } |
69 | 60 |
70 PP_Bool Describe(PP_Resource graphics_2d, | 61 PP_Bool Describe(PP_Resource graphics_2d, |
71 struct PP_Size* size, | 62 struct PP_Size* size, |
72 PP_Bool* is_always_opaque) { | 63 PP_Bool* is_always_opaque) { |
73 int32_t is_always_opaque_as_int; | 64 int32_t is_always_opaque_as_int; |
74 nacl_abi_size_t size_ret = kPpSizeBytes; | 65 nacl_abi_size_t size_ret = kPpSizeBytes; |
75 int32_t result; | 66 int32_t result; |
76 NaClSrpcError retval = | 67 NaClSrpcError retval = |
77 PpbGraphics2DRpcClient::PPB_Graphics2D_Describe( | 68 PpbGraphics2DRpcClient::PPB_Graphics2D_Describe( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 Describe, | 136 Describe, |
146 PaintImageData, | 137 PaintImageData, |
147 Scroll, | 138 Scroll, |
148 ReplaceContents, | 139 ReplaceContents, |
149 Flush, | 140 Flush, |
150 }; | 141 }; |
151 return &intf; | 142 return &intf; |
152 } | 143 } |
153 | 144 |
154 } // namespace ppapi_proxy | 145 } // namespace ppapi_proxy |
OLD | NEW |