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

Unified Diff: gpu/demos/framework/plugin.h

Issue 554053: Added infrastructure to run gpu demos under Pepper3D. Created a Demo class th... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/demos/framework/platform.h ('k') | gpu/demos/framework/plugin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/demos/framework/plugin.h
===================================================================
--- gpu/demos/framework/plugin.h (revision 0)
+++ gpu/demos/framework/plugin.h (revision 0)
@@ -0,0 +1,51 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_DEMOS_FRAMEWORK_PLUGIN_H_
+#define GPU_DEMOS_FRAMEWORK_PLUGIN_H_
+
+#include "base/basictypes.h"
+#include "base/scoped_ptr.h"
+#include "gpu/demos/framework/demo.h"
+#include "gpu/pgl/pgl.h"
+#include "webkit/glue/plugins/nphostapi.h"
+
+namespace gpu {
+namespace demos {
+
+// Acts as a framework for pepper3d demos. It is in fact a pepper plugin with
+// a pepper3d device. It delegates all rendering tasks to demo object.
+class Plugin : public NPObject {
+ public:
+ explicit Plugin(NPP npp);
+ ~Plugin();
+
+ static NPClass* GetPluginClass();
+
+ NPP npp() const { return npp_; }
+ void New(NPMIMEType pluginType, int16 argc, char* argn[], char* argv[]);
+ void SetWindow(const NPWindow& window);
+
+ // Called by the browser to paint the window.
+ void Paint();
+
+ private:
+ // This class object needs to be safely casted to NPObject* and cross
+ // c-c++ module boundaries. To accomplish that this class should not have
+ // any virtual member function.
+ NPP npp_;
+
+ NPDevice* device3d_;
+ NPDeviceContext3D context3d_;
+ PGLContext pgl_context_;
+ scoped_ptr<Demo> demo_;
+
+ DISALLOW_COPY_AND_ASSIGN(Plugin);
+};
+
+extern NPNetscapeFuncs* g_browser;
+
+} // namespace demos
+} // namespace gpu
+#endif // GPU_DEMOS_FRAMEWORK_PLUGIN_H_
Property changes on: gpu\demos\framework\plugin.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « gpu/demos/framework/platform.h ('k') | gpu/demos/framework/plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698