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

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

Issue 1711533002: Decouple browser-specific GPU IPC messages from GPU service IPCs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restored if guards on GpuChannelManager Created 4 years, 10 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 "content/common/gpu/gpu_channel.h" 5 #include "content/common/gpu/gpu_channel.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 13 matching lines...) Expand all
24 #include "base/stl_util.h" 24 #include "base/stl_util.h"
25 #include "base/strings/string_util.h" 25 #include "base/strings/string_util.h"
26 #include "base/synchronization/lock.h" 26 #include "base/synchronization/lock.h"
27 #include "base/thread_task_runner_handle.h" 27 #include "base/thread_task_runner_handle.h"
28 #include "base/timer/timer.h" 28 #include "base/timer/timer.h"
29 #include "base/trace_event/memory_dump_manager.h" 29 #include "base/trace_event/memory_dump_manager.h"
30 #include "base/trace_event/process_memory_dump.h" 30 #include "base/trace_event/process_memory_dump.h"
31 #include "base/trace_event/trace_event.h" 31 #include "base/trace_event/trace_event.h"
32 #include "build/build_config.h" 32 #include "build/build_config.h"
33 #include "content/common/gpu/gpu_channel_manager.h" 33 #include "content/common/gpu/gpu_channel_manager.h"
34 #include "content/common/gpu/gpu_channel_manager_delegate.h"
34 #include "content/common/gpu/gpu_memory_buffer_factory.h" 35 #include "content/common/gpu/gpu_memory_buffer_factory.h"
35 #include "content/common/gpu/gpu_messages.h" 36 #include "content/common/gpu/gpu_messages.h"
36 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h" 37 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h"
37 #include "content/public/common/content_switches.h" 38 #include "content/public/common/content_switches.h"
38 #include "gpu/command_buffer/common/mailbox.h" 39 #include "gpu/command_buffer/common/mailbox.h"
39 #include "gpu/command_buffer/common/value_state.h" 40 #include "gpu/command_buffer/common/value_state.h"
40 #include "gpu/command_buffer/service/gpu_scheduler.h" 41 #include "gpu/command_buffer/service/gpu_scheduler.h"
41 #include "gpu/command_buffer/service/image_factory.h" 42 #include "gpu/command_buffer/service/image_factory.h"
42 #include "gpu/command_buffer/service/mailbox_manager.h" 43 #include "gpu/command_buffer/service/mailbox_manager.h"
43 #include "gpu/command_buffer/service/sync_point_manager.h" 44 #include "gpu/command_buffer/service/sync_point_manager.h"
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 694
694 if (!channel_) { 695 if (!channel_) {
695 delete message; 696 delete message;
696 return false; 697 return false;
697 } 698 }
698 699
699 return channel_->Send(message); 700 return channel_->Send(message);
700 } 701 }
701 702
702 void GpuChannel::OnAddSubscription(unsigned int target) { 703 void GpuChannel::OnAddSubscription(unsigned int target) {
703 gpu_channel_manager()->Send( 704 gpu_channel_manager()->delegate()->AddSubscription(client_id_, target);
704 new GpuHostMsg_AddSubscription(client_id_, target));
705 } 705 }
706 706
707 void GpuChannel::OnRemoveSubscription(unsigned int target) { 707 void GpuChannel::OnRemoveSubscription(unsigned int target) {
708 gpu_channel_manager()->Send( 708 gpu_channel_manager()->delegate()->RemoveSubscription(client_id_, target);
709 new GpuHostMsg_RemoveSubscription(client_id_, target));
710 } 709 }
711 710
712 void GpuChannel::OnStreamRescheduled(int32_t stream_id, bool scheduled) { 711 void GpuChannel::OnStreamRescheduled(int32_t stream_id, bool scheduled) {
713 scoped_refptr<GpuChannelMessageQueue> queue = LookupStream(stream_id); 712 scoped_refptr<GpuChannelMessageQueue> queue = LookupStream(stream_id);
714 DCHECK(queue); 713 DCHECK(queue);
715 queue->OnRescheduled(scheduled); 714 queue->OnRescheduled(scheduled);
716 } 715 }
717 716
718 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32_t route_id) { 717 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32_t route_id) {
719 return stubs_.get(route_id); 718 return stubs_.get(route_id);
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 void GpuChannel::OnCreateJpegDecoder(int32_t route_id, 992 void GpuChannel::OnCreateJpegDecoder(int32_t route_id,
994 IPC::Message* reply_msg) { 993 IPC::Message* reply_msg) {
995 if (!jpeg_decoder_) { 994 if (!jpeg_decoder_) {
996 jpeg_decoder_.reset(new GpuJpegDecodeAccelerator(this, io_task_runner_)); 995 jpeg_decoder_.reset(new GpuJpegDecodeAccelerator(this, io_task_runner_));
997 } 996 }
998 jpeg_decoder_->AddClient(route_id, reply_msg); 997 jpeg_decoder_->AddClient(route_id, reply_msg);
999 } 998 }
1000 999
1001 void GpuChannel::CacheShader(const std::string& key, 1000 void GpuChannel::CacheShader(const std::string& key,
1002 const std::string& shader) { 1001 const std::string& shader) {
1003 gpu_channel_manager_->Send( 1002 gpu_channel_manager_->delegate()->StoreShaderToDisk(client_id_, key, shader);
1004 new GpuHostMsg_CacheShader(client_id_, key, shader));
1005 } 1003 }
1006 1004
1007 void GpuChannel::AddFilter(IPC::MessageFilter* filter) { 1005 void GpuChannel::AddFilter(IPC::MessageFilter* filter) {
1008 io_task_runner_->PostTask( 1006 io_task_runner_->PostTask(
1009 FROM_HERE, base::Bind(&GpuChannelMessageFilter::AddChannelFilter, 1007 FROM_HERE, base::Bind(&GpuChannelMessageFilter::AddChannelFilter,
1010 filter_, make_scoped_refptr(filter))); 1008 filter_, make_scoped_refptr(filter)));
1011 } 1009 }
1012 1010
1013 void GpuChannel::RemoveFilter(IPC::MessageFilter* filter) { 1011 void GpuChannel::RemoveFilter(IPC::MessageFilter* filter) {
1014 io_task_runner_->PostTask( 1012 io_task_runner_->PostTask(
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 } 1063 }
1066 } 1064 }
1067 } 1065 }
1068 1066
1069 void GpuChannel::HandleUpdateValueState( 1067 void GpuChannel::HandleUpdateValueState(
1070 unsigned int target, const gpu::ValueState& state) { 1068 unsigned int target, const gpu::ValueState& state) {
1071 pending_valuebuffer_state_->UpdateState(target, state); 1069 pending_valuebuffer_state_->UpdateState(target, state);
1072 } 1070 }
1073 1071
1074 } // namespace content 1072 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/establish_channel_params.cc ('k') | content/common/gpu/gpu_channel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698