summaryrefslogtreecommitdiffstats
path: root/webkit/tools/pepper_test_plugin/main.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 16:20:16 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 16:20:16 +0000
commitadd8582104c3bb4849c9855553a194f4c506a720 (patch)
tree8a4ab583b88d49c2573f6d48efbd626d681d52b9 /webkit/tools/pepper_test_plugin/main.cc
parent558833a430fd4b8cb2ab88d1bc4bdc580cbc11aa (diff)
downloadchromium_src-add8582104c3bb4849c9855553a194f4c506a720.zip
chromium_src-add8582104c3bb4849c9855553a194f4c506a720.tar.gz
chromium_src-add8582104c3bb4849c9855553a194f4c506a720.tar.bz2
Make the test plugin draw an antialiased green circle with a gradient so we
can see it's working. TEST=none BUG=none Review URL: http://codereview.chromium.org/293053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29898 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/pepper_test_plugin/main.cc')
-rw-r--r--webkit/tools/pepper_test_plugin/main.cc31
1 files changed, 3 insertions, 28 deletions
diff --git a/webkit/tools/pepper_test_plugin/main.cc b/webkit/tools/pepper_test_plugin/main.cc
index 3b3819f..2bb514d 100644
--- a/webkit/tools/pepper_test_plugin/main.cc
+++ b/webkit/tools/pepper_test_plugin/main.cc
@@ -93,12 +93,6 @@ void Log(NPP instance, const char* format, ...) {
browser->releaseobject(window_object);
}
-NPInitializeRenderContextPtr initialize_render_context = NULL;
-NPFlushRenderContextPtr flush_render_context = NULL;
-
-void FlushCallback(NPRenderContext* context, void* user_data) {
-}
-
} // namespace
// Plugin entry points
@@ -171,34 +165,12 @@ NPError NPP_New(NPMIMEType pluginType,
uint16 mode,
int16 argc, char* argn[], char* argv[],
NPSavedData* saved) {
- if (!initialize_render_context) {
- browser->getvalue(instance, NPNVInitializeRenderContextFunc,
- reinterpret_cast<void*>(&initialize_render_context));
- CHECK(initialize_render_context);
- }
- if (!flush_render_context) {
- browser->getvalue(instance, NPNVFlushRenderContextFunc,
- reinterpret_cast<void*>(&flush_render_context));
- CHECK(flush_render_context);
- }
-
if (browser->version >= 14) {
PluginObject* obj = reinterpret_cast<PluginObject*>(
browser->createobject(instance, PluginObject::GetPluginClass()));
instance->pdata = obj;
}
- // On Windows and Unix, plugins only get events if they are windowless.
- browser->setvalue(instance, NPPVpluginWindowBool, NULL);
-
- /* TODO(brettw) fill this out. It needs to be moved somewhere else until after the plugin has been initialized.
- NPRenderContext context;
- initialize_render_context(instance, NPRenderGraphicsRGBA, &context);
- memset(context.u.graphicsRgba.region, 0x80, 1000);
-
- NPFlushRenderContextCallbackPtr asdf = (NPFlushRenderContextCallbackPtr)&FlushCallback;
- flush_render_context(instance, &context, asdf, NULL);
- */
return NPERR_NO_ERROR;
}
@@ -212,6 +184,9 @@ NPError NPP_Destroy(NPP instance, NPSavedData** save) {
}
NPError NPP_SetWindow(NPP instance, NPWindow* window) {
+ PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
+ if (obj)
+ obj->SetWindow(*window);
return NPERR_NO_ERROR;
}