| 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 CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 protected: | 52 protected: |
| 53 virtual ~PPB_Graphics3D_Impl(); | 53 virtual ~PPB_Graphics3D_Impl(); |
| 54 // ppapi::PPB_Graphics3D_Shared overrides. | 54 // ppapi::PPB_Graphics3D_Shared overrides. |
| 55 virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE; | 55 virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE; |
| 56 virtual gpu::GpuControl* GetGpuControl() OVERRIDE; | 56 virtual gpu::GpuControl* GetGpuControl() OVERRIDE; |
| 57 virtual int32 DoSwapBuffers() OVERRIDE; | 57 virtual int32 DoSwapBuffers() OVERRIDE; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 explicit PPB_Graphics3D_Impl(PP_Instance instance); | 60 explicit PPB_Graphics3D_Impl(PP_Instance instance); |
| 61 | 61 |
| 62 bool Init(PPB_Graphics3D_API* share_context, | 62 bool Init(PPB_Graphics3D_API* share_context, const int32_t* attrib_list); |
| 63 const int32_t* attrib_list); | 63 bool InitRaw(PPB_Graphics3D_API* share_context, const int32_t* attrib_list); |
| 64 bool InitRaw(PPB_Graphics3D_API* share_context, | |
| 65 const int32_t* attrib_list); | |
| 66 | 64 |
| 67 // Notifications received from the GPU process. | 65 // Notifications received from the GPU process. |
| 68 void OnSwapBuffers(); | 66 void OnSwapBuffers(); |
| 69 void OnContextLost(); | 67 void OnContextLost(); |
| 70 void OnConsoleMessage(const std::string& msg, int id); | 68 void OnConsoleMessage(const std::string& msg, int id); |
| 71 // Notifications sent to plugin. | 69 // Notifications sent to plugin. |
| 72 void SendContextLost(); | 70 void SendContextLost(); |
| 73 | 71 |
| 74 // True if context is bound to instance. | 72 // True if context is bound to instance. |
| 75 bool bound_to_instance_; | 73 bool bound_to_instance_; |
| 76 // True when waiting for compositor to commit our backing texture. | 74 // True when waiting for compositor to commit our backing texture. |
| 77 bool commit_pending_; | 75 bool commit_pending_; |
| 78 // The 3D Context. Responsible for providing the command buffer. | 76 // The 3D Context. Responsible for providing the command buffer. |
| 79 scoped_ptr<PlatformContext3D> platform_context_; | 77 scoped_ptr<PlatformContext3D> platform_context_; |
| 80 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; | 78 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; |
| 81 | 79 |
| 82 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); | 80 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); |
| 83 }; | 81 }; |
| 84 | 82 |
| 85 } // namespace content | 83 } // namespace content |
| 86 | 84 |
| 87 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ | 85 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
| OLD | NEW |