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/in_process_command_buffer.h" | 5 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 | 696 |
697 gles2::QueryManager::Query* query = query_manager_->GetQuery(query_id); | 697 gles2::QueryManager::Query* query = query_manager_->GetQuery(query_id); |
698 if (!query) | 698 if (!query) |
699 callback.Run(); | 699 callback.Run(); |
700 else | 700 else |
701 query->AddCallback(callback); | 701 query->AddCallback(callback); |
702 } | 702 } |
703 | 703 |
704 void InProcessCommandBuffer::SetSurfaceVisible(bool visible) {} | 704 void InProcessCommandBuffer::SetSurfaceVisible(bool visible) {} |
705 | 705 |
706 void InProcessCommandBuffer::Echo(const base::Closure& callback) { | |
707 QueueTask(WrapCallback(callback)); | |
708 } | |
709 | |
710 uint32 InProcessCommandBuffer::CreateStreamTexture(uint32 texture_id) { | 706 uint32 InProcessCommandBuffer::CreateStreamTexture(uint32 texture_id) { |
711 base::WaitableEvent completion(true, false); | 707 base::WaitableEvent completion(true, false); |
712 uint32 stream_id = 0; | 708 uint32 stream_id = 0; |
713 base::Callback<uint32(void)> task = | 709 base::Callback<uint32(void)> task = |
714 base::Bind(&InProcessCommandBuffer::CreateStreamTextureOnGpuThread, | 710 base::Bind(&InProcessCommandBuffer::CreateStreamTextureOnGpuThread, |
715 base::Unretained(this), | 711 base::Unretained(this), |
716 texture_id); | 712 texture_id); |
717 QueueTask( | 713 QueueTask( |
718 base::Bind(&RunTaskWithResult<uint32>, task, &stream_id, &completion)); | 714 base::Bind(&RunTaskWithResult<uint32>, task, &stream_id, &completion)); |
719 completion.Wait(); | 715 completion.Wait(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 | 769 |
774 #if defined(OS_ANDROID) | 770 #if defined(OS_ANDROID) |
775 scoped_refptr<gfx::SurfaceTexture> | 771 scoped_refptr<gfx::SurfaceTexture> |
776 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { | 772 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { |
777 DCHECK(stream_texture_manager_); | 773 DCHECK(stream_texture_manager_); |
778 return stream_texture_manager_->GetSurfaceTexture(stream_id); | 774 return stream_texture_manager_->GetSurfaceTexture(stream_id); |
779 } | 775 } |
780 #endif | 776 #endif |
781 | 777 |
782 } // namespace gpu | 778 } // namespace gpu |
OLD | NEW |