| 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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
| 10 #include <GLES2/gl2ext.h> | 10 #include <GLES2/gl2ext.h> |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 367 |
| 368 void GLES2Implementation::FreeSharedMemory(void* mem) { | 368 void GLES2Implementation::FreeSharedMemory(void* mem) { |
| 369 mapped_memory_->FreePendingToken(mem, helper_->InsertToken()); | 369 mapped_memory_->FreePendingToken(mem, helper_->InsertToken()); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void GLES2Implementation::RunIfContextNotLost(const base::Closure& callback) { | 372 void GLES2Implementation::RunIfContextNotLost(const base::Closure& callback) { |
| 373 if (!lost_context_callback_run_) | 373 if (!lost_context_callback_run_) |
| 374 callback.Run(); | 374 callback.Run(); |
| 375 } | 375 } |
| 376 | 376 |
| 377 void GLES2Implementation::EnsureWorkVisibleAsync() { |
| 378 gpu_control_->EnsureWorkVisibleAsync(); |
| 379 } |
| 380 |
| 377 void GLES2Implementation::SignalSyncToken(const gpu::SyncToken& sync_token, | 381 void GLES2Implementation::SignalSyncToken(const gpu::SyncToken& sync_token, |
| 378 const base::Closure& callback) { | 382 const base::Closure& callback) { |
| 379 SyncToken verified_sync_token; | 383 SyncToken verified_sync_token; |
| 380 if (sync_token.HasData() && | 384 if (sync_token.HasData() && |
| 381 GetVerifiedSyncTokenForIPC(sync_token, &verified_sync_token)) { | 385 GetVerifiedSyncTokenForIPC(sync_token, &verified_sync_token)) { |
| 382 // We can only send verified sync tokens across IPC. | 386 // We can only send verified sync tokens across IPC. |
| 383 gpu_control_->SignalSyncToken( | 387 gpu_control_->SignalSyncToken( |
| 384 verified_sync_token, | 388 verified_sync_token, |
| 385 base::Bind(&GLES2Implementation::RunIfContextNotLost, | 389 base::Bind(&GLES2Implementation::RunIfContextNotLost, |
| 386 weak_ptr_factory_.GetWeakPtr(), callback)); | 390 weak_ptr_factory_.GetWeakPtr(), callback)); |
| (...skipping 6685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7072 CheckGLError(); | 7076 CheckGLError(); |
| 7073 } | 7077 } |
| 7074 | 7078 |
| 7075 // Include the auto-generated part of this file. We split this because it means | 7079 // Include the auto-generated part of this file. We split this because it means |
| 7076 // we can easily edit the non-auto generated parts right here in this file | 7080 // we can easily edit the non-auto generated parts right here in this file |
| 7077 // instead of having to edit some template or the code generator. | 7081 // instead of having to edit some template or the code generator. |
| 7078 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 7082 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 7079 | 7083 |
| 7080 } // namespace gles2 | 7084 } // namespace gles2 |
| 7081 } // namespace gpu | 7085 } // namespace gpu |
| OLD | NEW |