| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" | 9 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" |
| 10 #include "ppapi/shared_impl/resource.h" | 10 #include "ppapi/shared_impl/resource.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 // ppapi::PPB_Graphics3D_Shared overrides. | 63 // ppapi::PPB_Graphics3D_Shared overrides. |
| 64 virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE; | 64 virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE; |
| 65 virtual int32 DoSwapBuffers() OVERRIDE; | 65 virtual int32 DoSwapBuffers() OVERRIDE; |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 explicit PPB_Graphics3D_Impl(PP_Instance instance); | 68 explicit PPB_Graphics3D_Impl(PP_Instance instance); |
| 69 | 69 |
| 70 bool Init(PP_Resource share_context, | 70 bool Init(PPB_Graphics3D_API* share_context, |
| 71 const int32_t* attrib_list); | 71 const int32_t* attrib_list); |
| 72 bool InitRaw(PP_Resource share_context, | 72 bool InitRaw(PPB_Graphics3D_API* share_context, |
| 73 const int32_t* attrib_list); | 73 const int32_t* attrib_list); |
| 74 | 74 |
| 75 // Notifications received from the GPU process. | 75 // Notifications received from the GPU process. |
| 76 void OnSwapBuffers(); | 76 void OnSwapBuffers(); |
| 77 void OnContextLost(); | 77 void OnContextLost(); |
| 78 void OnConsoleMessage(const std::string& msg, int id); | 78 void OnConsoleMessage(const std::string& msg, int id); |
| 79 // Notifications sent to plugin. | 79 // Notifications sent to plugin. |
| 80 void SendContextLost(); | 80 void SendContextLost(); |
| 81 | 81 |
| 82 // True if context is bound to instance. | 82 // True if context is bound to instance. |
| 83 bool bound_to_instance_; | 83 bool bound_to_instance_; |
| 84 // True when waiting for compositor to commit our backing texture. | 84 // True when waiting for compositor to commit our backing texture. |
| 85 bool commit_pending_; | 85 bool commit_pending_; |
| 86 // PluginDelegate's 3D Context. Responsible for providing the command buffer. | 86 // PluginDelegate's 3D Context. Responsible for providing the command buffer. |
| 87 scoped_ptr<PluginDelegate::PlatformContext3D> platform_context_; | 87 scoped_ptr<PluginDelegate::PlatformContext3D> platform_context_; |
| 88 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; | 88 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); | 90 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace ppapi | 93 } // namespace ppapi |
| 94 } // namespace webkit | 94 } // namespace webkit |
| 95 | 95 |
| 96 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_ | 96 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_ |
| OLD | NEW |