| 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 #ifndef CHROME_RENDERER_PEPPER_PLATFORM_CONTEXT_3D_IMPL_H_ | 4 #ifndef CHROME_RENDERER_PEPPER_PLATFORM_CONTEXT_3D_IMPL_H_ |
| 5 #define CHROME_RENDERER_PEPPER_PLATFORM_CONTEXT_3D_IMPL_H_ | 5 #define CHROME_RENDERER_PEPPER_PLATFORM_CONTEXT_3D_IMPL_H_ |
| 6 | 6 |
| 7 #include "webkit/plugins/ppapi/plugin_delegate.h" | 7 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 8 | 8 |
| 9 #ifdef ENABLE_GPU | 9 #ifdef ENABLE_GPU |
| 10 | 10 |
| 11 namespace gpu { |
| 12 |
| 13 class CommandBuffer; |
| 14 |
| 15 } // namespace gpu |
| 16 |
| 11 namespace ggl { | 17 namespace ggl { |
| 12 | 18 |
| 13 class Context; | 19 class Context; |
| 14 | 20 |
| 15 } // namespace ggl; | 21 } // namespace ggl; |
| 16 | 22 |
| 23 class GpuChannelHost; |
| 24 class CommandBufferProxy; |
| 25 |
| 17 class PlatformContext3DImpl | 26 class PlatformContext3DImpl |
| 18 : public webkit::ppapi::PluginDelegate::PlatformContext3D { | 27 : public webkit::ppapi::PluginDelegate::PlatformContext3D { |
| 19 public: | 28 public: |
| 20 explicit PlatformContext3DImpl(ggl::Context* parent_context); | 29 explicit PlatformContext3DImpl(ggl::Context* parent_context); |
| 21 virtual ~PlatformContext3DImpl(); | 30 virtual ~PlatformContext3DImpl(); |
| 22 | 31 |
| 23 virtual bool Init(); | 32 virtual bool Init(); |
| 24 virtual bool SwapBuffers(); | |
| 25 virtual unsigned GetError(); | |
| 26 virtual void SetSwapBuffersCallback(Callback0::Type* callback); | 33 virtual void SetSwapBuffersCallback(Callback0::Type* callback); |
| 27 virtual unsigned GetBackingTextureId(); | 34 virtual unsigned GetBackingTextureId(); |
| 28 virtual gpu::gles2::GLES2Implementation* GetGLES2Implementation(); | 35 virtual gpu::CommandBuffer* GetCommandBuffer(); |
| 29 | 36 |
| 30 private: | 37 private: |
| 38 bool InitRaw(); |
| 39 |
| 31 ggl::Context* parent_context_; | 40 ggl::Context* parent_context_; |
| 32 ggl::Context* context_; | 41 scoped_refptr<GpuChannelHost> channel_; |
| 42 unsigned int parent_texture_id_; |
| 43 CommandBufferProxy* command_buffer_; |
| 33 }; | 44 }; |
| 34 | 45 |
| 35 #endif // ENABLE_GPU | 46 #endif // ENABLE_GPU |
| 36 | 47 |
| 37 #endif // CHROME_RENDERER_PEPPER_PLATFORM_CONTEXT_3D_IMPL_H_ | 48 #endif // CHROME_RENDERER_PEPPER_PLATFORM_CONTEXT_3D_IMPL_H_ |
| OLD | NEW |