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 "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 #include "ui/gl/gl_surface.h" | 16 #include "ui/gl/gl_surface.h" |
17 | 17 |
18 namespace gpu { | 18 namespace gpu { |
19 | 19 |
20 class CommandBufferProxyImpl; | 20 class CommandBufferProxyImpl; |
| 21 class GpuChannelHost; |
21 struct GpuProcessHostedCALayerTreeParamsMac; | 22 struct GpuProcessHostedCALayerTreeParamsMac; |
22 class TransferBuffer; | 23 class TransferBuffer; |
23 | 24 |
24 namespace gles2 { | 25 namespace gles2 { |
25 class GLES2CmdHelper; | 26 class GLES2CmdHelper; |
26 class GLES2Implementation; | 27 class GLES2Implementation; |
27 } | 28 } |
28 | 29 |
29 } // namespace gpu | 30 } // namespace gpu |
30 | 31 |
31 namespace ui { | 32 namespace ui { |
32 class LatencyInfo; | 33 class LatencyInfo; |
33 } | 34 } |
34 | 35 |
35 namespace ui { | 36 namespace ui { |
36 | 37 |
37 class CommandBufferDriver; | 38 class CommandBufferDriver; |
38 class CommandBufferImpl; | 39 class CommandBufferImpl; |
39 class SurfacesContextProviderDelegate; | 40 class SurfacesContextProviderDelegate; |
40 | 41 |
41 class SurfacesContextProvider : public cc::ContextProvider, | 42 class SurfacesContextProvider : public cc::ContextProvider, |
42 public base::NonThreadSafe { | 43 public base::NonThreadSafe { |
43 public: | 44 public: |
44 explicit SurfacesContextProvider(gfx::AcceleratedWidget widget); | 45 SurfacesContextProvider(gfx::AcceleratedWidget widget, |
| 46 scoped_refptr<gpu::GpuChannelHost> gpu_channel); |
45 | 47 |
46 void SetDelegate(SurfacesContextProviderDelegate* delegate); | 48 void SetDelegate(SurfacesContextProviderDelegate* delegate); |
47 | 49 |
48 // cc::ContextProvider implementation. | 50 // cc::ContextProvider implementation. |
49 bool BindToCurrentThread() override; | 51 bool BindToCurrentThread() override; |
50 gpu::gles2::GLES2Interface* ContextGL() override; | 52 gpu::gles2::GLES2Interface* ContextGL() override; |
51 gpu::ContextSupport* ContextSupport() override; | 53 gpu::ContextSupport* ContextSupport() override; |
52 class GrContext* GrContext() override; | 54 class GrContext* GrContext() override; |
53 void InvalidateGrContext(uint32_t state) override; | 55 void InvalidateGrContext(uint32_t state) override; |
54 gpu::Capabilities ContextCapabilities() override; | 56 gpu::Capabilities ContextCapabilities() override; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 gfx::AcceleratedWidget widget_; | 89 gfx::AcceleratedWidget widget_; |
88 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; | 90 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; |
89 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; | 91 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; |
90 | 92 |
91 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); | 93 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); |
92 }; | 94 }; |
93 | 95 |
94 } // namespace ui | 96 } // namespace ui |
95 | 97 |
96 #endif // SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 98 #endif // SERVICES_UI_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
OLD | NEW |