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