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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 if (put_offset == state_after_last_flush_.get_offset && | 515 if (put_offset == state_after_last_flush_.get_offset && |
516 gpu_scheduler_->HasMoreWork()) { | 516 gpu_scheduler_->HasMoreWork()) { |
517 ScheduleIdleWorkOnGpuThread(); | 517 ScheduleIdleWorkOnGpuThread(); |
518 } | 518 } |
519 } | 519 } |
520 | 520 |
521 void InProcessCommandBuffer::PerformIdleWork() { | 521 void InProcessCommandBuffer::PerformIdleWork() { |
522 CheckSequencedThread(); | 522 CheckSequencedThread(); |
523 idle_work_pending_ = false; | 523 idle_work_pending_ = false; |
524 base::AutoLock lock(command_buffer_lock_); | 524 base::AutoLock lock(command_buffer_lock_); |
525 if (gpu_scheduler_->HasMoreWork()) { | 525 if (MakeCurrent() && gpu_scheduler_->HasMoreWork()) { |
526 gpu_scheduler_->PerformIdleWork(); | 526 gpu_scheduler_->PerformIdleWork(); |
527 ScheduleIdleWorkOnGpuThread(); | 527 ScheduleIdleWorkOnGpuThread(); |
528 } | 528 } |
529 } | 529 } |
530 | 530 |
531 void InProcessCommandBuffer::ScheduleIdleWorkOnGpuThread() { | 531 void InProcessCommandBuffer::ScheduleIdleWorkOnGpuThread() { |
532 CheckSequencedThread(); | 532 CheckSequencedThread(); |
533 if (idle_work_pending_) | 533 if (idle_work_pending_) |
534 return; | 534 return; |
535 idle_work_pending_ = true; | 535 idle_work_pending_ = true; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 } | 849 } |
850 #endif | 850 #endif |
851 | 851 |
852 // static | 852 // static |
853 void InProcessCommandBuffer::SetGpuMemoryBufferFactory( | 853 void InProcessCommandBuffer::SetGpuMemoryBufferFactory( |
854 InProcessGpuMemoryBufferFactory* factory) { | 854 InProcessGpuMemoryBufferFactory* factory) { |
855 g_gpu_memory_buffer_factory = factory; | 855 g_gpu_memory_buffer_factory = factory; |
856 } | 856 } |
857 | 857 |
858 } // namespace gpu | 858 } // namespace gpu |
OLD | NEW |