OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 class SequenceChecker; | 24 class SequenceChecker; |
25 } | 25 } |
26 | 26 |
27 namespace gfx { | 27 namespace gfx { |
28 class GLContext; | 28 class GLContext; |
29 class GLImage; | 29 class GLImage; |
30 class GLSurface; | 30 class GLSurface; |
31 class Size; | 31 class Size; |
32 } | 32 } |
33 | 33 |
| 34 #if defined(OS_ANDROID) |
| 35 namespace gfx { |
| 36 class SurfaceTextureBridge; |
| 37 } |
| 38 namespace gpu { |
| 39 class StreamTextureManagerInProcess; |
| 40 } |
| 41 #endif |
| 42 |
34 namespace gpu { | 43 namespace gpu { |
35 | 44 |
36 namespace gles2 { | 45 namespace gles2 { |
37 class GLES2Decoder; | 46 class GLES2Decoder; |
38 } | 47 } |
39 | 48 |
40 class GpuScheduler; | 49 class GpuScheduler; |
41 class TransferBufferManagerInterface; | 50 class TransferBufferManagerInterface; |
42 | 51 |
43 // This class provides a thread-safe interface to the global GPU service (for | 52 // This class provides a thread-safe interface to the global GPU service (for |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 virtual uint32 InsertSyncPoint() OVERRIDE; | 111 virtual uint32 InsertSyncPoint() OVERRIDE; |
103 virtual gpu::error::Error GetLastError() OVERRIDE; | 112 virtual gpu::error::Error GetLastError() OVERRIDE; |
104 | 113 |
105 // The serializer interface to the GPU service (i.e. thread). | 114 // The serializer interface to the GPU service (i.e. thread). |
106 class SchedulerClient { | 115 class SchedulerClient { |
107 public: | 116 public: |
108 virtual ~SchedulerClient() {} | 117 virtual ~SchedulerClient() {} |
109 virtual void QueueTask(const base::Closure& task) = 0; | 118 virtual void QueueTask(const base::Closure& task) = 0; |
110 }; | 119 }; |
111 | 120 |
| 121 #if defined(OS_ANDROID) |
| 122 scoped_refptr<gfx::SurfaceTextureBridge> GetSurfaceTexture( |
| 123 uint32 stream_id); |
| 124 #endif |
| 125 |
112 private: | 126 private: |
113 bool InitializeOnGpuThread(bool is_offscreen, | 127 bool InitializeOnGpuThread(bool is_offscreen, |
114 gfx::AcceleratedWidget window, | 128 gfx::AcceleratedWidget window, |
115 const gfx::Size& size, | 129 const gfx::Size& size, |
116 const char* allowed_extensions, | 130 const char* allowed_extensions, |
117 const std::vector<int32>& attribs, | 131 const std::vector<int32>& attribs, |
118 gfx::GpuPreference gpu_preference); | 132 gfx::GpuPreference gpu_preference); |
119 bool DestroyOnGpuThread(); | 133 bool DestroyOnGpuThread(); |
120 void FlushOnGpuThread(int32 put_offset); | 134 void FlushOnGpuThread(int32 put_offset); |
121 void CreateImageOnGpuThread(gfx::GpuMemoryBufferHandle buffer, | 135 void CreateImageOnGpuThread(gfx::GpuMemoryBufferHandle buffer, |
(...skipping 30 matching lines...) Expand all Loading... |
152 int32 last_put_offset_; | 166 int32 last_put_offset_; |
153 | 167 |
154 // Accessed on both threads: | 168 // Accessed on both threads: |
155 scoped_ptr<CommandBuffer> command_buffer_; | 169 scoped_ptr<CommandBuffer> command_buffer_; |
156 base::Lock command_buffer_lock_; | 170 base::Lock command_buffer_lock_; |
157 base::WaitableEvent flush_event_; | 171 base::WaitableEvent flush_event_; |
158 scoped_ptr<SchedulerClient> queue_; | 172 scoped_ptr<SchedulerClient> queue_; |
159 State state_after_last_flush_; | 173 State state_after_last_flush_; |
160 base::Lock state_after_last_flush_lock_; | 174 base::Lock state_after_last_flush_lock_; |
161 | 175 |
| 176 #if defined(OS_ANDROID) |
| 177 scoped_refptr<StreamTextureManagerInProcess> stream_texture_manager_; |
| 178 #endif |
| 179 |
162 // Only used with explicit scheduling and the gpu thread is the same as | 180 // Only used with explicit scheduling and the gpu thread is the same as |
163 // the client thread. | 181 // the client thread. |
164 scoped_ptr<base::SequenceChecker> sequence_checker_; | 182 scoped_ptr<base::SequenceChecker> sequence_checker_; |
165 | 183 |
166 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); | 184 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); |
167 }; | 185 }; |
168 | 186 |
169 } // namespace gpu | 187 } // namespace gpu |
170 | 188 |
171 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 189 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
OLD | NEW |