| 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_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 static PPB_Graphics3D_Impl* GetCurrent(); | 41 static PPB_Graphics3D_Impl* GetCurrent(); |
| 42 | 42 |
| 43 static void ResetCurrent(); | 43 static void ResetCurrent(); |
| 44 | 44 |
| 45 // Resource override. | 45 // Resource override. |
| 46 virtual PPB_Graphics3D_Impl* AsPPB_Graphics3D_Impl(); | 46 virtual PPB_Graphics3D_Impl* AsPPB_Graphics3D_Impl(); |
| 47 | 47 |
| 48 bool Init(PP_Instance instance_id, int32_t config, | 48 bool Init(PP_Instance instance_id, int32_t config, |
| 49 const int32_t* attrib_list); | 49 const int32_t* attrib_list); |
| 50 | 50 |
| 51 // Associates this PPB_Graphics3D_Impl with the given plugin instance. You can | 51 // Associates this PPB_Graphics3D_Impl with the given plugin instance. You can
pass |
| 52 // pass NULL to clear the existing device. Returns true on success. In this | 52 // NULL to clear the existing device. Returns true on success. In this case, |
| 53 // case, the last rendered frame is displayed. | 53 // the last rendered frame is displayed. |
| 54 // TODO(apatrick): Figure out the best semantics here. | 54 // TODO(apatrick): Figure out the best semantics here. |
| 55 bool BindToInstance(PluginInstance* new_instance); | 55 bool BindToInstance(PluginInstance* new_instance); |
| 56 | 56 |
| 57 bool MakeCurrent(); | 57 bool MakeCurrent(); |
| 58 | 58 |
| 59 bool SwapBuffers(PP_CompletionCallback callback); | 59 bool SwapBuffers(); |
| 60 | 60 |
| 61 unsigned GetError(); | 61 unsigned GetError(); |
| 62 | 62 |
| 63 void ResizeBackingTexture(const gfx::Size& size); | 63 void ResizeBackingTexture(const gfx::Size& size); |
| 64 | 64 |
| 65 void SetSwapBuffersCallback(Callback0::Type* callback); | 65 void SetSwapBuffersCallback(Callback0::Type* callback); |
| 66 | 66 |
| 67 void ViewInitiatedPaint(); | |
| 68 void ViewFlushedPaint(); | |
| 69 | |
| 70 unsigned GetBackingTextureId(); | 67 unsigned GetBackingTextureId(); |
| 71 | 68 |
| 72 gpu::gles2::GLES2Implementation* impl() { | 69 gpu::gles2::GLES2Implementation* impl() { |
| 73 return gles2_implementation_; | 70 return gles2_implementation_; |
| 74 } | 71 } |
| 75 | 72 |
| 76 private: | 73 private: |
| 77 void Destroy(); | 74 void Destroy(); |
| 78 | 75 |
| 79 // Non-owning pointer to the plugin instance this context is currently bound | 76 // Non-owning pointer to the plugin instance this context is currently bound |
| 80 // to, if any. If the context is currently unbound, this will be NULL. | 77 // to, if any. If the context is currently unbound, this will be NULL. |
| 81 PluginInstance* bound_instance_; | 78 PluginInstance* bound_instance_; |
| 82 | 79 |
| 83 // True when the page's SwapBuffers has been issued but not returned yet. | |
| 84 bool swap_initiated_; | |
| 85 PP_CompletionCallback swap_callback_; | |
| 86 | |
| 87 // PluginDelegate's 3D Context. Responsible for providing the command buffer. | 80 // PluginDelegate's 3D Context. Responsible for providing the command buffer. |
| 88 scoped_ptr<PluginDelegate::PlatformContext3D> platform_context_; | 81 scoped_ptr<PluginDelegate::PlatformContext3D> platform_context_; |
| 89 | 82 |
| 90 // GLES2 Implementation instance. Owned by the platform context's GGL context. | 83 // GLES2 Implementation instance. Owned by the platform context's GGL context. |
| 91 gpu::gles2::GLES2Implementation* gles2_implementation_; | 84 gpu::gles2::GLES2Implementation* gles2_implementation_; |
| 92 | 85 |
| 93 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); | 86 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); |
| 94 }; | 87 }; |
| 95 | 88 |
| 96 } // namespace ppapi | 89 } // namespace ppapi |
| 97 } // namespace webkit | 90 } // namespace webkit |
| 98 | 91 |
| 99 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_ | 92 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_ |
| 100 | 93 |
| OLD | NEW |