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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 | 10 |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 gpu_channel_manager_->RemoveChannel(client_id_); | 659 gpu_channel_manager_->RemoveChannel(client_id_); |
660 } | 660 } |
661 | 661 |
662 bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) { | 662 bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) { |
663 bool handled = true; | 663 bool handled = true; |
664 IPC_BEGIN_MESSAGE_MAP(GpuChannel, msg) | 664 IPC_BEGIN_MESSAGE_MAP(GpuChannel, msg) |
665 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateOffscreenCommandBuffer, | 665 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateOffscreenCommandBuffer, |
666 OnCreateOffscreenCommandBuffer) | 666 OnCreateOffscreenCommandBuffer) |
667 IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer, | 667 IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer, |
668 OnDestroyCommandBuffer) | 668 OnDestroyCommandBuffer) |
| 669 IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuMsg_CreateJpegDecoder, |
| 670 OnCreateJpegDecoder) |
669 IPC_MESSAGE_UNHANDLED(handled = false) | 671 IPC_MESSAGE_UNHANDLED(handled = false) |
670 IPC_END_MESSAGE_MAP() | 672 IPC_END_MESSAGE_MAP() |
671 DCHECK(handled) << msg.type(); | 673 DCHECK(handled) << msg.type(); |
672 return handled; | 674 return handled; |
673 } | 675 } |
674 | 676 |
675 void GpuChannel::HandleMessage() { | 677 void GpuChannel::HandleMessage() { |
676 handle_messages_scheduled_ = false; | 678 handle_messages_scheduled_ = false; |
677 if (deferred_messages_.empty()) | 679 if (deferred_messages_.empty()) |
678 return; | 680 return; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 router_.RemoveRoute(route_id); | 782 router_.RemoveRoute(route_id); |
781 stubs_.Remove(route_id); | 783 stubs_.Remove(route_id); |
782 // In case the renderer is currently blocked waiting for a sync reply from the | 784 // In case the renderer is currently blocked waiting for a sync reply from the |
783 // stub, we need to make sure to reschedule the GpuChannel here. | 785 // stub, we need to make sure to reschedule the GpuChannel here. |
784 if (need_reschedule) { | 786 if (need_reschedule) { |
785 // This stub won't get a chance to reschedule, so update the count now. | 787 // This stub won't get a chance to reschedule, so update the count now. |
786 StubSchedulingChanged(true); | 788 StubSchedulingChanged(true); |
787 } | 789 } |
788 } | 790 } |
789 | 791 |
| 792 void GpuChannel::OnCreateJpegDecoder(int32 route_id, IPC::Message* reply_msg) { |
| 793 if (!jpeg_decoder_) { |
| 794 jpeg_decoder_.reset(new GpuJpegDecodeAccelerator(this, io_task_runner_)); |
| 795 } |
| 796 jpeg_decoder_->AddClient(route_id, reply_msg); |
| 797 } |
| 798 |
790 void GpuChannel::MessageProcessed() { | 799 void GpuChannel::MessageProcessed() { |
791 messages_processed_++; | 800 messages_processed_++; |
792 if (preempting_flag_.get()) { | 801 if (preempting_flag_.get()) { |
793 io_task_runner_->PostTask( | 802 io_task_runner_->PostTask( |
794 FROM_HERE, base::Bind(&GpuChannelMessageFilter::MessageProcessed, | 803 FROM_HERE, base::Bind(&GpuChannelMessageFilter::MessageProcessed, |
795 filter_, messages_processed_)); | 804 filter_, messages_processed_)); |
796 } | 805 } |
797 } | 806 } |
798 | 807 |
799 void GpuChannel::CacheShader(const std::string& key, | 808 void GpuChannel::CacheShader(const std::string& key, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 } | 857 } |
849 } | 858 } |
850 } | 859 } |
851 | 860 |
852 void GpuChannel::HandleUpdateValueState( | 861 void GpuChannel::HandleUpdateValueState( |
853 unsigned int target, const gpu::ValueState& state) { | 862 unsigned int target, const gpu::ValueState& state) { |
854 pending_valuebuffer_state_->UpdateState(target, state); | 863 pending_valuebuffer_state_->UpdateState(target, state); |
855 } | 864 } |
856 | 865 |
857 } // namespace content | 866 } // namespace content |
OLD | NEW |