| 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_SURFACE_3D_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_SURFACE_3D_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PPB_SURFACE_3D_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_SURFACE_3D_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "ppapi/c/dev/ppb_surface_3d_dev.h" | 9 #include "ppapi/c/dev/ppb_surface_3d_dev.h" |
| 10 #include "webkit/plugins/ppapi/plugin_delegate.h" | 10 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // window. Returns true if binding/unbinding is successful. | 42 // window. Returns true if binding/unbinding is successful. |
| 43 bool BindToInstance(bool bind); | 43 bool BindToInstance(bool bind); |
| 44 | 44 |
| 45 // Binds the context such that all draw calls to context | 45 // Binds the context such that all draw calls to context |
| 46 // affect this surface. To unbind call this function will NULL context. | 46 // affect this surface. To unbind call this function will NULL context. |
| 47 // Returns true if successful. | 47 // Returns true if successful. |
| 48 bool BindToContext(PluginDelegate::PlatformContext3D* context); | 48 bool BindToContext(PluginDelegate::PlatformContext3D* context); |
| 49 | 49 |
| 50 unsigned int GetBackingTextureId(); | 50 unsigned int GetBackingTextureId(); |
| 51 | 51 |
| 52 bool SwapBuffers(); | 52 bool SwapBuffers(PP_CompletionCallback callback); |
| 53 |
| 54 void ViewInitiatedPaint(); |
| 55 void ViewFlushedPaint(); |
| 53 | 56 |
| 54 private: | 57 private: |
| 55 // Called when SwapBuffers is complete. | 58 // Called when SwapBuffers is complete. |
| 56 void OnSwapBuffers(); | 59 void OnSwapBuffers(); |
| 57 | 60 |
| 58 // Plugin instance this surface is associated with. | 61 // Plugin instance this surface is associated with. |
| 59 PluginInstance* instance_; | 62 PluginInstance* instance_; |
| 60 bool bound_to_instance_; | 63 bool bound_to_instance_; |
| 61 | 64 |
| 65 // True when the page's SwapBuffers has been issued but not returned yet. |
| 66 bool swap_initiated_; |
| 67 PP_CompletionCallback swap_callback_; |
| 68 |
| 62 // The context this surface is currently bound to. | 69 // The context this surface is currently bound to. |
| 63 PluginDelegate::PlatformContext3D* context_; | 70 PluginDelegate::PlatformContext3D* context_; |
| 64 | 71 |
| 65 DISALLOW_COPY_AND_ASSIGN(PPB_Surface3D_Impl); | 72 DISALLOW_COPY_AND_ASSIGN(PPB_Surface3D_Impl); |
| 66 }; | 73 }; |
| 67 | 74 |
| 68 } // namespace ppapi | 75 } // namespace ppapi |
| 69 } // namespace webkit | 76 } // namespace webkit |
| 70 | 77 |
| 71 #endif // WEBKIT_PLUGINS_PPAPI_PPB_SURFACE_3D_IMPL_H_ | 78 #endif // WEBKIT_PLUGINS_PPAPI_PPB_SURFACE_3D_IMPL_H_ |
| OLD | NEW |