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

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

Issue 1730023004: Revert of Decouple browser-specific GPU IPC messages from GPU service IPCs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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"
35 #include "content/common/gpu/gpu_memory_buffer_factory.h" 34 #include "content/common/gpu/gpu_memory_buffer_factory.h"
36 #include "content/common/gpu/gpu_messages.h" 35 #include "content/common/gpu/gpu_messages.h"
37 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h" 36 #include "content/common/gpu/media/gpu_jpeg_decode_accelerator.h"
38 #include "content/public/common/content_switches.h" 37 #include "content/public/common/content_switches.h"
39 #include "gpu/command_buffer/common/mailbox.h" 38 #include "gpu/command_buffer/common/mailbox.h"
40 #include "gpu/command_buffer/common/value_state.h" 39 #include "gpu/command_buffer/common/value_state.h"
41 #include "gpu/command_buffer/service/gpu_scheduler.h" 40 #include "gpu/command_buffer/service/gpu_scheduler.h"
42 #include "gpu/command_buffer/service/image_factory.h" 41 #include "gpu/command_buffer/service/image_factory.h"
43 #include "gpu/command_buffer/service/mailbox_manager.h" 42 #include "gpu/command_buffer/service/mailbox_manager.h"
44 #include "gpu/command_buffer/service/sync_point_manager.h" 43 #include "gpu/command_buffer/service/sync_point_manager.h"
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 693
695 if (!channel_) { 694 if (!channel_) {
696 delete message; 695 delete message;
697 return false; 696 return false;
698 } 697 }
699 698
700 return channel_->Send(message); 699 return channel_->Send(message);
701 } 700 }
702 701
703 void GpuChannel::OnAddSubscription(unsigned int target) { 702 void GpuChannel::OnAddSubscription(unsigned int target) {
704 gpu_channel_manager()->delegate()->AddSubscription(client_id_, target); 703 gpu_channel_manager()->Send(
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()->delegate()->RemoveSubscription(client_id_, target); 708 gpu_channel_manager()->Send(
709 new GpuHostMsg_RemoveSubscription(client_id_, target));
709 } 710 }
710 711
711 void GpuChannel::OnStreamRescheduled(int32_t stream_id, bool scheduled) { 712 void GpuChannel::OnStreamRescheduled(int32_t stream_id, bool scheduled) {
712 scoped_refptr<GpuChannelMessageQueue> queue = LookupStream(stream_id); 713 scoped_refptr<GpuChannelMessageQueue> queue = LookupStream(stream_id);
713 DCHECK(queue); 714 DCHECK(queue);
714 queue->OnRescheduled(scheduled); 715 queue->OnRescheduled(scheduled);
715 } 716 }
716 717
717 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32_t route_id) { 718 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32_t route_id) {
718 return stubs_.get(route_id); 719 return stubs_.get(route_id);
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 void GpuChannel::OnCreateJpegDecoder(int32_t route_id, 993 void GpuChannel::OnCreateJpegDecoder(int32_t route_id,
993 IPC::Message* reply_msg) { 994 IPC::Message* reply_msg) {
994 if (!jpeg_decoder_) { 995 if (!jpeg_decoder_) {
995 jpeg_decoder_.reset(new GpuJpegDecodeAccelerator(this, io_task_runner_)); 996 jpeg_decoder_.reset(new GpuJpegDecodeAccelerator(this, io_task_runner_));
996 } 997 }
997 jpeg_decoder_->AddClient(route_id, reply_msg); 998 jpeg_decoder_->AddClient(route_id, reply_msg);
998 } 999 }
999 1000
1000 void GpuChannel::CacheShader(const std::string& key, 1001 void GpuChannel::CacheShader(const std::string& key,
1001 const std::string& shader) { 1002 const std::string& shader) {
1002 gpu_channel_manager_->delegate()->StoreShaderToDisk(client_id_, key, shader); 1003 gpu_channel_manager_->Send(
1004 new GpuHostMsg_CacheShader(client_id_, key, shader));
1003 } 1005 }
1004 1006
1005 void GpuChannel::AddFilter(IPC::MessageFilter* filter) { 1007 void GpuChannel::AddFilter(IPC::MessageFilter* filter) {
1006 io_task_runner_->PostTask( 1008 io_task_runner_->PostTask(
1007 FROM_HERE, base::Bind(&GpuChannelMessageFilter::AddChannelFilter, 1009 FROM_HERE, base::Bind(&GpuChannelMessageFilter::AddChannelFilter,
1008 filter_, make_scoped_refptr(filter))); 1010 filter_, make_scoped_refptr(filter)));
1009 } 1011 }
1010 1012
1011 void GpuChannel::RemoveFilter(IPC::MessageFilter* filter) { 1013 void GpuChannel::RemoveFilter(IPC::MessageFilter* filter) {
1012 io_task_runner_->PostTask( 1014 io_task_runner_->PostTask(
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1063 } 1065 }
1064 } 1066 }
1065 } 1067 }
1066 1068
1067 void GpuChannel::HandleUpdateValueState( 1069 void GpuChannel::HandleUpdateValueState(
1068 unsigned int target, const gpu::ValueState& state) { 1070 unsigned int target, const gpu::ValueState& state) {
1069 pending_valuebuffer_state_->UpdateState(target, state); 1071 pending_valuebuffer_state_->UpdateState(target, state);
1070 } 1072 }
1071 1073
1072 } // namespace content 1074 } // 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