Chromium Code Reviews| Index: content/common/gpu/gpu_channel.cc |
| diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc |
| index c79d20151fffb4c6f34bc9755f0bf04a250d9774..83f1a513d6e0324fbc35f6afa78a7528f5974364 100644 |
| --- a/content/common/gpu/gpu_channel.cc |
| +++ b/content/common/gpu/gpu_channel.cc |
| @@ -760,6 +760,8 @@ bool GpuChannel::OnControlMessageReceived(const IPC::Message& msg) { |
| OnCreateCommandBuffer) |
| IPC_MESSAGE_HANDLER(GpuChannelMsg_DestroyCommandBuffer, |
| OnDestroyCommandBuffer) |
| + IPC_MESSAGE_HANDLER(GpuChannelMsg_GetDriverBugWorkArounds, |
| + OnGetDriverBugWorkArounds) |
| IPC_MESSAGE_UNHANDLED(handled = false) |
| IPC_END_MESSAGE_MAP() |
| return handled; |
| @@ -891,7 +893,6 @@ void GpuChannel::RemoveRouteFromStream(int32_t route_id) { |
| DestroyStreamIfNecessary(streams_[stream_id]); |
| } |
| -#if defined(OS_ANDROID) |
| const GpuCommandBufferStub* GpuChannel::GetOneStub() const { |
| for (const auto& kv : stubs_) { |
| const GpuCommandBufferStub* stub = kv.second; |
| @@ -900,7 +901,6 @@ const GpuCommandBufferStub* GpuChannel::GetOneStub() const { |
| } |
| return nullptr; |
| } |
| -#endif |
| void GpuChannel::OnCreateCommandBuffer( |
| gpu::SurfaceHandle surface_handle, |
| @@ -978,6 +978,20 @@ void GpuChannel::OnDestroyCommandBuffer(int32_t route_id) { |
| RemoveRoute(route_id); |
| } |
| +void GpuChannel::OnGetDriverBugWorkArounds( |
| + std::vector<std::string>* gpu_driver_bug_workarounds) { |
| + const GpuCommandBufferStub* stub = GetOneStub(); |
| + if (stub) { |
|
piman
2016/03/31 01:44:21
This sounds potentially flaky - the IPC result dep
Julien Isorce Samsung
2016/03/31 15:20:09
I was not able to understand why it is done once p
|
| + std::vector<std::string> workaround_names; |
| +#define GPU_OP(type, name) \ |
| + if (stub->GetFeatureInfo()->workarounds().name) \ |
| + workaround_names.push_back(#name); |
| + GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| +#undef GPU_OP |
| + *gpu_driver_bug_workarounds = workaround_names; |
|
dcheng
2016/03/30 23:45:25
std::move() if you're feeling fancy. Alternatively
Julien Isorce Samsung
2016/03/31 15:20:09
No particular reason, I thought about you second s
|
| + } |
| +} |
| + |
| void GpuChannel::CacheShader(const std::string& key, |
| const std::string& shader) { |
| gpu_channel_manager_->delegate()->StoreShaderToDisk(client_id_, key, shader); |