Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: gpu/command_buffer/service/in_process_command_buffer.cc

Issue 556323004: Call MakeCurrent in in-process idle work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698