| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 bool Initialize(scoped_refptr<gfx::GLSurface> surface, | 80 bool Initialize(scoped_refptr<gfx::GLSurface> surface, |
| 81 bool is_offscreen, | 81 bool is_offscreen, |
| 82 bool share_resources, | 82 bool share_resources, |
| 83 gfx::AcceleratedWidget window, | 83 gfx::AcceleratedWidget window, |
| 84 const gfx::Size& size, | 84 const gfx::Size& size, |
| 85 const std::vector<int32>& attribs, | 85 const std::vector<int32>& attribs, |
| 86 gfx::GpuPreference gpu_preference, | 86 gfx::GpuPreference gpu_preference, |
| 87 const base::Closure& context_lost_callback, | 87 const base::Closure& context_lost_callback, |
| 88 unsigned int share_group_id); | 88 unsigned int share_group_id); |
| 89 void Destroy(); | 89 void Destroy(); |
| 90 void SignalSyncPoint(unsigned sync_point, | |
| 91 const base::Closure& callback); | |
| 92 | 90 |
| 93 // CommandBuffer implementation: | 91 // CommandBuffer implementation: |
| 94 virtual bool Initialize() OVERRIDE; | 92 virtual bool Initialize() OVERRIDE; |
| 95 virtual State GetState() OVERRIDE; | 93 virtual State GetState() OVERRIDE; |
| 96 virtual State GetLastState() OVERRIDE; | 94 virtual State GetLastState() OVERRIDE; |
| 97 virtual int32 GetLastToken() OVERRIDE; | 95 virtual int32 GetLastToken() OVERRIDE; |
| 98 virtual void Flush(int32 put_offset) OVERRIDE; | 96 virtual void Flush(int32 put_offset) OVERRIDE; |
| 99 virtual State FlushSync(int32 put_offset, int32 last_known_get) OVERRIDE; | 97 virtual State FlushSync(int32 put_offset, int32 last_known_get) OVERRIDE; |
| 100 virtual void SetGetBuffer(int32 shm_id) OVERRIDE; | 98 virtual void SetGetBuffer(int32 shm_id) OVERRIDE; |
| 101 virtual void SetGetOffset(int32 get_offset) OVERRIDE; | 99 virtual void SetGetOffset(int32 get_offset) OVERRIDE; |
| 102 virtual gpu::Buffer CreateTransferBuffer(size_t size, int32* id) OVERRIDE; | 100 virtual gpu::Buffer CreateTransferBuffer(size_t size, int32* id) OVERRIDE; |
| 103 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; | 101 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; |
| 104 virtual gpu::Buffer GetTransferBuffer(int32 id) OVERRIDE; | 102 virtual gpu::Buffer GetTransferBuffer(int32 id) OVERRIDE; |
| 105 virtual void SetToken(int32 token) OVERRIDE; | 103 virtual void SetToken(int32 token) OVERRIDE; |
| 106 virtual void SetParseError(gpu::error::Error error) OVERRIDE; | 104 virtual void SetParseError(gpu::error::Error error) OVERRIDE; |
| 107 virtual void SetContextLostReason( | 105 virtual void SetContextLostReason( |
| 108 gpu::error::ContextLostReason reason) OVERRIDE; | 106 gpu::error::ContextLostReason reason) OVERRIDE; |
| 109 virtual uint32 InsertSyncPoint() OVERRIDE; | |
| 110 virtual gpu::error::Error GetLastError() OVERRIDE; | 107 virtual gpu::error::Error GetLastError() OVERRIDE; |
| 111 | 108 |
| 112 // GpuControl implementation: | 109 // GpuControl implementation: |
| 113 virtual bool SupportsGpuMemoryBuffer() OVERRIDE; | 110 virtual bool SupportsGpuMemoryBuffer() OVERRIDE; |
| 114 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( | 111 virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer( |
| 115 size_t width, | 112 size_t width, |
| 116 size_t height, | 113 size_t height, |
| 117 unsigned internalformat, | 114 unsigned internalformat, |
| 118 int32* id) OVERRIDE; | 115 int32* id) OVERRIDE; |
| 119 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; | 116 virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE; |
| 120 virtual bool GenerateMailboxNames(unsigned num, | 117 virtual bool GenerateMailboxNames(unsigned num, |
| 121 std::vector<gpu::Mailbox>* names) OVERRIDE; | 118 std::vector<gpu::Mailbox>* names) OVERRIDE; |
| 119 virtual uint32 InsertSyncPoint() OVERRIDE; |
| 120 virtual void SignalSyncPoint(uint32 sync_point, |
| 121 const base::Closure& callback) OVERRIDE; |
| 122 | 122 |
| 123 // The serializer interface to the GPU service (i.e. thread). | 123 // The serializer interface to the GPU service (i.e. thread). |
| 124 class SchedulerClient { | 124 class SchedulerClient { |
| 125 public: | 125 public: |
| 126 virtual ~SchedulerClient() {} | 126 virtual ~SchedulerClient() {} |
| 127 virtual void QueueTask(const base::Closure& task) = 0; | 127 virtual void QueueTask(const base::Closure& task) = 0; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 #if defined(OS_ANDROID) | 130 #if defined(OS_ANDROID) |
| 131 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( | 131 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // Only used with explicit scheduling and the gpu thread is the same as | 186 // Only used with explicit scheduling and the gpu thread is the same as |
| 187 // the client thread. | 187 // the client thread. |
| 188 scoped_ptr<base::SequenceChecker> sequence_checker_; | 188 scoped_ptr<base::SequenceChecker> sequence_checker_; |
| 189 | 189 |
| 190 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); | 190 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); |
| 191 }; | 191 }; |
| 192 | 192 |
| 193 } // namespace gpu | 193 } // namespace gpu |
| 194 | 194 |
| 195 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 195 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
| OLD | NEW |