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