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

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: comments 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 memory_manager_client_state_->SetVisible(visible); 764 memory_manager_client_state_->SetVisible(visible);
764 } 765 }
765 766
766 void GpuCommandBufferStub::AddSyncPoint(uint32 sync_point) { 767 void GpuCommandBufferStub::AddSyncPoint(uint32 sync_point) {
767 sync_points_.push_back(sync_point); 768 sync_points_.push_back(sync_point);
768 } 769 }
769 770
770 void GpuCommandBufferStub::OnRetireSyncPoint(uint32 sync_point) { 771 void GpuCommandBufferStub::OnRetireSyncPoint(uint32 sync_point) {
771 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point); 772 DCHECK(!sync_points_.empty() && sync_points_.front() == sync_point);
772 sync_points_.pop_front(); 773 sync_points_.pop_front();
774 if (context_group_->mailbox_manager()->UsesSync() && MakeCurrent())
775 context_group_->mailbox_manager()->PushTextureUpdates();
773 GpuChannelManager* manager = channel_->gpu_channel_manager(); 776 GpuChannelManager* manager = channel_->gpu_channel_manager();
774 manager->sync_point_manager()->RetireSyncPoint(sync_point); 777 manager->sync_point_manager()->RetireSyncPoint(sync_point);
775 } 778 }
776 779
777 bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) { 780 bool GpuCommandBufferStub::OnWaitSyncPoint(uint32 sync_point) {
778 if (!sync_point) 781 if (!sync_point)
779 return true; 782 return true;
780 GpuChannelManager* manager = channel_->gpu_channel_manager(); 783 GpuChannelManager* manager = channel_->gpu_channel_manager();
781 if (manager->sync_point_manager()->IsSyncPointRetired(sync_point)) 784 if (manager->sync_point_manager()->IsSyncPointRetired(sync_point))
782 return true; 785 return true;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 if (decoder_) 976 if (decoder_)
974 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); 977 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB);
975 command_buffer_->SetParseError(gpu::error::kLostContext); 978 command_buffer_->SetParseError(gpu::error::kLostContext);
976 } 979 }
977 980
978 uint64 GpuCommandBufferStub::GetMemoryUsage() const { 981 uint64 GpuCommandBufferStub::GetMemoryUsage() const {
979 return GetMemoryManager()->GetClientMemoryUsage(this); 982 return GetMemoryManager()->GetClientMemoryUsage(this);
980 } 983 }
981 984
982 } // namespace content 985 } // namespace content
OLDNEW
« no previous file with comments | « android_webview/lib/main/aw_main_delegate.cc ('k') | gpu/command_buffer/service/framebuffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698