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

Side by Side Diff: gpu/ipc/service/gpu_channel.cc

Issue 1894313002: Removed implementation of CHROMIUM_subscribe_uniform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed a couple more mus/ references Created 4 years, 8 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
« no previous file with comments | « gpu/ipc/service/gpu_channel.h ('k') | gpu/ipc/service/gpu_channel_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "gpu/ipc/service/gpu_channel.h" 5 #include "gpu/ipc/service/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 "gpu/command_buffer/common/mailbox.h" 33 #include "gpu/command_buffer/common/mailbox.h"
34 #include "gpu/command_buffer/common/value_state.h"
35 #include "gpu/command_buffer/service/command_executor.h" 34 #include "gpu/command_buffer/service/command_executor.h"
36 #include "gpu/command_buffer/service/image_factory.h" 35 #include "gpu/command_buffer/service/image_factory.h"
37 #include "gpu/command_buffer/service/mailbox_manager.h" 36 #include "gpu/command_buffer/service/mailbox_manager.h"
38 #include "gpu/command_buffer/service/sync_point_manager.h" 37 #include "gpu/command_buffer/service/sync_point_manager.h"
39 #include "gpu/command_buffer/service/valuebuffer_manager.h"
40 #include "gpu/ipc/common/gpu_messages.h" 38 #include "gpu/ipc/common/gpu_messages.h"
41 #include "gpu/ipc/service/gpu_channel_manager.h" 39 #include "gpu/ipc/service/gpu_channel_manager.h"
42 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" 40 #include "gpu/ipc/service/gpu_channel_manager_delegate.h"
43 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" 41 #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
44 #include "ipc/ipc_channel.h" 42 #include "ipc/ipc_channel.h"
45 #include "ipc/message_filter.h" 43 #include "ipc/message_filter.h"
46 #include "ui/gl/gl_context.h" 44 #include "ui/gl/gl_context.h"
47 #include "ui/gl/gl_image_shared_memory.h" 45 #include "ui/gl/gl_image_shared_memory.h"
48 #include "ui/gl/gl_surface.h" 46 #include "ui/gl/gl_surface.h"
49 47
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 unhandled_message_listener_(nullptr), 593 unhandled_message_listener_(nullptr),
596 channel_id_(IPC::Channel::GenerateVerifiedChannelID("gpu")), 594 channel_id_(IPC::Channel::GenerateVerifiedChannelID("gpu")),
597 preempting_flag_(preempting_flag), 595 preempting_flag_(preempting_flag),
598 preempted_flag_(preempted_flag), 596 preempted_flag_(preempted_flag),
599 client_id_(client_id), 597 client_id_(client_id),
600 client_tracing_id_(client_tracing_id), 598 client_tracing_id_(client_tracing_id),
601 task_runner_(task_runner), 599 task_runner_(task_runner),
602 io_task_runner_(io_task_runner), 600 io_task_runner_(io_task_runner),
603 share_group_(share_group), 601 share_group_(share_group),
604 mailbox_manager_(mailbox), 602 mailbox_manager_(mailbox),
605 subscription_ref_set_(new gles2::SubscriptionRefSet),
606 pending_valuebuffer_state_(new ValueStateMap),
607 watchdog_(watchdog), 603 watchdog_(watchdog),
608 allow_view_command_buffers_(allow_view_command_buffers), 604 allow_view_command_buffers_(allow_view_command_buffers),
609 allow_real_time_streams_(allow_real_time_streams), 605 allow_real_time_streams_(allow_real_time_streams),
610 weak_factory_(this) { 606 weak_factory_(this) {
611 DCHECK(gpu_channel_manager); 607 DCHECK(gpu_channel_manager);
612 DCHECK(client_id); 608 DCHECK(client_id);
613 609
614 filter_ = new GpuChannelMessageFilter(); 610 filter_ = new GpuChannelMessageFilter();
615 611
616 scoped_refptr<GpuChannelMessageQueue> control_queue = 612 scoped_refptr<GpuChannelMessageQueue> control_queue =
617 CreateStream(GPU_STREAM_DEFAULT, GpuStreamPriority::HIGH); 613 CreateStream(GPU_STREAM_DEFAULT, GpuStreamPriority::HIGH);
618 AddRouteToStream(MSG_ROUTING_CONTROL, GPU_STREAM_DEFAULT); 614 AddRouteToStream(MSG_ROUTING_CONTROL, GPU_STREAM_DEFAULT);
619
620 subscription_ref_set_->AddObserver(this);
621 } 615 }
622 616
623 GpuChannel::~GpuChannel() { 617 GpuChannel::~GpuChannel() {
624 // Clear stubs first because of dependencies. 618 // Clear stubs first because of dependencies.
625 stubs_.clear(); 619 stubs_.clear();
626 620
627 for (auto& kv : streams_) 621 for (auto& kv : streams_)
628 kv.second->Disable(); 622 kv.second->Disable();
629 623
630 subscription_ref_set_->RemoveObserver(this);
631 if (preempting_flag_.get()) 624 if (preempting_flag_.get())
632 preempting_flag_->Reset(); 625 preempting_flag_->Reset();
633 } 626 }
634 627
635 IPC::ChannelHandle GpuChannel::Init(base::WaitableEvent* shutdown_event) { 628 IPC::ChannelHandle GpuChannel::Init(base::WaitableEvent* shutdown_event) {
636 DCHECK(shutdown_event); 629 DCHECK(shutdown_event);
637 DCHECK(!channel_); 630 DCHECK(!channel_);
638 631
639 IPC::ChannelHandle channel_handle(channel_id_); 632 IPC::ChannelHandle channel_handle(channel_id_);
640 633
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 << " with type " << message->type(); 697 << " with type " << message->type();
705 698
706 if (!channel_) { 699 if (!channel_) {
707 delete message; 700 delete message;
708 return false; 701 return false;
709 } 702 }
710 703
711 return channel_->Send(message); 704 return channel_->Send(message);
712 } 705 }
713 706
714 void GpuChannel::OnAddSubscription(unsigned int target) {
715 gpu_channel_manager()->delegate()->AddSubscription(client_id_, target);
716 }
717
718 void GpuChannel::OnRemoveSubscription(unsigned int target) {
719 gpu_channel_manager()->delegate()->RemoveSubscription(client_id_, target);
720 }
721
722 void GpuChannel::OnStreamRescheduled(int32_t stream_id, bool scheduled) { 707 void GpuChannel::OnStreamRescheduled(int32_t stream_id, bool scheduled) {
723 scoped_refptr<GpuChannelMessageQueue> queue = LookupStream(stream_id); 708 scoped_refptr<GpuChannelMessageQueue> queue = LookupStream(stream_id);
724 DCHECK(queue); 709 DCHECK(queue);
725 queue->OnRescheduled(scheduled); 710 queue->OnRescheduled(scheduled);
726 } 711 }
727 712
728 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32_t route_id) { 713 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32_t route_id) {
729 return stubs_.get(route_id); 714 return stubs_.get(route_id);
730 } 715 }
731 716
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 } 938 }
954 939
955 if (share_group && share_group->decoder()->WasContextLost()) { 940 if (share_group && share_group->decoder()->WasContextLost()) {
956 DLOG(ERROR) << "GpuChannel::OnCreateCommandBuffer(): shared context was " 941 DLOG(ERROR) << "GpuChannel::OnCreateCommandBuffer(): shared context was "
957 "already lost"; 942 "already lost";
958 return; 943 return;
959 } 944 }
960 945
961 std::unique_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( 946 std::unique_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub(
962 this, sync_point_manager_, task_runner_.get(), share_group, 947 this, sync_point_manager_, task_runner_.get(), share_group,
963 surface_handle, mailbox_manager_.get(), preempted_flag_.get(), 948 surface_handle, mailbox_manager_.get(), preempted_flag_.get(), size,
964 subscription_ref_set_.get(), pending_valuebuffer_state_.get(), size,
965 disallowed_features_, init_params.attribs, init_params.gpu_preference, 949 disallowed_features_, init_params.attribs, init_params.gpu_preference,
966 init_params.stream_id, route_id, watchdog_, init_params.active_url)); 950 init_params.stream_id, route_id, watchdog_, init_params.active_url));
967 951
968 scoped_refptr<GpuChannelMessageQueue> queue = LookupStream(stream_id); 952 scoped_refptr<GpuChannelMessageQueue> queue = LookupStream(stream_id);
969 if (!queue) 953 if (!queue)
970 queue = CreateStream(stream_id, stream_priority); 954 queue = CreateStream(stream_id, stream_priority);
971 955
972 if (!AddRoute(route_id, stream_id, stub.get())) { 956 if (!AddRoute(route_id, stream_id, stub.get())) {
973 DestroyStreamIfNecessary(queue); 957 DestroyStreamIfNecessary(queue);
974 DLOG(ERROR) << "GpuChannel::OnCreateCommandBuffer(): failed to add route"; 958 DLOG(ERROR) << "GpuChannel::OnCreateCommandBuffer(): failed to add route";
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 ->AsImageFactory() 1048 ->AsImageFactory()
1065 ->CreateImageForGpuMemoryBuffer(handle, 1049 ->CreateImageForGpuMemoryBuffer(handle,
1066 size, 1050 size,
1067 format, 1051 format,
1068 internalformat, 1052 internalformat,
1069 client_id_); 1053 client_id_);
1070 } 1054 }
1071 } 1055 }
1072 } 1056 }
1073 1057
1074 void GpuChannel::HandleUpdateValueState(
1075 unsigned int target, const ValueState& state) {
1076 pending_valuebuffer_state_->UpdateState(target, state);
1077 }
1078
1079 } // namespace gpu 1058 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_channel.h ('k') | gpu/ipc/service/gpu_channel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698