summaryrefslogtreecommitdiffstats
path: root/webkit/tools/pepper_test_plugin
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 20:30:45 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 20:30:45 +0000
commit1b1bba77bb2fe952a651c07b11d617709ccd2fcf (patch)
tree2941d33c7ea0f1fc40b10e823771a03f3dcd6287 /webkit/tools/pepper_test_plugin
parent80ec6548d3f012c9b01e5dd5db39cb78c94c904b (diff)
downloadchromium_src-1b1bba77bb2fe952a651c07b11d617709ccd2fcf.zip
chromium_src-1b1bba77bb2fe952a651c07b11d617709ccd2fcf.tar.gz
chromium_src-1b1bba77bb2fe952a651c07b11d617709ccd2fcf.tar.bz2
Windows now uses the TLS API instead of __declspec(thread) for client side command buffer code compiled into DLLs. Other platforms use the pthreads API. This is because the __declspec(thread) approach does not on some platforms, including Windows XP and Mac.
This is used for thread local pointers to the GL and PGL contexts. This unfortunate because the PGL and GL APIs do not generally explicitly reference a context. The current context is set with a call to pglMakeCurrent. An unfortunate consequence is that now in Pepper plugins, every call to a GL function will call TlsGetValue to get the thread's current context, which could have performance issues. I can't use base::ThreadLocalPointer because this code is compiled into an untrusted NaCl module and we don't want Chromium dependencies. TEST=try BUG=none Review URL: http://codereview.chromium.org/553050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37300 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/pepper_test_plugin')
-rw-r--r--webkit/tools/pepper_test_plugin/main.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/webkit/tools/pepper_test_plugin/main.cc b/webkit/tools/pepper_test_plugin/main.cc
index 851674c..81c963d 100644
--- a/webkit/tools/pepper_test_plugin/main.cc
+++ b/webkit/tools/pepper_test_plugin/main.cc
@@ -34,6 +34,8 @@
#include <stdlib.h>
#include <stdio.h>
+#include "gpu/pgl/pgl.h"
+
#if defined(INDEPENDENT_PLUGIN)
#include <iostream>
#define LOG(x) std::cerr
@@ -118,6 +120,9 @@ EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* browser_funcs
EXPORT NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* plugin_funcs);
EXPORT void API_CALL NP_Shutdown() {
+#if !defined(INDEPENDENT_PLUGIN)
+ pglTerminate();
+#endif
}
#if defined(OS_LINUX)
@@ -136,6 +141,9 @@ EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* browser_funcs
#endif
) {
browser = browser_funcs;
+#if !defined(INDEPENDENT_PLUGIN)
+ pglInitialize();
+#endif
#if defined(OS_LINUX)
return NP_GetEntryPoints(plugin_funcs);
#else