| 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 #include "gpu/command_buffer/tests/gl_manager.h" | 5 #include "gpu/command_buffer/tests/gl_manager.h" |
| 6 | 6 |
| 7 #include <GLES2/gl2.h> | 7 #include <GLES2/gl2.h> |
| 8 #include <GLES2/gl2ext.h> | 8 #include <GLES2/gl2ext.h> |
| 9 #include <GLES2/gl2extchromium.h> | 9 #include <GLES2/gl2extchromium.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 } | 626 } |
| 627 | 627 |
| 628 bool GLManager::IsFenceSyncFlushed(uint64_t release) { | 628 bool GLManager::IsFenceSyncFlushed(uint64_t release) { |
| 629 return IsFenceSyncRelease(release); | 629 return IsFenceSyncRelease(release); |
| 630 } | 630 } |
| 631 | 631 |
| 632 bool GLManager::IsFenceSyncFlushReceived(uint64_t release) { | 632 bool GLManager::IsFenceSyncFlushReceived(uint64_t release) { |
| 633 return IsFenceSyncRelease(release); | 633 return IsFenceSyncRelease(release); |
| 634 } | 634 } |
| 635 | 635 |
| 636 bool GLManager::IsFenceSyncReleased(uint64_t release) { |
| 637 return release <= command_buffer_->GetLastState().release_count; |
| 638 } |
| 639 |
| 636 void GLManager::SignalSyncToken(const gpu::SyncToken& sync_token, | 640 void GLManager::SignalSyncToken(const gpu::SyncToken& sync_token, |
| 637 const base::Closure& callback) { | 641 const base::Closure& callback) { |
| 638 if (sync_point_manager_) { | 642 if (sync_point_manager_) { |
| 639 scoped_refptr<gpu::SyncPointClientState> release_state = | 643 scoped_refptr<gpu::SyncPointClientState> release_state = |
| 640 sync_point_manager_->GetSyncPointClientState( | 644 sync_point_manager_->GetSyncPointClientState( |
| 641 sync_token.namespace_id(), sync_token.command_buffer_id()); | 645 sync_token.namespace_id(), sync_token.command_buffer_id()); |
| 642 | 646 |
| 643 if (release_state) { | 647 if (release_state) { |
| 644 sync_point_client_->WaitOutOfOrder(release_state.get(), | 648 sync_point_client_->WaitOutOfOrder(release_state.get(), |
| 645 sync_token.release_count(), callback); | 649 sync_token.release_count(), callback); |
| 646 return; | 650 return; |
| 647 } | 651 } |
| 648 } | 652 } |
| 649 | 653 |
| 650 // Something went wrong, just run the callback now. | 654 // Something went wrong, just run the callback now. |
| 651 callback.Run(); | 655 callback.Run(); |
| 652 } | 656 } |
| 653 | 657 |
| 654 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { | 658 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { |
| 655 return false; | 659 return false; |
| 656 } | 660 } |
| 657 | 661 |
| 658 } // namespace gpu | 662 } // namespace gpu |
| OLD | NEW |