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