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 COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 5 #ifndef COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
6 #define COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 6 #define COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "base/threading/non_thread_safe.h" | 10 #include "base/threading/non_thread_safe.h" |
11 #include "cc/output/context_provider.h" | 11 #include "cc/output/context_provider.h" |
12 #include "components/mus/gles2/command_buffer_local_client.h" | 12 #include "components/mus/gles2/command_buffer_local_client.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 | 14 |
15 namespace gpu { | 15 namespace gpu { |
16 | 16 |
17 class TransferBuffer; | 17 class TransferBuffer; |
18 | 18 |
19 namespace gles2 { | 19 namespace gles2 { |
20 class GLES2CmdHelper; | 20 class GLES2CmdHelper; |
21 class GLES2Implementation; | 21 class GLES2Implementation; |
22 } | 22 } |
23 | 23 |
24 } // namespace gpu | 24 } // namespace gpu |
25 | 25 |
26 namespace mus { | 26 namespace gles2 { |
27 | |
28 class CommandBufferDriver; | 27 class CommandBufferDriver; |
29 class CommandBufferImpl; | 28 class CommandBufferImpl; |
30 class CommandBufferLocal; | 29 class CommandBufferLocal; |
31 class GpuState; | 30 class GpuState; |
| 31 } |
| 32 |
| 33 namespace surfaces { |
| 34 |
32 class SurfacesContextProviderDelegate; | 35 class SurfacesContextProviderDelegate; |
33 | 36 |
34 class SurfacesContextProvider : public cc::ContextProvider, | 37 class SurfacesContextProvider : public cc::ContextProvider, |
35 public CommandBufferLocalClient, | 38 public gles2::CommandBufferLocalClient, |
36 public base::NonThreadSafe { | 39 public base::NonThreadSafe { |
37 public: | 40 public: |
38 SurfacesContextProvider(SurfacesContextProviderDelegate* delegate, | 41 SurfacesContextProvider(SurfacesContextProviderDelegate* delegate, |
39 gfx::AcceleratedWidget widget, | 42 gfx::AcceleratedWidget widget, |
40 const scoped_refptr<GpuState>& state); | 43 const scoped_refptr<gles2::GpuState>& state); |
41 | 44 |
42 // cc::ContextProvider implementation. | 45 // cc::ContextProvider implementation. |
43 bool BindToCurrentThread() override; | 46 bool BindToCurrentThread() override; |
44 gpu::gles2::GLES2Interface* ContextGL() override; | 47 gpu::gles2::GLES2Interface* ContextGL() override; |
45 gpu::ContextSupport* ContextSupport() override; | 48 gpu::ContextSupport* ContextSupport() override; |
46 class GrContext* GrContext() override; | 49 class GrContext* GrContext() override; |
47 void InvalidateGrContext(uint32_t state) override; | 50 void InvalidateGrContext(uint32_t state) override; |
48 Capabilities ContextCapabilities() override; | 51 Capabilities ContextCapabilities() override; |
49 void VerifyContexts() override {} | 52 void VerifyContexts() override {} |
50 void DeleteCachedResources() override {} | 53 void DeleteCachedResources() override {} |
(...skipping 19 matching lines...) Expand all Loading... |
70 // Initialized in BindToCurrentThread. | 73 // Initialized in BindToCurrentThread. |
71 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 74 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
72 scoped_ptr<gpu::TransferBuffer> transfer_buffer_; | 75 scoped_ptr<gpu::TransferBuffer> transfer_buffer_; |
73 scoped_ptr<gpu::gles2::GLES2Implementation> implementation_; | 76 scoped_ptr<gpu::gles2::GLES2Implementation> implementation_; |
74 | 77 |
75 cc::ContextProvider::Capabilities capabilities_; | 78 cc::ContextProvider::Capabilities capabilities_; |
76 LostContextCallback lost_context_callback_; | 79 LostContextCallback lost_context_callback_; |
77 | 80 |
78 SurfacesContextProviderDelegate* delegate_; | 81 SurfacesContextProviderDelegate* delegate_; |
79 gfx::AcceleratedWidget widget_; | 82 gfx::AcceleratedWidget widget_; |
80 scoped_ptr<CommandBufferLocal> command_buffer_local_; | 83 scoped_ptr<gles2::CommandBufferLocal> command_buffer_local_; |
81 | 84 |
82 base::Lock context_lock_; | 85 base::Lock context_lock_; |
83 | 86 |
84 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); | 87 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); |
85 }; | 88 }; |
86 | 89 |
87 } // namespace mus | 90 } // namespace surfaces |
88 | 91 |
89 #endif // COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 92 #endif // COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
OLD | NEW |