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 #include "gpu/command_buffer/service/async_pixel_transfer_manager_egl.h" | 5 #include "gpu/command_buffer/service/async_pixel_transfer_manager_egl.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 shared_state_.pending_allocations.pop_front(); | 729 shared_state_.pending_allocations.pop_front(); |
730 } | 730 } |
731 } | 731 } |
732 | 732 |
733 void AsyncPixelTransferManagerEGL::AsyncNotifyCompletion( | 733 void AsyncPixelTransferManagerEGL::AsyncNotifyCompletion( |
734 const AsyncMemoryParams& mem_params, | 734 const AsyncMemoryParams& mem_params, |
735 AsyncPixelTransferCompletionObserver* observer) { | 735 AsyncPixelTransferCompletionObserver* observer) { |
736 DCHECK(mem_params.shared_memory); | 736 DCHECK(mem_params.shared_memory); |
737 DCHECK_LE(mem_params.shm_data_offset + mem_params.shm_data_size, | 737 DCHECK_LE(mem_params.shm_data_offset + mem_params.shm_data_size, |
738 mem_params.shm_size); | 738 mem_params.shm_size); |
| 739 |
739 // Post a PerformNotifyCompletion task to the upload thread. This task | 740 // Post a PerformNotifyCompletion task to the upload thread. This task |
740 // will run after all async transfers are complete. | 741 // will run after all async transfers are complete. |
741 transfer_message_loop_proxy()->PostTask( | 742 transfer_message_loop_proxy()->PostTask( |
742 FROM_HERE, | 743 FROM_HERE, |
743 base::Bind(&PerformNotifyCompletion, | 744 base::Bind(&PerformNotifyCompletion, |
744 mem_params, | 745 mem_params, |
745 base::Owned( | 746 base::Owned( |
746 new ScopedSafeSharedMemory(safe_shared_memory_pool(), | 747 new ScopedSafeSharedMemory(safe_shared_memory_pool(), |
747 mem_params.shared_memory, | 748 mem_params.shared_memory, |
748 mem_params.shm_size)), | 749 mem_params.shm_size)), |
(...skipping 10 matching lines...) Expand all Loading... |
759 return total_texture_upload_time; | 760 return total_texture_upload_time; |
760 } | 761 } |
761 | 762 |
762 void AsyncPixelTransferManagerEGL::ProcessMorePendingTransfers() { | 763 void AsyncPixelTransferManagerEGL::ProcessMorePendingTransfers() { |
763 } | 764 } |
764 | 765 |
765 bool AsyncPixelTransferManagerEGL::NeedsProcessMorePendingTransfers() { | 766 bool AsyncPixelTransferManagerEGL::NeedsProcessMorePendingTransfers() { |
766 return false; | 767 return false; |
767 } | 768 } |
768 | 769 |
| 770 void AsyncPixelTransferManagerEGL::WaitAllAsyncTexImage2D() { |
| 771 if (shared_state_.pending_allocations.empty()) |
| 772 return; |
| 773 |
| 774 AsyncPixelTransferDelegateEGL* delegate = |
| 775 shared_state_.pending_allocations.back().get(); |
| 776 if (delegate) |
| 777 delegate->WaitForTransferCompletion(); |
| 778 } |
| 779 |
769 AsyncPixelTransferDelegate* | 780 AsyncPixelTransferDelegate* |
770 AsyncPixelTransferManagerEGL::CreatePixelTransferDelegateImpl( | 781 AsyncPixelTransferManagerEGL::CreatePixelTransferDelegateImpl( |
771 gles2::TextureRef* ref, | 782 gles2::TextureRef* ref, |
772 const AsyncTexImage2DParams& define_params) { | 783 const AsyncTexImage2DParams& define_params) { |
773 return new AsyncPixelTransferDelegateEGL( | 784 return new AsyncPixelTransferDelegateEGL( |
774 &shared_state_, ref->service_id(), define_params); | 785 &shared_state_, ref->service_id(), define_params); |
775 } | 786 } |
776 | 787 |
777 } // namespace gpu | 788 } // namespace gpu |
OLD | NEW |