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 <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 "components/mus/gles2/command_buffer_local_client.h" | 15 #include "components/mus/gles2/command_buffer_local_client.h" |
16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
17 #include "ui/gl/gl_surface.h" | 17 #include "ui/gl/gl_surface.h" |
18 | 18 |
19 namespace gpu { | 19 namespace gpu { |
20 | 20 |
| 21 class CommandBufferProxyImpl; |
21 class TransferBuffer; | 22 class TransferBuffer; |
22 | 23 |
23 namespace gles2 { | 24 namespace gles2 { |
24 class GLES2CmdHelper; | 25 class GLES2CmdHelper; |
25 class GLES2Implementation; | 26 class GLES2Implementation; |
26 } | 27 } |
27 | 28 |
28 } // namespace gpu | 29 } // namespace gpu |
29 | 30 |
30 namespace mus { | 31 namespace mus { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 63 |
63 protected: | 64 protected: |
64 friend class base::RefCountedThreadSafe<SurfacesContextProvider>; | 65 friend class base::RefCountedThreadSafe<SurfacesContextProvider>; |
65 ~SurfacesContextProvider() override; | 66 ~SurfacesContextProvider() override; |
66 | 67 |
67 private: | 68 private: |
68 // CommandBufferLocalClient: | 69 // CommandBufferLocalClient: |
69 void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; | 70 void UpdateVSyncParameters(int64_t timebase, int64_t interval) override; |
70 void GpuCompletedSwapBuffers(gfx::SwapResult result) override; | 71 void GpuCompletedSwapBuffers(gfx::SwapResult result) override; |
71 | 72 |
| 73 bool use_chrome_gpu_command_buffer_; |
| 74 |
72 // From GLES2Context: | 75 // From GLES2Context: |
73 // Initialized in BindToCurrentThread. | 76 // Initialized in BindToCurrentThread. |
74 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 77 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
75 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; | 78 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; |
76 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; | 79 std::unique_ptr<gpu::gles2::GLES2Implementation> implementation_; |
77 | 80 |
78 gpu::Capabilities capabilities_; | 81 gpu::Capabilities capabilities_; |
79 LostContextCallback lost_context_callback_; | 82 LostContextCallback lost_context_callback_; |
80 | 83 |
81 SurfacesContextProviderDelegate* delegate_; | 84 SurfacesContextProviderDelegate* delegate_; |
82 gfx::AcceleratedWidget widget_; | 85 gfx::AcceleratedWidget widget_; |
83 CommandBufferLocal* command_buffer_local_; | 86 CommandBufferLocal* command_buffer_local_; |
| 87 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_proxy_impl_; |
84 | 88 |
85 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; | 89 gl::GLSurface::SwapCompletionCallback swap_buffers_completion_callback_; |
86 | 90 |
87 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); | 91 DISALLOW_COPY_AND_ASSIGN(SurfacesContextProvider); |
88 }; | 92 }; |
89 | 93 |
90 } // namespace mus | 94 } // namespace mus |
91 | 95 |
92 #endif // COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ | 96 #endif // COMPONENTS_MUS_SURFACES_SURFACES_CONTEXT_PROVIDER_H_ |
OLD | NEW |