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

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

Issue 407683002: Add missing lock in RetireSyncPointOnGpuThread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 691
692 void InProcessCommandBuffer::RetireSyncPoint(uint32 sync_point) { 692 void InProcessCommandBuffer::RetireSyncPoint(uint32 sync_point) {
693 QueueTask(base::Bind(&InProcessCommandBuffer::RetireSyncPointOnGpuThread, 693 QueueTask(base::Bind(&InProcessCommandBuffer::RetireSyncPointOnGpuThread,
694 base::Unretained(this), 694 base::Unretained(this),
695 sync_point)); 695 sync_point));
696 } 696 }
697 697
698 void InProcessCommandBuffer::RetireSyncPointOnGpuThread(uint32 sync_point) { 698 void InProcessCommandBuffer::RetireSyncPointOnGpuThread(uint32 sync_point) {
699 gles2::MailboxManager* mailbox_manager = 699 gles2::MailboxManager* mailbox_manager =
700 decoder_->GetContextGroup()->mailbox_manager(); 700 decoder_->GetContextGroup()->mailbox_manager();
701 if (mailbox_manager->UsesSync() && MakeCurrent()) 701 if (mailbox_manager->UsesSync()) {
702 mailbox_manager->PushTextureUpdates(); 702 bool make_current_success = false;
703 {
704 base::AutoLock lock(command_buffer_lock_);
705 make_current_success = MakeCurrent();
706 }
707 if (make_current_success)
708 mailbox_manager->PushTextureUpdates();
709 }
703 g_sync_point_manager.Get().RetireSyncPoint(sync_point); 710 g_sync_point_manager.Get().RetireSyncPoint(sync_point);
704 } 711 }
705 712
706 void InProcessCommandBuffer::SignalSyncPoint(unsigned sync_point, 713 void InProcessCommandBuffer::SignalSyncPoint(unsigned sync_point,
707 const base::Closure& callback) { 714 const base::Closure& callback) {
708 CheckSequencedThread(); 715 CheckSequencedThread();
709 QueueTask(base::Bind(&InProcessCommandBuffer::SignalSyncPointOnGpuThread, 716 QueueTask(base::Bind(&InProcessCommandBuffer::SignalSyncPointOnGpuThread,
710 base::Unretained(this), 717 base::Unretained(this),
711 sync_point, 718 sync_point,
712 WrapCallback(callback))); 719 WrapCallback(callback)));
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 } 833 }
827 #endif 834 #endif
828 835
829 // static 836 // static
830 void InProcessCommandBuffer::SetGpuMemoryBufferFactory( 837 void InProcessCommandBuffer::SetGpuMemoryBufferFactory(
831 InProcessGpuMemoryBufferFactory* factory) { 838 InProcessGpuMemoryBufferFactory* factory) {
832 g_gpu_memory_buffer_factory = factory; 839 g_gpu_memory_buffer_factory = factory;
833 } 840 }
834 841
835 } // namespace gpu 842 } // 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