OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GPU_DEMOS_FRAMEWORK_PLUGIN_H_ | 5 #ifndef GPU_DEMOS_FRAMEWORK_PLUGIN_H_ |
6 #define GPU_DEMOS_FRAMEWORK_PLUGIN_H_ | 6 #define GPU_DEMOS_FRAMEWORK_PLUGIN_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "gpu/demos/framework/demo.h" | 10 #include "gpu/demos/framework/demo.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 static NPClass* GetPluginClass(); | 24 static NPClass* GetPluginClass(); |
25 | 25 |
26 NPP npp() const { return npp_; } | 26 NPP npp() const { return npp_; } |
27 void New(NPMIMEType pluginType, int16 argc, char* argn[], char* argv[]); | 27 void New(NPMIMEType pluginType, int16 argc, char* argn[], char* argv[]); |
28 void SetWindow(const NPWindow& window); | 28 void SetWindow(const NPWindow& window); |
29 | 29 |
30 // Called by the browser to paint the window. | 30 // Called by the browser to paint the window. |
31 void Paint(); | 31 void Paint(); |
32 | 32 |
33 private: | 33 private: |
| 34 void CreateContext(); |
| 35 void DestroyContext(); |
| 36 |
34 // This class object needs to be safely casted to NPObject* and cross | 37 // This class object needs to be safely casted to NPObject* and cross |
35 // c-c++ module boundaries. To accomplish that this class should not have | 38 // c-c++ module boundaries. To accomplish that this class should not have |
36 // any virtual member function. | 39 // any virtual member function. |
37 NPP npp_; | 40 NPP npp_; |
38 | 41 |
39 NPDevice* device3d_; | 42 NPDevice* device3d_; |
40 NPDeviceContext3D context3d_; | 43 NPDeviceContext3D context3d_; |
41 PGLContext pgl_context_; | 44 PGLContext pgl_context_; |
42 scoped_ptr<Demo> demo_; | 45 scoped_ptr<Demo> demo_; |
43 | 46 |
44 DISALLOW_COPY_AND_ASSIGN(Plugin); | 47 DISALLOW_COPY_AND_ASSIGN(Plugin); |
45 }; | 48 }; |
46 | 49 |
47 extern NPNetscapeFuncs* g_browser; | 50 extern NPNetscapeFuncs* g_browser; |
48 | 51 |
49 } // namespace demos | 52 } // namespace demos |
50 } // namespace gpu | 53 } // namespace gpu |
51 #endif // GPU_DEMOS_FRAMEWORK_PLUGIN_H_ | 54 #endif // GPU_DEMOS_FRAMEWORK_PLUGIN_H_ |
OLD | NEW |