OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
6 | 6 |
7 #include "gpu/demos/framework/demo.h" | 7 #include "gpu/demos/framework/demo.h" |
8 #include "gpu/demos/framework/demo_factory.h" | 8 #include "gpu/demos/framework/demo_factory.h" |
9 #include "ppapi/cpp/completion_callback.h" | 9 #include "ppapi/cpp/completion_callback.h" |
10 #include "ppapi/cpp/graphics_3d.h" | 10 #include "ppapi/cpp/graphics_3d.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 }; | 120 }; |
121 | 121 |
122 class PluginModule : public pp::Module { | 122 class PluginModule : public pp::Module { |
123 public: | 123 public: |
124 PluginModule() {} | 124 PluginModule() {} |
125 ~PluginModule() { | 125 ~PluginModule() { |
126 glTerminatePPAPI(); | 126 glTerminatePPAPI(); |
127 } | 127 } |
128 | 128 |
129 virtual bool Init() { | 129 virtual bool Init() { |
130 return glInitializePPAPI(get_browser_interface()) == GL_TRUE ? true : false; | 130 return (glInitializePPAPI(get_browser_interface()) == GL_TRUE); |
131 } | 131 } |
132 | 132 |
133 virtual pp::Instance* CreateInstance(PP_Instance instance) { | 133 virtual pp::Instance* CreateInstance(PP_Instance instance) { |
134 return new PluginInstance(instance, this); | 134 return new PluginInstance(instance, this); |
135 } | 135 } |
136 }; | 136 }; |
137 | 137 |
138 } // namespace demos | 138 } // namespace demos |
139 } // namespace gpu | 139 } // namespace gpu |
140 | 140 |
141 namespace pp { | 141 namespace pp { |
142 | 142 |
143 Module* CreateModule() { | 143 Module* CreateModule() { |
144 return new gpu::demos::PluginModule(); | 144 return new gpu::demos::PluginModule(); |
145 } | 145 } |
146 | 146 |
147 } // namespace pp | 147 } // namespace pp |
148 | |
OLD | NEW |