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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 661973003: MailboxSync: Imply fence with sync point (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 memory_manager_client_state_->SetVisible(visible); 851 memory_manager_client_state_->SetVisible(visible);
852 } 852 }
853 853
854 void GpuCommandBufferStub::AddSyncPoint(uint32 sync_point) { 854 void GpuCommandBufferStub::AddSyncPoint(uint32 sync_point) {
855 sync_points_.push_back(sync_point); 855 sync_points_.push_back(sync_point);
856 } 856 }
857 857
858 void GpuCommandBufferStub::OnRetireSyncPoint(uint32 sync_point) { 858 void GpuCommandBufferStub::OnRetireSyncPoint(uint32 sync_point) {
859 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point); 859 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point);
860 sync_points_.pop_front(); 860 sync_points_.pop_front();
861 if (context_group_->mailbox_manager()->UsesSync() && MakeCurrent())
862 context_group_->mailbox_manager()->PushTextureUpdates();
863 GpuChannelManager* manager = channel_->gpu_channel_manager(); 861 GpuChannelManager* manager = channel_->gpu_channel_manager();
864 manager->sync_point_manager()->RetireSyncPoint(sync_point); 862 manager->sync_point_manager()->RetireSyncPoint(sync_point);
865 } 863 }
866 864
867 bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) { 865 bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) {
868 if (!sync_point) 866 if (!sync_point)
869 return true; 867 return true;
870 GpuChannelManager* manager = channel_->gpu_channel_manager(); 868 GpuChannelManager* manager = channel_->gpu_channel_manager();
871 if (manager->sync_point_manager()->IsSyncPointRetired(sync_point)) 869 if (manager->sync_point_manager()->IsSyncPointRetired(sync_point))
872 return true; 870 return true;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 uint64 GpuCommandBufferStub::GetMemoryUsage() const { 1079 uint64 GpuCommandBufferStub::GetMemoryUsage() const {
1082 return GetMemoryManager()->GetClientMemoryUsage(this); 1080 return GetMemoryManager()->GetClientMemoryUsage(this);
1083 } 1081 }
1084 1082
1085 void GpuCommandBufferStub::SwapBuffersCompleted( 1083 void GpuCommandBufferStub::SwapBuffersCompleted(
1086 const std::vector<ui::LatencyInfo>& latency_info) { 1084 const std::vector<ui::LatencyInfo>& latency_info) {
1087 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, latency_info)); 1085 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, latency_info));
1088 } 1086 }
1089 1087
1090 } // namespace content 1088 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698