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