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 #include "ppapi/proxy/ppb_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/pp_time.h" | 10 #include "ppapi/c/pp_time.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "ppapi/proxy/plugin_dispatcher.h" | 32 #include "ppapi/proxy/plugin_dispatcher.h" |
33 #include "ppapi/proxy/ppapi_messages.h" | 33 #include "ppapi/proxy/ppapi_messages.h" |
34 #include "ppapi/proxy/serialized_var.h" | 34 #include "ppapi/proxy/serialized_var.h" |
35 #include "ppapi/proxy/truetype_font_singleton_resource.h" | 35 #include "ppapi/proxy/truetype_font_singleton_resource.h" |
36 #include "ppapi/proxy/uma_private_resource.h" | 36 #include "ppapi/proxy/uma_private_resource.h" |
37 #include "ppapi/shared_impl/ppapi_globals.h" | 37 #include "ppapi/shared_impl/ppapi_globals.h" |
38 #include "ppapi/shared_impl/ppb_url_util_shared.h" | 38 #include "ppapi/shared_impl/ppb_url_util_shared.h" |
39 #include "ppapi/shared_impl/ppb_view_shared.h" | 39 #include "ppapi/shared_impl/ppb_view_shared.h" |
40 #include "ppapi/shared_impl/var.h" | 40 #include "ppapi/shared_impl/var.h" |
41 #include "ppapi/thunk/enter.h" | 41 #include "ppapi/thunk/enter.h" |
| 42 #include "ppapi/thunk/ppb_compositor_api.h" |
42 #include "ppapi/thunk/ppb_graphics_2d_api.h" | 43 #include "ppapi/thunk/ppb_graphics_2d_api.h" |
43 #include "ppapi/thunk/ppb_graphics_3d_api.h" | 44 #include "ppapi/thunk/ppb_graphics_3d_api.h" |
44 #include "ppapi/thunk/thunk.h" | 45 #include "ppapi/thunk/thunk.h" |
45 | 46 |
46 // Windows headers interfere with this file. | 47 // Windows headers interfere with this file. |
47 #ifdef PostMessage | 48 #ifdef PostMessage |
48 #undef PostMessage | 49 #undef PostMessage |
49 #endif | 50 #endif |
50 | 51 |
51 using ppapi::thunk::EnterInstanceNoLock; | 52 using ppapi::thunk::EnterInstanceNoLock; |
52 using ppapi::thunk::EnterResourceNoLock; | 53 using ppapi::thunk::EnterResourceNoLock; |
| 54 using ppapi::thunk::PPB_Compositor_API; |
53 using ppapi::thunk::PPB_Graphics2D_API; | 55 using ppapi::thunk::PPB_Graphics2D_API; |
54 using ppapi::thunk::PPB_Graphics3D_API; | 56 using ppapi::thunk::PPB_Graphics3D_API; |
55 using ppapi::thunk::PPB_Instance_API; | 57 using ppapi::thunk::PPB_Instance_API; |
56 | 58 |
57 namespace ppapi { | 59 namespace ppapi { |
58 namespace proxy { | 60 namespace proxy { |
59 | 61 |
60 namespace { | 62 namespace { |
61 | 63 |
62 #if !defined(OS_NACL) | 64 #if !defined(OS_NACL) |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 pp_resource = resource->pp_resource(); | 227 pp_resource = resource->pp_resource(); |
226 } else { | 228 } else { |
227 // Passing 0 means unbinding all devices. | 229 // Passing 0 means unbinding all devices. |
228 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( | 230 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( |
229 API_ID_PPB_INSTANCE, instance, 0)); | 231 API_ID_PPB_INSTANCE, instance, 0)); |
230 return PP_TRUE; | 232 return PP_TRUE; |
231 } | 233 } |
232 | 234 |
233 // We need to pass different resource to Graphics 2D and 3D right now. Once | 235 // We need to pass different resource to Graphics 2D and 3D right now. Once |
234 // 3D is migrated to the new design, we should be able to unify this. | 236 // 3D is migrated to the new design, we should be able to unify this. |
| 237 EnterResourceNoLock<PPB_Compositor_API> enter_compositor(device, false); |
235 EnterResourceNoLock<PPB_Graphics2D_API> enter_2d(device, false); | 238 EnterResourceNoLock<PPB_Graphics2D_API> enter_2d(device, false); |
236 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); | 239 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); |
237 if (enter_2d.succeeded()) { | 240 if (enter_compositor.succeeded() || enter_2d.succeeded()) { |
238 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( | 241 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( |
239 API_ID_PPB_INSTANCE, instance, pp_resource)); | 242 API_ID_PPB_INSTANCE, instance, pp_resource)); |
240 return PP_TRUE; | 243 return PP_TRUE; |
241 } else if (enter_3d.succeeded()) { | 244 } else if (enter_3d.succeeded()) { |
242 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( | 245 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( |
243 API_ID_PPB_INSTANCE, instance, host_resource.host_resource())); | 246 API_ID_PPB_INSTANCE, instance, host_resource.host_resource())); |
244 return PP_TRUE; | 247 return PP_TRUE; |
245 } | 248 } |
246 return PP_FALSE; | 249 return PP_FALSE; |
247 } | 250 } |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 PP_Instance instance) { | 1434 PP_Instance instance) { |
1432 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1435 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1433 GetInstanceData(instance); | 1436 GetInstanceData(instance); |
1434 if (!data) | 1437 if (!data) |
1435 return; // Instance was probably deleted. | 1438 return; // Instance was probably deleted. |
1436 data->should_do_request_surrounding_text = false; | 1439 data->should_do_request_surrounding_text = false; |
1437 } | 1440 } |
1438 | 1441 |
1439 } // namespace proxy | 1442 } // namespace proxy |
1440 } // namespace ppapi | 1443 } // namespace ppapi |
OLD | NEW |