Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(929)

Side by Side Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 298023004: [PPAPI] Compositor API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor_api_def_new
Patch Set: Update Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 pp_resource = resource->pp_resource(); 221 pp_resource = resource->pp_resource();
220 } else { 222 } else {
221 // Passing 0 means unbinding all devices. 223 // Passing 0 means unbinding all devices.
222 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( 224 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics(
223 API_ID_PPB_INSTANCE, instance, 0)); 225 API_ID_PPB_INSTANCE, instance, 0));
224 return PP_TRUE; 226 return PP_TRUE;
225 } 227 }
226 228
227 // We need to pass different resource to Graphics 2D and 3D right now. Once 229 // We need to pass different resource to Graphics 2D and 3D right now. Once
228 // 3D is migrated to the new design, we should be able to unify this. 230 // 3D is migrated to the new design, we should be able to unify this.
231 EnterResourceNoLock<PPB_Compositor_API> enter_compositor(device, false);
229 EnterResourceNoLock<PPB_Graphics2D_API> enter_2d(device, false); 232 EnterResourceNoLock<PPB_Graphics2D_API> enter_2d(device, false);
230 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); 233 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false);
231 if (enter_2d.succeeded()) { 234 if (enter_compositor.succeeded() || enter_2d.succeeded()) {
232 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( 235 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics(
233 API_ID_PPB_INSTANCE, instance, pp_resource)); 236 API_ID_PPB_INSTANCE, instance, pp_resource));
234 return PP_TRUE; 237 return PP_TRUE;
235 } else if (enter_3d.succeeded()) { 238 } else if (enter_3d.succeeded()) {
236 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics( 239 dispatcher()->Send(new PpapiHostMsg_PPBInstance_BindGraphics(
237 API_ID_PPB_INSTANCE, instance, host_resource.host_resource())); 240 API_ID_PPB_INSTANCE, instance, host_resource.host_resource()));
238 return PP_TRUE; 241 return PP_TRUE;
239 } 242 }
240 return PP_FALSE; 243 return PP_FALSE;
241 } 244 }
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 PP_Instance instance) { 1339 PP_Instance instance) {
1337 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 1340 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
1338 GetInstanceData(instance); 1341 GetInstanceData(instance);
1339 if (!data) 1342 if (!data)
1340 return; // Instance was probably deleted. 1343 return; // Instance was probably deleted.
1341 data->should_do_request_surrounding_text = false; 1344 data->should_do_request_surrounding_text = false;
1342 } 1345 }
1343 1346
1344 } // namespace proxy 1347 } // namespace proxy
1345 } // namespace ppapi 1348 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698