OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 12 matching lines...) Expand all Loading... |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef WEBKIT_TOOLS_PEPPER_TEST_PLUGIN_PLUGIN_OBJECT_H_ | 26 #ifndef WEBKIT_TOOLS_PEPPER_TEST_PLUGIN_PLUGIN_OBJECT_H_ |
27 #define WEBKIT_TOOLS_PEPPER_TEST_PLUGIN_PLUGIN_OBJECT_H_ | 27 #define WEBKIT_TOOLS_PEPPER_TEST_PLUGIN_PLUGIN_OBJECT_H_ |
28 | 28 |
29 #include "base/basictypes.h" | 29 #include "base/basictypes.h" |
30 #include "base/scoped_ptr.h" | 30 #include "base/scoped_ptr.h" |
31 #include "webkit/glue/plugins/nphostapi.h" | 31 #include "webkit/glue/plugins/nphostapi.h" |
32 #if !defined(INDEPENDENT_PLUGIN) | 32 #if !defined(INDEPENDENT_PLUGIN) |
33 #include "gpu/pgl/pgl.h" | 33 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 34 #include "webkit/tools/pepper_test_plugin/command_buffer_pepper.h" |
34 #endif | 35 #endif |
35 | 36 |
36 extern NPNetscapeFuncs* browser; | 37 extern NPNetscapeFuncs* browser; |
37 | 38 |
38 class PluginObject { | 39 class PluginObject { |
39 public: | 40 public: |
40 explicit PluginObject(NPP npp); | 41 explicit PluginObject(NPP npp); |
41 ~PluginObject(); | 42 ~PluginObject(); |
42 | 43 |
43 static NPClass* GetPluginClass(); | 44 static NPClass* GetPluginClass(); |
44 | 45 |
45 NPObject* header() { return &header_; } | 46 NPObject* header() { return &header_; } |
46 NPP npp() const { return npp_; } | 47 NPP npp() const { return npp_; } |
47 | 48 |
48 void New(NPMIMEType pluginType, int16 argc, char* argn[], char* argv[]); | 49 void New(NPMIMEType pluginType, int16 argc, char* argn[], char* argv[]); |
49 void SetWindow(const NPWindow& window); | 50 void SetWindow(const NPWindow& window); |
50 void Draw3D(); | 51 void Draw3D(); |
51 | 52 |
52 private: | 53 private: |
| 54 bool InitializeCommandBuffer(); |
| 55 |
53 NPObject header_; | 56 NPObject header_; |
54 NPP npp_; | 57 NPP npp_; |
55 NPObject* test_object_; | 58 NPObject* test_object_; |
56 int dimensions_; | 59 int dimensions_; |
57 | 60 |
58 NPDevice* device2d_; | 61 NPDevice* device2d_; |
59 NPDevice* device3d_; | |
60 NPDevice* deviceaudio_; | 62 NPDevice* deviceaudio_; |
61 | 63 |
62 NPDeviceContext3D context3d_; | |
63 NPDeviceContextAudio context_audio_; | 64 NPDeviceContextAudio context_audio_; |
64 | 65 |
65 | |
66 #if !defined(INDEPENDENT_PLUGIN) | 66 #if !defined(INDEPENDENT_PLUGIN) |
67 PGLContext pgl_context_; | 67 scoped_ptr<CommandBufferPepper> command_buffer_; |
| 68 scoped_ptr<gpu::gles2::GLES2CmdHelper> helper_; |
| 69 scoped_ptr<gpu::gles2::GLES2Implementation> gles2_implementation_; |
68 #endif | 70 #endif |
69 | 71 |
70 int width_; | 72 int width_; |
71 int height_; | 73 int height_; |
72 | 74 |
73 DISALLOW_COPY_AND_ASSIGN(PluginObject); | 75 DISALLOW_COPY_AND_ASSIGN(PluginObject); |
74 }; | 76 }; |
75 | 77 |
76 | 78 |
77 #endif // WEBKIT_TOOLS_PEPPER_TEST_PLUGIN_PLUGIN_OBJECT_H_ | 79 #endif // WEBKIT_TOOLS_PEPPER_TEST_PLUGIN_PLUGIN_OBJECT_H_ |
OLD | NEW |