| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 5 #ifndef SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
| 6 #define SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 6 #define SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
| 14 #include "cc/output/context_provider.h" | 14 #include "cc/output/context_provider.h" |
| 15 #include "gpu/ipc/common/surface_handle.h" |
| 15 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 16 #include "ui/gl/gl_surface.h" | 17 #include "ui/gl/gl_surface.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class SingleThreadTaskRunner; | 20 class SingleThreadTaskRunner; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace gpu { | 23 namespace gpu { |
| 23 | 24 |
| 24 class CommandBufferProxyImpl; | 25 class CommandBufferProxyImpl; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 39 | 40 |
| 40 namespace ui { | 41 namespace ui { |
| 41 | 42 |
| 42 class CommandBufferDriver; | 43 class CommandBufferDriver; |
| 43 class CommandBufferImpl; | 44 class CommandBufferImpl; |
| 44 class SurfacesContextProviderDelegate; | 45 class SurfacesContextProviderDelegate; |
| 45 | 46 |
| 46 class SurfacesContextProvider : public cc::ContextProvider, | 47 class SurfacesContextProvider : public cc::ContextProvider, |
| 47 public base::NonThreadSafe { | 48 public base::NonThreadSafe { |
| 48 public: | 49 public: |
| 49 SurfacesContextProvider(gfx::AcceleratedWidget widget, | 50 SurfacesContextProvider(gpu::SurfaceHandle widget, |
| 50 scoped_refptr<gpu::GpuChannelHost> gpu_channel); | 51 scoped_refptr<gpu::GpuChannelHost> gpu_channel); |
| 51 | 52 |
| 52 void SetDelegate(SurfacesContextProviderDelegate* delegate); | 53 void SetDelegate(SurfacesContextProviderDelegate* delegate); |
| 53 | 54 |
| 54 // cc::ContextProvider implementation. | 55 // cc::ContextProvider implementation. |
| 55 bool BindToCurrentThread() override; | 56 bool BindToCurrentThread() override; |
| 56 gpu::gles2::GLES2Interface* ContextGL() override; | 57 gpu::gles2::GLES2Interface* ContextGL() override; |
| 57 gpu::ContextSupport* ContextSupport() override; | 58 gpu::ContextSupport* ContextSupport() override; |
| 58 class GrContext* GrContext() override; | 59 class GrContext* GrContext() override; |
| 59 cc::ContextCacheController* CacheController() override; | 60 cc::ContextCacheController* CacheController() override; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 84 // Initialized in BindToCurrentThread. | 85 // Initialized in BindToCurrentThread. |
| 85 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 86 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
| 86 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; | 87 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; |
| 87 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; | 88 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; |
| 88 std::unique_ptr<cc::ContextCacheController> cache_controller_; | 89 std::unique_ptr<cc::ContextCacheController> cache_controller_; |
| 89 | 90 |
| 90 gpu::Capabilities capabilities_; | 91 gpu::Capabilities capabilities_; |
| 91 LostContextCallback lost_context_callback_; | 92 LostContextCallback lost_context_callback_; |
| 92 | 93 |
| 93 SurfacesContextProviderDelegate* delegate_; | 94 SurfacesContextProviderDelegate* delegate_; |
| 94 gfx::AcceleratedWidget widget_; | |
| 95 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; | 95 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; |
| 96 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; | 96 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; |
| 97 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 97 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); | 99 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace ui | 102 } // namespace ui |
| 103 | 103 |
| 104 #endif // SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 104 #endif // SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
| OLD | NEW |