OLD | NEW |
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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 void GpuChannel::OnAddSubscription(unsigned int target) { | 676 void GpuChannel::OnAddSubscription(unsigned int target) { |
677 gpu_channel_manager()->Send( | 677 gpu_channel_manager()->Send( |
678 new GpuHostMsg_AddSubscription(client_id_, target)); | 678 new GpuHostMsg_AddSubscription(client_id_, target)); |
679 } | 679 } |
680 | 680 |
681 void GpuChannel::OnRemoveSubscription(unsigned int target) { | 681 void GpuChannel::OnRemoveSubscription(unsigned int target) { |
682 gpu_channel_manager()->Send( | 682 gpu_channel_manager()->Send( |
683 new GpuHostMsg_RemoveSubscription(client_id_, target)); | 683 new GpuHostMsg_RemoveSubscription(client_id_, target)); |
684 } | 684 } |
685 | 685 |
686 void GpuChannel::StubSchedulingChanged(bool scheduled) { | 686 void GpuChannel::OnStubSchedulingChanged(GpuCommandBufferStub* stub, |
| 687 bool scheduled) { |
687 bool a_stub_was_descheduled = num_stubs_descheduled_ > 0; | 688 bool a_stub_was_descheduled = num_stubs_descheduled_ > 0; |
688 if (scheduled) { | 689 if (scheduled) { |
689 num_stubs_descheduled_--; | 690 num_stubs_descheduled_--; |
690 ScheduleHandleMessage(); | 691 ScheduleHandleMessage(); |
691 } else { | 692 } else { |
692 num_stubs_descheduled_++; | 693 num_stubs_descheduled_++; |
693 } | 694 } |
694 DCHECK_LE(num_stubs_descheduled_, stubs_.size()); | 695 DCHECK_LE(num_stubs_descheduled_, stubs_.size()); |
695 bool a_stub_is_descheduled = num_stubs_descheduled_ > 0; | 696 bool a_stub_is_descheduled = num_stubs_descheduled_ > 0; |
696 | 697 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 auto stream_it = streams_.find(stream_id); | 1003 auto stream_it = streams_.find(stream_id); |
1003 DCHECK(stream_it != streams_.end()); | 1004 DCHECK(stream_it != streams_.end()); |
1004 stream_it->second.RemoveRoute(route_id); | 1005 stream_it->second.RemoveRoute(route_id); |
1005 if (!stream_it->second.HasRoutes()) | 1006 if (!stream_it->second.HasRoutes()) |
1006 streams_.erase(stream_it); | 1007 streams_.erase(stream_it); |
1007 | 1008 |
1008 // In case the renderer is currently blocked waiting for a sync reply from the | 1009 // In case the renderer is currently blocked waiting for a sync reply from the |
1009 // stub, we need to make sure to reschedule the GpuChannel here. | 1010 // stub, we need to make sure to reschedule the GpuChannel here. |
1010 if (!stub->IsScheduled()) { | 1011 if (!stub->IsScheduled()) { |
1011 // This stub won't get a chance to reschedule, so update the count now. | 1012 // This stub won't get a chance to reschedule, so update the count now. |
1012 StubSchedulingChanged(true); | 1013 OnStubSchedulingChanged(stub.get(), true); |
1013 } | 1014 } |
1014 } | 1015 } |
1015 | 1016 |
1016 void GpuChannel::OnCreateJpegDecoder(int32 route_id, IPC::Message* reply_msg) { | 1017 void GpuChannel::OnCreateJpegDecoder(int32 route_id, IPC::Message* reply_msg) { |
1017 if (!jpeg_decoder_) { | 1018 if (!jpeg_decoder_) { |
1018 jpeg_decoder_.reset(new GpuJpegDecodeAccelerator(this, io_task_runner_)); | 1019 jpeg_decoder_.reset(new GpuJpegDecodeAccelerator(this, io_task_runner_)); |
1019 } | 1020 } |
1020 jpeg_decoder_->AddClient(route_id, reply_msg); | 1021 jpeg_decoder_->AddClient(route_id, reply_msg); |
1021 } | 1022 } |
1022 | 1023 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 } | 1084 } |
1084 } | 1085 } |
1085 } | 1086 } |
1086 | 1087 |
1087 void GpuChannel::HandleUpdateValueState( | 1088 void GpuChannel::HandleUpdateValueState( |
1088 unsigned int target, const gpu::ValueState& state) { | 1089 unsigned int target, const gpu::ValueState& state) { |
1089 pending_valuebuffer_state_->UpdateState(target, state); | 1090 pending_valuebuffer_state_->UpdateState(target, state); |
1090 } | 1091 } |
1091 | 1092 |
1092 } // namespace content | 1093 } // namespace content |
OLD | NEW |