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, | |
palmer
2016/04/01 19:19:54
Do we need this in all builds, including productio
piman
2016/04/01 20:26:22
It needs to be in the binary for any configuration
| |
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): Do the extraction of workarounds in GpuChannelManager's | |
palmer
2016/04/01 19:19:54
Please attach a crbug.com link to all TODOs.
| |
986 // constructor. Currently it is done in FeatureInfo constructor. There is no | |
987 // need to extract them from the command-line every time a new FeatureInfo is | |
988 // created (i.e. per ContextGroup) since parsing result is a constant. | |
989 scoped_refptr<gpu::gles2::FeatureInfo> feature_info = | |
990 new gpu::gles2::FeatureInfo; | |
991 gpu_driver_bug_workarounds->clear(); | |
992 #define GPU_OP(type, name) \ | |
993 if (feature_info->workarounds().name) \ | |
994 gpu_driver_bug_workarounds->push_back(#name); | |
995 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | |
996 #undef GPU_OP | |
997 } | |
998 | |
981 void GpuChannel::CacheShader(const std::string& key, | 999 void GpuChannel::CacheShader(const std::string& key, |
982 const std::string& shader) { | 1000 const std::string& shader) { |
983 gpu_channel_manager_->delegate()->StoreShaderToDisk(client_id_, key, shader); | 1001 gpu_channel_manager_->delegate()->StoreShaderToDisk(client_id_, key, shader); |
984 } | 1002 } |
985 | 1003 |
986 void GpuChannel::AddFilter(IPC::MessageFilter* filter) { | 1004 void GpuChannel::AddFilter(IPC::MessageFilter* filter) { |
987 io_task_runner_->PostTask( | 1005 io_task_runner_->PostTask( |
988 FROM_HERE, base::Bind(&GpuChannelMessageFilter::AddChannelFilter, | 1006 FROM_HERE, base::Bind(&GpuChannelMessageFilter::AddChannelFilter, |
989 filter_, make_scoped_refptr(filter))); | 1007 filter_, make_scoped_refptr(filter))); |
990 } | 1008 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1044 } | 1062 } |
1045 } | 1063 } |
1046 } | 1064 } |
1047 | 1065 |
1048 void GpuChannel::HandleUpdateValueState( | 1066 void GpuChannel::HandleUpdateValueState( |
1049 unsigned int target, const gpu::ValueState& state) { | 1067 unsigned int target, const gpu::ValueState& state) { |
1050 pending_valuebuffer_state_->UpdateState(target, state); | 1068 pending_valuebuffer_state_->UpdateState(target, state); |
1051 } | 1069 } |
1052 | 1070 |
1053 } // namespace content | 1071 } // namespace content |
OLD | NEW |