OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
16 #include "cc/output/context_provider.h" | 16 #include "cc/output/context_provider.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
18 #include "content/common/gpu/client/command_buffer_metrics.h" | 18 #include "content/common/gpu/client/command_buffer_metrics.h" |
19 #include "gpu/command_buffer/client/shared_memory_limits.h" | 19 #include "gpu/command_buffer/client/shared_memory_limits.h" |
20 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 20 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 21 #include "gpu/ipc/common/gpu_stream_constants.h" |
21 #include "gpu/ipc/common/surface_handle.h" | 22 #include "gpu/ipc/common/surface_handle.h" |
22 #include "ui/gl/gpu_preference.h" | 23 #include "ui/gl/gpu_preference.h" |
23 #include "url/gurl.h" | 24 #include "url/gurl.h" |
24 | 25 |
25 namespace gpu { | 26 namespace gpu { |
26 class CommandBufferProxyImpl; | 27 class CommandBufferProxyImpl; |
27 class GpuChannelHost; | 28 class GpuChannelHost; |
28 class TransferBuffer; | 29 class TransferBuffer; |
29 namespace gles2 { | 30 namespace gles2 { |
30 class GLES2CmdHelper; | 31 class GLES2CmdHelper; |
31 class GLES2Implementation; | 32 class GLES2Implementation; |
32 class GLES2TraceImplementation; | 33 class GLES2TraceImplementation; |
33 } | 34 } |
34 } | 35 } |
35 | 36 |
36 namespace skia_bindings { | 37 namespace skia_bindings { |
37 class GrContextForGLES2Interface; | 38 class GrContextForGLES2Interface; |
38 } | 39 } |
39 | 40 |
40 namespace content { | 41 namespace content { |
41 class WebGraphicsContext3DCommandBufferImpl; | 42 class WebGraphicsContext3DCommandBufferImpl; |
42 | 43 |
43 // Implementation of cc::ContextProvider that provides a GL implementation over | 44 // Implementation of cc::ContextProvider that provides a GL implementation over |
44 // command buffer to the GPU process. | 45 // command buffer to the GPU process. |
45 class CONTENT_EXPORT ContextProviderCommandBuffer | 46 class CONTENT_EXPORT ContextProviderCommandBuffer |
46 : NON_EXPORTED_BASE(public cc::ContextProvider) { | 47 : NON_EXPORTED_BASE(public cc::ContextProvider) { |
47 public: | 48 public: |
48 ContextProviderCommandBuffer( | 49 ContextProviderCommandBuffer( |
49 scoped_refptr<gpu::GpuChannelHost> channel, | 50 scoped_refptr<gpu::GpuChannelHost> channel, |
| 51 int32_t stream_id, |
| 52 gpu::GpuStreamPriority stream_priority, |
50 gpu::SurfaceHandle surface_handle, | 53 gpu::SurfaceHandle surface_handle, |
51 const GURL& active_url, | 54 const GURL& active_url, |
52 gfx::GpuPreference gpu_preference, | 55 gfx::GpuPreference gpu_preference, |
53 bool automatic_flushes, | 56 bool automatic_flushes, |
54 const gpu::SharedMemoryLimits& memory_limits, | 57 const gpu::SharedMemoryLimits& memory_limits, |
55 const gpu::gles2::ContextCreationAttribHelper& attributes, | 58 const gpu::gles2::ContextCreationAttribHelper& attributes, |
56 ContextProviderCommandBuffer* shared_context_provider, | 59 ContextProviderCommandBuffer* shared_context_provider, |
57 command_buffer_metrics::ContextType type); | 60 command_buffer_metrics::ContextType type); |
58 | 61 |
59 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); | 62 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 friend class base::RefCountedThreadSafe<SharedProviders>; | 95 friend class base::RefCountedThreadSafe<SharedProviders>; |
93 ~SharedProviders(); | 96 ~SharedProviders(); |
94 }; | 97 }; |
95 | 98 |
96 base::ThreadChecker main_thread_checker_; | 99 base::ThreadChecker main_thread_checker_; |
97 base::ThreadChecker context_thread_checker_; | 100 base::ThreadChecker context_thread_checker_; |
98 | 101 |
99 bool bind_succeeded_ = false; | 102 bool bind_succeeded_ = false; |
100 bool bind_failed_ = false; | 103 bool bind_failed_ = false; |
101 | 104 |
| 105 int32_t stream_id_; |
| 106 gpu::GpuStreamPriority stream_priority_; |
102 gpu::SurfaceHandle surface_handle_; | 107 gpu::SurfaceHandle surface_handle_; |
103 GURL active_url_; | 108 GURL active_url_; |
104 gfx::GpuPreference gpu_preference_; | 109 gfx::GpuPreference gpu_preference_; |
105 bool automatic_flushes_; | 110 bool automatic_flushes_; |
106 gpu::SharedMemoryLimits memory_limits_; | 111 gpu::SharedMemoryLimits memory_limits_; |
107 gpu::gles2::ContextCreationAttribHelper attributes_; | 112 gpu::gles2::ContextCreationAttribHelper attributes_; |
108 command_buffer_metrics::ContextType context_type_; | 113 command_buffer_metrics::ContextType context_type_; |
109 | 114 |
110 scoped_refptr<SharedProviders> shared_providers_; | 115 scoped_refptr<SharedProviders> shared_providers_; |
111 scoped_refptr<gpu::GpuChannelHost> channel_; | 116 scoped_refptr<gpu::GpuChannelHost> channel_; |
112 | 117 |
113 base::Lock context_lock_; // Referenced by command_buffer_. | 118 base::Lock context_lock_; // Referenced by command_buffer_. |
114 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; | 119 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; |
115 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 120 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
116 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; | 121 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; |
117 std::unique_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; | 122 std::unique_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; |
118 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; | 123 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; |
119 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; | 124 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
120 | 125 |
121 LostContextCallback lost_context_callback_; | 126 LostContextCallback lost_context_callback_; |
122 }; | 127 }; |
123 | 128 |
124 } // namespace content | 129 } // namespace content |
125 | 130 |
126 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 131 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
OLD | NEW |