| 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" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
| 17 #include "gpu/command_buffer/common/capabilities.h" |
| 17 #include "gpu/command_buffer/common/command_buffer.h" | 18 #include "gpu/command_buffer/common/command_buffer.h" |
| 18 #include "gpu/command_buffer/common/gpu_control.h" | 19 #include "gpu/command_buffer/common/gpu_control.h" |
| 19 #include "gpu/gpu_export.h" | 20 #include "gpu/gpu_export.h" |
| 20 #include "ui/gfx/gpu_memory_buffer.h" | 21 #include "ui/gfx/gpu_memory_buffer.h" |
| 21 #include "ui/gfx/native_widget_types.h" | 22 #include "ui/gfx/native_widget_types.h" |
| 22 #include "ui/gl/gl_surface.h" | 23 #include "ui/gl/gl_surface.h" |
| 23 #include "ui/gl/gpu_preference.h" | 24 #include "ui/gl/gpu_preference.h" |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class SequenceChecker; | 27 class SequenceChecker; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 virtual gpu::Buffer CreateTransferBuffer(size_t size, int32* id) OVERRIDE; | 92 virtual gpu::Buffer CreateTransferBuffer(size_t size, int32* id) OVERRIDE; |
| 92 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; | 93 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; |
| 93 virtual gpu::Buffer GetTransferBuffer(int32 id) OVERRIDE; | 94 virtual gpu::Buffer GetTransferBuffer(int32 id) OVERRIDE; |
| 94 virtual void SetToken(int32 token) OVERRIDE; | 95 virtual void SetToken(int32 token) OVERRIDE; |
| 95 virtual void SetParseError(gpu::error::Error error) OVERRIDE; | 96 virtual void SetParseError(gpu::error::Error error) OVERRIDE; |
| 96 virtual void SetContextLostReason( | 97 virtual void SetContextLostReason( |
| 97 gpu::error::ContextLostReason reason) OVERRIDE; | 98 gpu::error::ContextLostReason reason) OVERRIDE; |
| 98 virtual gpu::error::Error GetLastError() OVERRIDE; | 99 virtual gpu::error::Error GetLastError() OVERRIDE; |
| 99 | 100 |
| 100 // GpuControl implementation: | 101 // GpuControl implementation: |
| 101 virtual gpu::Capabilities GetCapabilities() OVERRIDE; | |
| 102 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( | 102 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( |
| 103 size_t width, | 103 size_t width, |
| 104 size_t height, | 104 size_t height, |
| 105 unsigned internalformat, | 105 unsigned internalformat, |
| 106 int32* id) OVERRIDE; | 106 int32* id) OVERRIDE; |
| 107 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; | 107 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; |
| 108 virtual uint32 InsertSyncPoint() OVERRIDE; | 108 virtual uint32 InsertSyncPoint() OVERRIDE; |
| 109 virtual void SignalSyncPoint(uint32 sync_point, | 109 virtual void SignalSyncPoint(uint32 sync_point, |
| 110 const base::Closure& callback) OVERRIDE; | 110 const base::Closure& callback) OVERRIDE; |
| 111 virtual void SignalQuery(uint32 query, | 111 virtual void SignalQuery(uint32 query, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 133 virtual void ScheduleIdleWork(const base::Closure& task) = 0; | 133 virtual void ScheduleIdleWork(const base::Closure& task) = 0; |
| 134 | 134 |
| 135 virtual bool UseVirtualizedGLContexts() = 0; | 135 virtual bool UseVirtualizedGLContexts() = 0; |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 #if defined(OS_ANDROID) | 138 #if defined(OS_ANDROID) |
| 139 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( | 139 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( |
| 140 uint32 stream_id); | 140 uint32 stream_id); |
| 141 #endif | 141 #endif |
| 142 | 142 |
| 143 const gpu::Capabilities& capabilities() const { return capabilities_; } |
| 144 |
| 143 private: | 145 private: |
| 144 struct InitializeOnGpuThreadParams { | 146 struct InitializeOnGpuThreadParams { |
| 145 bool is_offscreen; | 147 bool is_offscreen; |
| 146 gfx::AcceleratedWidget window; | 148 gfx::AcceleratedWidget window; |
| 147 const gfx::Size& size; | 149 const gfx::Size& size; |
| 148 const std::vector<int32>& attribs; | 150 const std::vector<int32>& attribs; |
| 149 gfx::GpuPreference gpu_preference; | 151 gfx::GpuPreference gpu_preference; |
| 150 gpu::Capabilities* capabilities; // Ouptut. | 152 gpu::Capabilities* capabilities; // Ouptut. |
| 151 InProcessCommandBuffer* context_group; | 153 InProcessCommandBuffer* context_group; |
| 152 | 154 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 225 |
| 224 base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_; | 226 base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_; |
| 225 base::WeakPtrFactory<InProcessCommandBuffer> gpu_thread_weak_ptr_factory_; | 227 base::WeakPtrFactory<InProcessCommandBuffer> gpu_thread_weak_ptr_factory_; |
| 226 | 228 |
| 227 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); | 229 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); |
| 228 }; | 230 }; |
| 229 | 231 |
| 230 } // namespace gpu | 232 } // namespace gpu |
| 231 | 233 |
| 232 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 234 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
| OLD | NEW |