| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TESTS_GL_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void DestroyImage(int32_t id) override; | 125 void DestroyImage(int32_t id) override; |
| 126 int32_t CreateGpuMemoryBufferImage(size_t width, | 126 int32_t CreateGpuMemoryBufferImage(size_t width, |
| 127 size_t height, | 127 size_t height, |
| 128 unsigned internalformat, | 128 unsigned internalformat, |
| 129 unsigned usage) override; | 129 unsigned usage) override; |
| 130 void SignalQuery(uint32_t query, const base::Closure& callback) override; | 130 void SignalQuery(uint32_t query, const base::Closure& callback) override; |
| 131 void SetLock(base::Lock*) override; | 131 void SetLock(base::Lock*) override; |
| 132 bool IsGpuChannelLost() override; | 132 bool IsGpuChannelLost() override; |
| 133 void EnsureWorkVisible() override; | 133 void EnsureWorkVisible() override; |
| 134 gpu::CommandBufferNamespace GetNamespaceID() const override; | 134 gpu::CommandBufferNamespace GetNamespaceID() const override; |
| 135 uint64_t GetCommandBufferID() const override; | 135 CommandBufferId GetCommandBufferID() const override; |
| 136 int32_t GetExtraCommandBufferData() const override; | 136 int32_t GetExtraCommandBufferData() const override; |
| 137 uint64_t GenerateFenceSyncRelease() override; | 137 uint64_t GenerateFenceSyncRelease() override; |
| 138 bool IsFenceSyncRelease(uint64_t release) override; | 138 bool IsFenceSyncRelease(uint64_t release) override; |
| 139 bool IsFenceSyncFlushed(uint64_t release) override; | 139 bool IsFenceSyncFlushed(uint64_t release) override; |
| 140 bool IsFenceSyncFlushReceived(uint64_t release) override; | 140 bool IsFenceSyncFlushReceived(uint64_t release) override; |
| 141 void SignalSyncToken(const gpu::SyncToken& sync_token, | 141 void SignalSyncToken(const gpu::SyncToken& sync_token, |
| 142 const base::Closure& callback) override; | 142 const base::Closure& callback) override; |
| 143 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; | 143 bool CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) override; |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 void PumpCommands(); | 146 void PumpCommands(); |
| 147 bool GetBufferChanged(int32_t transfer_buffer_id); | 147 bool GetBufferChanged(int32_t transfer_buffer_id); |
| 148 void SetupBaseContext(); | 148 void SetupBaseContext(); |
| 149 void OnFenceSyncRelease(uint64_t release); | 149 void OnFenceSyncRelease(uint64_t release); |
| 150 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id, | 150 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id, |
| 151 uint64_t command_buffer_id, | 151 gpu::CommandBufferId command_buffer_id, |
| 152 uint64_t release); | 152 uint64_t release); |
| 153 | 153 |
| 154 SyncPointManager* sync_point_manager_; // Non-owning. | 154 SyncPointManager* sync_point_manager_; // Non-owning. |
| 155 | 155 |
| 156 scoped_refptr<SyncPointOrderData> sync_point_order_data_; | 156 scoped_refptr<SyncPointOrderData> sync_point_order_data_; |
| 157 scoped_ptr<SyncPointClient> sync_point_client_; | 157 scoped_ptr<SyncPointClient> sync_point_client_; |
| 158 scoped_refptr<gles2::MailboxManager> mailbox_manager_; | 158 scoped_refptr<gles2::MailboxManager> mailbox_manager_; |
| 159 scoped_refptr<gfx::GLShareGroup> share_group_; | 159 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 160 scoped_ptr<CommandBufferService> command_buffer_; | 160 scoped_ptr<CommandBufferService> command_buffer_; |
| 161 scoped_ptr<gles2::GLES2Decoder> decoder_; | 161 scoped_ptr<gles2::GLES2Decoder> decoder_; |
| 162 scoped_ptr<GpuScheduler> gpu_scheduler_; | 162 scoped_ptr<GpuScheduler> gpu_scheduler_; |
| 163 scoped_refptr<gfx::GLSurface> surface_; | 163 scoped_refptr<gfx::GLSurface> surface_; |
| 164 scoped_refptr<gfx::GLContext> context_; | 164 scoped_refptr<gfx::GLContext> context_; |
| 165 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; | 165 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; |
| 166 scoped_ptr<TransferBuffer> transfer_buffer_; | 166 scoped_ptr<TransferBuffer> transfer_buffer_; |
| 167 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; | 167 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; |
| 168 bool context_lost_allowed_; | 168 bool context_lost_allowed_; |
| 169 bool pause_commands_; | 169 bool pause_commands_; |
| 170 uint32_t paused_order_num_; | 170 uint32_t paused_order_num_; |
| 171 | 171 |
| 172 const uint64_t command_buffer_id_; | 172 const CommandBufferId command_buffer_id_; |
| 173 uint64_t next_fence_sync_release_; | 173 uint64_t next_fence_sync_release_; |
| 174 | 174 |
| 175 // Used on Android to virtualize GL for all contexts. | 175 // Used on Android to virtualize GL for all contexts. |
| 176 static int use_count_; | 176 static int use_count_; |
| 177 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; | 177 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; |
| 178 static scoped_refptr<gfx::GLSurface>* base_surface_; | 178 static scoped_refptr<gfx::GLSurface>* base_surface_; |
| 179 static scoped_refptr<gfx::GLContext>* base_context_; | 179 static scoped_refptr<gfx::GLContext>* base_context_; |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 } // namespace gpu | 182 } // namespace gpu |
| 183 | 183 |
| 184 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ | 184 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ |
| OLD | NEW |