| 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 CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_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 "content/renderer/pepper/plugin_delegate.h" |
| 9 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" | 10 #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" |
| 10 #include "ppapi/shared_impl/resource.h" | 11 #include "ppapi/shared_impl/resource.h" |
| 11 #include "webkit/plugins/ppapi/plugin_delegate.h" | |
| 12 | 12 |
| 13 namespace webkit { | 13 namespace webkit { |
| 14 namespace ppapi { | 14 namespace ppapi { |
| 15 | 15 |
| 16 class PPB_Graphics3D_Impl : public ::ppapi::PPB_Graphics3D_Shared { | 16 class PPB_Graphics3D_Impl : public ::ppapi::PPB_Graphics3D_Shared { |
| 17 public: | 17 public: |
| 18 virtual ~PPB_Graphics3D_Impl(); | |
| 19 | |
| 20 static PP_Resource Create(PP_Instance instance, | 18 static PP_Resource Create(PP_Instance instance, |
| 21 PP_Resource share_context, | 19 PP_Resource share_context, |
| 22 const int32_t* attrib_list); | 20 const int32_t* attrib_list); |
| 23 static PP_Resource CreateRaw(PP_Instance instance, | 21 static PP_Resource CreateRaw(PP_Instance instance, |
| 24 PP_Resource share_context, | 22 PP_Resource share_context, |
| 25 const int32_t* attrib_list); | 23 const int32_t* attrib_list); |
| 26 | 24 |
| 27 // PPB_Graphics3D_API trusted implementation. | 25 // PPB_Graphics3D_API trusted implementation. |
| 28 virtual PP_Bool SetGetBuffer(int32_t transfer_buffer_id) OVERRIDE; | 26 virtual PP_Bool SetGetBuffer(int32_t transfer_buffer_id) OVERRIDE; |
| 29 virtual gpu::CommandBuffer::State GetState() OVERRIDE; | 27 virtual gpu::CommandBuffer::State GetState() OVERRIDE; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 50 // These messages are used to send Flush callbacks to the plugin. | 48 // These messages are used to send Flush callbacks to the plugin. |
| 51 void ViewWillInitiatePaint(); | 49 void ViewWillInitiatePaint(); |
| 52 void ViewInitiatedPaint(); | 50 void ViewInitiatedPaint(); |
| 53 void ViewFlushedPaint(); | 51 void ViewFlushedPaint(); |
| 54 | 52 |
| 55 PluginDelegate::PlatformContext3D* platform_context() { | 53 PluginDelegate::PlatformContext3D* platform_context() { |
| 56 return platform_context_.get(); | 54 return platform_context_.get(); |
| 57 } | 55 } |
| 58 | 56 |
| 59 protected: | 57 protected: |
| 58 virtual ~PPB_Graphics3D_Impl(); |
| 60 // ppapi::PPB_Graphics3D_Shared overrides. | 59 // ppapi::PPB_Graphics3D_Shared overrides. |
| 61 virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE; | 60 virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE; |
| 62 virtual int32 DoSwapBuffers() OVERRIDE; | 61 virtual int32 DoSwapBuffers() OVERRIDE; |
| 63 | 62 |
| 64 private: | 63 private: |
| 65 explicit PPB_Graphics3D_Impl(PP_Instance instance); | 64 explicit PPB_Graphics3D_Impl(PP_Instance instance); |
| 66 | 65 |
| 67 static PP_Bool IsGpuBlacklisted(); | 66 static PP_Bool IsGpuBlacklisted(); |
| 68 | 67 |
| 69 bool Init(PPB_Graphics3D_API* share_context, | 68 bool Init(PPB_Graphics3D_API* share_context, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 85 // PluginDelegate's 3D Context. Responsible for providing the command buffer. | 84 // PluginDelegate's 3D Context. Responsible for providing the command buffer. |
| 86 scoped_ptr<PluginDelegate::PlatformContext3D> platform_context_; | 85 scoped_ptr<PluginDelegate::PlatformContext3D> platform_context_; |
| 87 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; | 86 base::WeakPtrFactory<PPB_Graphics3D_Impl> weak_ptr_factory_; |
| 88 | 87 |
| 89 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); | 88 DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); |
| 90 }; | 89 }; |
| 91 | 90 |
| 92 } // namespace ppapi | 91 } // namespace ppapi |
| 93 } // namespace webkit | 92 } // namespace webkit |
| 94 | 93 |
| 95 #endif // WEBKIT_PLUGINS_PPAPI_PPB_GRAPHICS_3D_IMPL_H_ | 94 #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ |
| OLD | NEW |