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

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

Issue 180723023: gpu: Mailbox emulation with EGLImage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops Created 6 years, 9 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
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/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 12 matching lines...) Expand all
23 #include "content/common/gpu/sync_point_manager.h" 23 #include "content/common/gpu/sync_point_manager.h"
24 #include "content/public/common/content_client.h" 24 #include "content/public/common/content_client.h"
25 #include "gpu/command_buffer/common/constants.h" 25 #include "gpu/command_buffer/common/constants.h"
26 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 26 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
27 #include "gpu/command_buffer/common/mailbox.h" 27 #include "gpu/command_buffer/common/mailbox.h"
28 #include "gpu/command_buffer/service/gl_context_virtual.h" 28 #include "gpu/command_buffer/service/gl_context_virtual.h"
29 #include "gpu/command_buffer/service/gl_state_restorer_impl.h" 29 #include "gpu/command_buffer/service/gl_state_restorer_impl.h"
30 #include "gpu/command_buffer/service/gpu_control_service.h" 30 #include "gpu/command_buffer/service/gpu_control_service.h"
31 #include "gpu/command_buffer/service/image_manager.h" 31 #include "gpu/command_buffer/service/image_manager.h"
32 #include "gpu/command_buffer/service/logger.h" 32 #include "gpu/command_buffer/service/logger.h"
33 #include "gpu/command_buffer/service/mailbox_manager.h"
33 #include "gpu/command_buffer/service/memory_tracking.h" 34 #include "gpu/command_buffer/service/memory_tracking.h"
34 #include "gpu/command_buffer/service/query_manager.h" 35 #include "gpu/command_buffer/service/query_manager.h"
35 #include "ui/gl/gl_bindings.h" 36 #include "ui/gl/gl_bindings.h"
36 #include "ui/gl/gl_switches.h" 37 #include "ui/gl/gl_switches.h"
37 38
38 #if defined(OS_WIN) 39 #if defined(OS_WIN)
39 #include "content/public/common/sandbox_init.h" 40 #include "content/public/common/sandbox_init.h"
40 #endif 41 #endif
41 42
42 #if defined(OS_ANDROID) 43 #if defined(OS_ANDROID)
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 memory_manager_client_state_->SetVisible(visible); 767 memory_manager_client_state_->SetVisible(visible);
767 } 768 }
768 769
769 void GpuCommandBufferStub::AddSyncPoint(uint32 sync_point) { 770 void GpuCommandBufferStub::AddSyncPoint(uint32 sync_point) {
770 sync_points_.push_back(sync_point); 771 sync_points_.push_back(sync_point);
771 } 772 }
772 773
773 void GpuCommandBufferStub::OnRetireSyncPoint(uint32 sync_point) { 774 void GpuCommandBufferStub::OnRetireSyncPoint(uint32 sync_point) {
774 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point); 775 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point);
775 sync_points_.pop_front(); 776 sync_points_.pop_front();
777 if (context_group_->mailbox_manager()->UsesSync() && MakeCurrent())
778 context_group_->mailbox_manager()->PushTextureUpdates();
776 GpuChannelManager* manager = channel_->gpu_channel_manager(); 779 GpuChannelManager* manager = channel_->gpu_channel_manager();
777 manager->sync_point_manager()->RetireSyncPoint(sync_point); 780 manager->sync_point_manager()->RetireSyncPoint(sync_point);
778 } 781 }
779 782
780 bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) { 783 bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) {
781 GpuChannelManager* manager = channel_->gpu_channel_manager(); 784 GpuChannelManager* manager = channel_->gpu_channel_manager();
782 if (manager->sync_point_manager()->IsSyncPointRetired(sync_point)) 785 if (manager->sync_point_manager()->IsSyncPointRetired(sync_point))
783 return true; 786 return true;
784 787
785 if (sync_point_wait_count_ == 0) { 788 if (sync_point_wait_count_ == 0) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 if (decoder_) 977 if (decoder_)
975 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); 978 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB);
976 command_buffer_->SetParseError(gpu::error::kLostContext); 979 command_buffer_->SetParseError(gpu::error::kLostContext);
977 } 980 }
978 981
979 uint64 GpuCommandBufferStub::GetMemoryUsage() const { 982 uint64 GpuCommandBufferStub::GetMemoryUsage() const {
980 return GetMemoryManager()->GetClientMemoryUsage(this); 983 return GetMemoryManager()->GetClientMemoryUsage(this);
981 } 984 }
982 985
983 } // namespace content 986 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698