From 7477ea6f6a173b586622fd276433a346760ffbf4 Mon Sep 17 00:00:00 2001 From: "apatrick@google.com" Date: Tue, 22 Dec 2009 23:28:15 +0000 Subject: Added Pepper 3D device that instantiates the GPU plugin and sends GLES2 commands to it via a command buffer. Added API for managing buffers to Pepper 3D device. Removed DCHECK from WebPluginImpl::SetWindow that checks against a windowless plugin being given a window handle. Please check this! Now an initially windowless plugin instance gets a handle when it requests a Pepper 3D context. Perhaps the window handle should be concealed from the underlying plugin isntance. Removed enable_gpu gyp variable and C macro. GPU code is always built on windows but not mac or linux. It is enabled at runtime with the --enable-gpu-plugin switch. Redesigned CommandBuffer interface so it exposes shared memory through a Buffer. This was necessary because Pepper has no notion of shared memory handles. The Buffer exposes the shared memory as both a handle (through base::SharedMemory) and the mapped address and size. Refactored CommandBufferEngine so mapped shared memory addresses and sizes are returned with a single call rather than two separate calls. Added 3D demo to pepper test plugin. TEST=try servers BUG=none Review URL: http://codereview.chromium.org/367002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35185 0039d316-1c4b-4281-b951-d872f2087c98 --- gpu/gpu_plugin/gpu_plugin.cc | 6 +++--- gpu/gpu_plugin/gpu_plugin.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'gpu/gpu_plugin') diff --git a/gpu/gpu_plugin/gpu_plugin.cc b/gpu/gpu_plugin/gpu_plugin.cc index e43caf1..10df734 100644 --- a/gpu/gpu_plugin/gpu_plugin.cc +++ b/gpu/gpu_plugin/gpu_plugin.cc @@ -47,7 +47,7 @@ NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value) { } } -NPError NP_GetEntryPoints(NPPluginFuncs* funcs) { +NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* funcs) { funcs->newp = NPP_New; funcs->destroy = NPP_Destroy; funcs->setwindow = NPP_SetWindow; @@ -61,7 +61,7 @@ NPError NP_GetEntryPoints(NPPluginFuncs* funcs) { NPError API_CALL NP_Initialize(NPNetscapeFuncs *browser_funcs, NPPluginFuncs* plugin_funcs) { #else -NPError NP_Initialize(NPNetscapeFuncs *browser_funcs) { +NPError API_CALL NP_Initialize(NPNetscapeFuncs *browser_funcs) { #endif if (!browser_funcs) return NPERR_INVALID_FUNCTABLE_ERROR; @@ -73,7 +73,7 @@ NPError NP_Initialize(NPNetscapeFuncs *browser_funcs) { return NPERR_NO_ERROR; } -NPError NP_Shutdown() { +NPError API_CALL NP_Shutdown() { return NPERR_NO_ERROR; } } // namespace gpu_plugin diff --git a/gpu/gpu_plugin/gpu_plugin.h b/gpu/gpu_plugin/gpu_plugin.h index a667872..b6bfc89 100644 --- a/gpu/gpu_plugin/gpu_plugin.h +++ b/gpu/gpu_plugin/gpu_plugin.h @@ -15,16 +15,16 @@ namespace gpu_plugin { // Declarations of NPAPI plugin entry points. -NPError NP_GetEntryPoints(NPPluginFuncs* funcs); +NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* funcs); #if defined(OS_LINUX) -NPError NP_Initialize(NPNetscapeFuncs *browser_funcs, +NPError API_CALL NP_Initialize(NPNetscapeFuncs *browser_funcs, NPPluginFuncs* plugin_funcs); #else -NPError NP_Initialize(NPNetscapeFuncs* browser_funcs); +NPError API_CALL NP_Initialize(NPNetscapeFuncs* browser_funcs); #endif -NPError NP_Shutdown(); +NPError API_CALL NP_Shutdown(); } // namespace gpu_plugin -- cgit v1.1