| 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 namespace base { | 24 namespace base { |
| 25 class SequenceChecker; | 25 class SequenceChecker; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace gfx { | 28 namespace gfx { |
| 29 class GLContext; | 29 class GLContext; |
| 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 GpuMemoryBufferFactory; | 49 class GpuMemoryBufferFactory; |
| 41 class GpuScheduler; | 50 class GpuScheduler; |
| 42 class TransferBufferManagerInterface; | 51 class TransferBufferManagerInterface; |
| 43 | 52 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 int32* id) OVERRIDE; | 118 int32* id) OVERRIDE; |
| 110 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; | 119 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; |
| 111 | 120 |
| 112 // The serializer interface to the GPU service (i.e. thread). | 121 // The serializer interface to the GPU service (i.e. thread). |
| 113 class SchedulerClient { | 122 class SchedulerClient { |
| 114 public: | 123 public: |
| 115 virtual ~SchedulerClient() {} | 124 virtual ~SchedulerClient() {} |
| 116 virtual void QueueTask(const base::Closure& task) = 0; | 125 virtual void QueueTask(const base::Closure& task) = 0; |
| 117 }; | 126 }; |
| 118 | 127 |
| 128 #if defined(OS_ANDROID) |
| 129 scoped_refptr<gfx::SurfaceTextureBridge> GetSurfaceTexture( |
| 130 uint32 stream_id); |
| 131 #endif |
| 132 |
| 119 private: | 133 private: |
| 120 bool InitializeOnGpuThread(bool is_offscreen, | 134 bool InitializeOnGpuThread(bool is_offscreen, |
| 121 gfx::AcceleratedWidget window, | 135 gfx::AcceleratedWidget window, |
| 122 const gfx::Size& size, | 136 const gfx::Size& size, |
| 123 const char* allowed_extensions, | 137 const char* allowed_extensions, |
| 124 const std::vector<int32>& attribs, | 138 const std::vector<int32>& attribs, |
| 125 gfx::GpuPreference gpu_preference); | 139 gfx::GpuPreference gpu_preference); |
| 126 bool DestroyOnGpuThread(); | 140 bool DestroyOnGpuThread(); |
| 127 void FlushOnGpuThread(int32 put_offset); | 141 void FlushOnGpuThread(int32 put_offset); |
| 128 bool MakeCurrent(); | 142 bool MakeCurrent(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 156 | 170 |
| 157 // Accessed on both threads: | 171 // Accessed on both threads: |
| 158 scoped_ptr<CommandBuffer> command_buffer_; | 172 scoped_ptr<CommandBuffer> command_buffer_; |
| 159 base::Lock command_buffer_lock_; | 173 base::Lock command_buffer_lock_; |
| 160 base::WaitableEvent flush_event_; | 174 base::WaitableEvent flush_event_; |
| 161 scoped_ptr<SchedulerClient> queue_; | 175 scoped_ptr<SchedulerClient> queue_; |
| 162 State state_after_last_flush_; | 176 State state_after_last_flush_; |
| 163 base::Lock state_after_last_flush_lock_; | 177 base::Lock state_after_last_flush_lock_; |
| 164 scoped_ptr<GpuControl> gpu_control_; | 178 scoped_ptr<GpuControl> gpu_control_; |
| 165 | 179 |
| 180 #if defined(OS_ANDROID) |
| 181 scoped_refptr<StreamTextureManagerInProcess> stream_texture_manager_; |
| 182 #endif |
| 183 |
| 166 // Only used with explicit scheduling and the gpu thread is the same as | 184 // Only used with explicit scheduling and the gpu thread is the same as |
| 167 // the client thread. | 185 // the client thread. |
| 168 scoped_ptr<base::SequenceChecker> sequence_checker_; | 186 scoped_ptr<base::SequenceChecker> sequence_checker_; |
| 169 | 187 |
| 170 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); | 188 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); |
| 171 }; | 189 }; |
| 172 | 190 |
| 173 } // namespace gpu | 191 } // namespace gpu |
| 174 | 192 |
| 175 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 193 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
| OLD | NEW |