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 #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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 RemoveRouteFromStream(route_id); | 753 RemoveRouteFromStream(route_id); |
754 } | 754 } |
755 | 755 |
756 bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) { | 756 bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) { |
757 bool handled = true; | 757 bool handled = true; |
758 IPC_BEGIN_MESSAGE_MAP(GpuChannel, msg) | 758 IPC_BEGIN_MESSAGE_MAP(GpuChannel, msg) |
759 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateCommandBuffer, | 759 IPC_MESSAGE_HANDLER(GpuChannelMsg_CreateCommandBuffer, |
760 OnCreateCommandBuffer) | 760 OnCreateCommandBuffer) |
761 IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer, | 761 IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer, |
762 OnDestroyCommandBuffer) | 762 OnDestroyCommandBuffer) |
| 763 IPC_MESSAGE_HANDLER(GpuChannelMsg_GetDriverBugWorkArounds, |
| 764 OnGetDriverBugWorkArounds) |
763 IPC_MESSAGE_UNHANDLED(handled = false) | 765 IPC_MESSAGE_UNHANDLED(handled = false) |
764 IPC_END_MESSAGE_MAP() | 766 IPC_END_MESSAGE_MAP() |
765 return handled; | 767 return handled; |
766 } | 768 } |
767 | 769 |
768 scoped_refptr<gpu::SyncPointOrderData> GpuChannel::GetSyncPointOrderData( | 770 scoped_refptr<gpu::SyncPointOrderData> GpuChannel::GetSyncPointOrderData( |
769 int32_t stream_id) { | 771 int32_t stream_id) { |
770 auto it = streams_.find(stream_id); | 772 auto it = streams_.find(stream_id); |
771 DCHECK(it != streams_.end()); | 773 DCHECK(it != streams_.end()); |
772 DCHECK(it->second); | 774 DCHECK(it->second); |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 // In case the renderer is currently blocked waiting for a sync reply from the | 973 // In case the renderer is currently blocked waiting for a sync reply from the |
972 // stub, we need to make sure to reschedule the correct stream here. | 974 // stub, we need to make sure to reschedule the correct stream here. |
973 if (stub && !stub->IsScheduled()) { | 975 if (stub && !stub->IsScheduled()) { |
974 // This stub won't get a chance to reschedule the stream so do that now. | 976 // This stub won't get a chance to reschedule the stream so do that now. |
975 OnStreamRescheduled(stub->stream_id(), true); | 977 OnStreamRescheduled(stub->stream_id(), true); |
976 } | 978 } |
977 | 979 |
978 RemoveRoute(route_id); | 980 RemoveRoute(route_id); |
979 } | 981 } |
980 | 982 |
| 983 void GpuChannel::OnGetDriverBugWorkArounds( |
| 984 std::vector<std::string>* gpu_driver_bug_workarounds) { |
| 985 // TODO(j.isorce): http://crbug.com/599964 Do the extraction of workarounds in |
| 986 // the GpuChannelManager constructor. Currently it is done in the FeatureInfo |
| 987 // constructor. There is no need to extract them from the command-line every |
| 988 // time a new FeatureInfo is created (i.e. per ContextGroup) since parsing |
| 989 // result is a constant. |
| 990 scoped_refptr<gpu::gles2::FeatureInfo> feature_info = |
| 991 new gpu::gles2::FeatureInfo; |
| 992 gpu_driver_bug_workarounds->clear(); |
| 993 #define GPU_OP(type, name) \ |
| 994 if (feature_info->workarounds().name) \ |
| 995 gpu_driver_bug_workarounds->push_back(#name); |
| 996 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| 997 #undef GPU_OP |
| 998 } |
| 999 |
981 void GpuChannel::CacheShader(const std::string& key, | 1000 void GpuChannel::CacheShader(const std::string& key, |
982 const std::string& shader) { | 1001 const std::string& shader) { |
983 gpu_channel_manager_->delegate()->StoreShaderToDisk(client_id_, key, shader); | 1002 gpu_channel_manager_->delegate()->StoreShaderToDisk(client_id_, key, shader); |
984 } | 1003 } |
985 | 1004 |
986 void GpuChannel::AddFilter(IPC::MessageFilter* filter) { | 1005 void GpuChannel::AddFilter(IPC::MessageFilter* filter) { |
987 io_task_runner_->PostTask( | 1006 io_task_runner_->PostTask( |
988 FROM_HERE, base::Bind(&GpuChannelMessageFilter::AddChannelFilter, | 1007 FROM_HERE, base::Bind(&GpuChannelMessageFilter::AddChannelFilter, |
989 filter_, make_scoped_refptr(filter))); | 1008 filter_, make_scoped_refptr(filter))); |
990 } | 1009 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 } | 1063 } |
1045 } | 1064 } |
1046 } | 1065 } |
1047 | 1066 |
1048 void GpuChannel::HandleUpdateValueState( | 1067 void GpuChannel::HandleUpdateValueState( |
1049 unsigned int target, const gpu::ValueState& state) { | 1068 unsigned int target, const gpu::ValueState& state) { |
1050 pending_valuebuffer_state_->UpdateState(target, state); | 1069 pending_valuebuffer_state_->UpdateState(target, state); |
1051 } | 1070 } |
1052 | 1071 |
1053 } // namespace content | 1072 } // namespace content |
OLD | NEW |