| 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 DCHECK_IMPLIES(IsZeroCopyUploadEnabled(), !IsOneCopyUploadEnabled()); | 1125 DCHECK_IMPLIES(IsZeroCopyUploadEnabled(), !IsOneCopyUploadEnabled()); |
| 1126 DCHECK_IMPLIES(IsOneCopyUploadEnabled(), !IsZeroCopyUploadEnabled()); | 1126 DCHECK_IMPLIES(IsOneCopyUploadEnabled(), !IsZeroCopyUploadEnabled()); |
| 1127 if (IsZeroCopyUploadEnabled()) | 1127 if (IsZeroCopyUploadEnabled()) |
| 1128 command_line->AppendSwitch(switches::kEnableZeroCopy); | 1128 command_line->AppendSwitch(switches::kEnableZeroCopy); |
| 1129 if (!IsOneCopyUploadEnabled()) | 1129 if (!IsOneCopyUploadEnabled()) |
| 1130 command_line->AppendSwitch(switches::kDisableOneCopy); | 1130 command_line->AppendSwitch(switches::kDisableOneCopy); |
| 1131 | 1131 |
| 1132 if (IsForceGpuRasterizationEnabled()) | 1132 if (IsForceGpuRasterizationEnabled()) |
| 1133 command_line->AppendSwitch(switches::kForceGpuRasterization); | 1133 command_line->AppendSwitch(switches::kForceGpuRasterization); |
| 1134 | 1134 |
| 1135 // TODO(reveman): We currently assume that the compositor will use BGRA_8888 |
| 1136 // if it's able to, and RGBA_8888 otherwise. Since we don't know what it will |
| 1137 // use we hardcode BGRA_8888 here for now. We should instead |
| 1138 // move decisions about GpuMemoryBuffer format to the browser embedder so we |
| 1139 // know it here, and pass that decision to the compositor for each usage. |
| 1140 gfx::GpuMemoryBuffer::Format format = gfx::GpuMemoryBuffer::BGRA_8888; |
| 1141 |
| 1142 // TODO(danakj): When one-copy uploads support partial update, change this |
| 1143 // usage to PERSISTENT_MAP for one-copy. |
| 1144 gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::MAP; |
| 1145 |
| 1135 command_line->AppendSwitchASCII( | 1146 command_line->AppendSwitchASCII( |
| 1136 switches::kUseImageTextureTarget, | 1147 switches::kUseImageTextureTarget, |
| 1137 base::UintToString( | 1148 base::UintToString( |
| 1138 BrowserGpuChannelHostFactory::GetImageTextureTarget())); | 1149 BrowserGpuChannelHostFactory::GetImageTextureTarget(format, usage))); |
| 1139 | 1150 |
| 1140 // Appending disable-gpu-feature switches due to software rendering list. | 1151 // Appending disable-gpu-feature switches due to software rendering list. |
| 1141 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1152 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
| 1142 DCHECK(gpu_data_manager); | 1153 DCHECK(gpu_data_manager); |
| 1143 gpu_data_manager->AppendRendererCommandLine(command_line); | 1154 gpu_data_manager->AppendRendererCommandLine(command_line); |
| 1144 } | 1155 } |
| 1145 | 1156 |
| 1146 void RenderProcessHostImpl::AppendRendererCommandLine( | 1157 void RenderProcessHostImpl::AppendRendererCommandLine( |
| 1147 base::CommandLine* command_line) const { | 1158 base::CommandLine* command_line) const { |
| 1148 // Pass the process type first, so it shows first in process listings. | 1159 // Pass the process type first, so it shows first in process listings. |
| (...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2453 if (worker_ref_count_ == 0) | 2464 if (worker_ref_count_ == 0) |
| 2454 Cleanup(); | 2465 Cleanup(); |
| 2455 } | 2466 } |
| 2456 | 2467 |
| 2457 void RenderProcessHostImpl::GetAudioOutputControllers( | 2468 void RenderProcessHostImpl::GetAudioOutputControllers( |
| 2458 const GetAudioOutputControllersCallback& callback) const { | 2469 const GetAudioOutputControllersCallback& callback) const { |
| 2459 audio_renderer_host()->GetOutputControllers(callback); | 2470 audio_renderer_host()->GetOutputControllers(callback); |
| 2460 } | 2471 } |
| 2461 | 2472 |
| 2462 } // namespace content | 2473 } // namespace content |
| OLD | NEW |