| 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 WEBKIT_GLUE_PLUGINS_PEPPER_GRAPHICS_3D_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_GRAPHICS_3D_H_ |
| 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_GRAPHICS_3D_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_GRAPHICS_3D_H_ |
| 7 | 7 |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 9 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 11 #include "third_party/ppapi/c/ppb_graphics_3d.h" | 11 #include "third_party/ppapi/c/pp_instance.h" |
| 12 #include "webkit/glue/plugins/pepper_plugin_delegate.h" | 12 #include "webkit/glue/plugins/pepper_plugin_delegate.h" |
| 13 #include "webkit/glue/plugins/pepper_resource.h" | 13 #include "webkit/glue/plugins/pepper_resource.h" |
| 14 | 14 |
| 15 | |
| 16 namespace gfx { | 15 namespace gfx { |
| 17 class Rect; | 16 class Rect; |
| 18 } // namespace gfx | 17 } // namespace gfx |
| 19 | 18 |
| 20 namespace gpu { | 19 namespace gpu { |
| 21 class CommandBuffer; | 20 class CommandBuffer; |
| 22 } // namespace gpu | 21 } // namespace gpu |
| 23 | 22 |
| 24 typedef struct _ppb_OpenGLES PPB_OpenGLES; | 23 struct PPB_Graphics3D_Dev; |
| 24 struct PPB_OpenGLES_Dev; |
| 25 | 25 |
| 26 namespace pepper { | 26 namespace pepper { |
| 27 | 27 |
| 28 class Graphics3D : public Resource { | 28 class Graphics3D : public Resource { |
| 29 public: | 29 public: |
| 30 explicit Graphics3D(PluginModule* module); | 30 explicit Graphics3D(PluginModule* module); |
| 31 | 31 |
| 32 virtual ~Graphics3D(); | 32 virtual ~Graphics3D(); |
| 33 | 33 |
| 34 static const PPB_Graphics3D* GetInterface(); | 34 static const PPB_Graphics3D_Dev* GetInterface(); |
| 35 | 35 static const PPB_OpenGLES_Dev* GetOpenGLESInterface(); |
| 36 static const PPB_OpenGLES* GetOpenGLESInterface(); | |
| 37 | 36 |
| 38 static bool Shutdown(); | 37 static bool Shutdown(); |
| 39 | 38 |
| 40 static Graphics3D* GetCurrent(); | 39 static Graphics3D* GetCurrent(); |
| 41 | 40 |
| 42 static void ResetCurrent(); | 41 static void ResetCurrent(); |
| 43 | 42 |
| 44 // Resource override. | 43 // Resource override. |
| 45 virtual Graphics3D* AsGraphics3D() { | 44 virtual Graphics3D* AsGraphics3D() { |
| 46 return this; | 45 return this; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 77 scoped_ptr<gpu::gles2::GLES2Implementation> gles2_implementation_; | 76 scoped_ptr<gpu::gles2::GLES2Implementation> gles2_implementation_; |
| 78 | 77 |
| 79 // Runnable methods that must be cancelled when the 3D context is destroyed. | 78 // Runnable methods that must be cancelled when the 3D context is destroyed. |
| 80 ScopedRunnableMethodFactory<Graphics3D> method_factory3d_; | 79 ScopedRunnableMethodFactory<Graphics3D> method_factory3d_; |
| 81 }; | 80 }; |
| 82 | 81 |
| 83 } // namespace pepper | 82 } // namespace pepper |
| 84 | 83 |
| 85 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_GRAPHICS_3D_H_ | 84 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_GRAPHICS_3D_H_ |
| 86 | 85 |
| OLD | NEW |