summaryrefslogtreecommitdiffstats
path: root/webkit/tools
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-03 02:28:48 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-03 02:28:48 +0000
commit43f28f83bc268dea720843a2616058b64b3e8810 (patch)
tree3c3c4fc9c43dad15246fae82cb5b965e6b217281 /webkit/tools
parent2d48004e1f2c8cecd015144c179f993d883aba9c (diff)
downloadchromium_src-43f28f83bc268dea720843a2616058b64b3e8810.zip
chromium_src-43f28f83bc268dea720843a2616058b64b3e8810.tar.gz
chromium_src-43f28f83bc268dea720843a2616058b64b3e8810.tar.bz2
[GPU] Get GPU process running on the mac
Initial port of GPU process / plugin to Mac OS X. Uses new IOSurface APIs and therefore currently runs only on 10.6. Alternate strategy will need to be devised for 10.5. Slight UI issues remain such as GPU plugins initially showing up in the wrong place on the page. These will be fixed in follow-on bugs. Minimal changes made to command buffer code to get it to compile on Mac OS X. Commented out use of nested anonymous namespaces in gles2_cmd_decoder.cc which were causing the linker to crash with a seg fault. Refactored gyp files so the OS test enabling the GPU plugin is in one place, common.gypi, and other files test only the variable enable_gpu. Slight change to gles2_demo_cc.cc to add some simple animation to verify that updates from the GPU plugin are reaching the screen. Changed Pepper test plugin to use 3D view by default and commented out use of audio context because of recent issues. TEST=none (ran Pepper Test Plugin with 3D view enabled) BUG=http://crbug.com/25988 Review URL: http://codereview.chromium.org/558035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37934 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r--webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp12
-rw-r--r--webkit/tools/pepper_test_plugin/plugin_object.cc12
-rw-r--r--webkit/tools/pepper_test_plugin/test_page.html4
-rw-r--r--webkit/tools/test_shell/mac/test_webview_delegate.mm8
4 files changed, 21 insertions, 15 deletions
diff --git a/webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp b/webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp
index f36abf7..0f799f5 100644
--- a/webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp
+++ b/webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp
@@ -58,25 +58,19 @@
'cflags': ['-fPIC'],
'defines': ['INDEPENDENT_PLUGIN'],
}, {
+ # Dependencies for all other OS/CPU combinations except the Linux ones above
'dependencies': [
'../../../base/base.gyp:base',
'../../../skia/skia.gyp:skia',
+ '../../../gpu/gpu.gyp:gles2_demo_lib',
+ '../../../gpu/gpu.gyp:pgl',
],
- 'conditions': [
- ['OS!="mac"', {
- 'dependencies': [
- '../../../gpu/gpu.gyp:gles2_demo_lib',
- '../../../gpu/gpu.gyp:pgl',
- ],
- }],
- ]
}],
['OS=="mac"', {
'type': 'loadable_module',
'mac_bundle': 1,
'product_name': 'PepperTestPlugin',
'product_extension': 'plugin',
- 'defines': ['INDEPENDENT_PLUGIN'],
'sources+': [
'Info.plist'
],
diff --git a/webkit/tools/pepper_test_plugin/plugin_object.cc b/webkit/tools/pepper_test_plugin/plugin_object.cc
index a2075ec..013702b 100644
--- a/webkit/tools/pepper_test_plugin/plugin_object.cc
+++ b/webkit/tools/pepper_test_plugin/plugin_object.cc
@@ -34,8 +34,9 @@
#define CHECK(x)
#else
#include "base/logging.h"
+#include "build/build_config.h"
#include "gpu/command_buffer/client/gles2_demo_cc.h"
-#include "gpu/command_buffer/common/GLES2/gl2.h"
+#include <GLES2/gl2.h> // NOLINT
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
@@ -308,7 +309,10 @@ PluginObject::PluginObject(NPP npp)
}
PluginObject::~PluginObject() {
+ // TODO(kbr): add audio portion of test
+#if !defined(OS_MACOSX)
deviceaudio_->destroyContext(npp_, &context_audio_);
+#endif
// FIXME(brettw) destroy the context.
browser->releaseobject(test_object_);
}
@@ -347,8 +351,11 @@ void PluginObject::New(NPMIMEType pluginType,
device3d_ = extensions->acquireDevice(npp_, NPPepper3DDevice);
CHECK(device3d_);
+ // TODO(kbr): add audio portion of test
+#if !defined(OS_MACOSX)
deviceaudio_ = extensions->acquireDevice(npp_, NPPepperAudioDevice);
CHECK(deviceaudio_);
+#endif
}
void PluginObject::SetWindow(const NPWindow& window) {
@@ -389,6 +396,8 @@ void PluginObject::SetWindow(const NPWindow& window) {
#endif
}
+ // TODO(kbr): put back in audio portion of test
+#if !defined(OS_MACOSX)
// testing any field would do
if (!context_audio_.config.callback) {
NPDeviceContextAudioConfig cfg;
@@ -401,6 +410,7 @@ void PluginObject::SetWindow(const NPWindow& window) {
cfg.callback = &SineWaveCallback<200, int16>;
deviceaudio_->initializeContext(npp_, &cfg, &context_audio_);
}
+#endif
}
void PluginObject::Draw3D() {
diff --git a/webkit/tools/pepper_test_plugin/test_page.html b/webkit/tools/pepper_test_plugin/test_page.html
index 5a3e609..5c20d6d 100644
--- a/webkit/tools/pepper_test_plugin/test_page.html
+++ b/webkit/tools/pepper_test_plugin/test_page.html
@@ -29,7 +29,7 @@ This page embeds a file declared as the pepper test plugins MIME type so that it
<table>
<tr>
<td valign="top" width="50%">
-<object id="plugin" type="pepper-application/x-pepper-test-plugin" width="400" height="400" dimensions="2" />
+<object id="plugin" type="pepper-application/x-pepper-test-plugin" width="400" height="400" dimensions="3" />
</td>
<td valign="top" style="background-color:Silver" width="50%">
<div id="event_text_box" style="width:400px; height:400px; overflow:auto">
@@ -39,4 +39,4 @@ This page embeds a file declared as the pepper test plugins MIME type so that it
</table>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/webkit/tools/test_shell/mac/test_webview_delegate.mm b/webkit/tools/test_shell/mac/test_webview_delegate.mm
index 483e776..cb2a392 100644
--- a/webkit/tools/test_shell/mac/test_webview_delegate.mm
+++ b/webkit/tools/test_shell/mac/test_webview_delegate.mm
@@ -171,7 +171,7 @@ webkit_glue::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
WebWidgetHost *host = GetWidgetHost();
if (!host)
return NULL;
- gfx::NativeView view = host->view_handle();
+ gfx::PluginWindowHandle containing_view = NULL;
bool allow_wildcard = true;
WebPluginInfo info;
@@ -181,9 +181,11 @@ webkit_glue::WebPluginDelegate* TestWebViewDelegate::CreatePluginDelegate(
}
if (actual_mime_type && !actual_mime_type->empty())
- return WebPluginDelegateImpl::Create(info.path, *actual_mime_type, view);
+ return WebPluginDelegateImpl::Create(info.path, *actual_mime_type,
+ containing_view);
else
- return WebPluginDelegateImpl::Create(info.path, mime_type, view);
+ return WebPluginDelegateImpl::Create(info.path, mime_type,
+ containing_view);
}
void TestWebViewDelegate::CreatedPluginWindow(