OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 command_line->AppendSwitch(switches::kForceGpuRasterization); | 1249 command_line->AppendSwitch(switches::kForceGpuRasterization); |
1250 | 1250 |
1251 if (IsGpuMemoryBufferCompositorResourcesEnabled()) { | 1251 if (IsGpuMemoryBufferCompositorResourcesEnabled()) { |
1252 command_line->AppendSwitch( | 1252 command_line->AppendSwitch( |
1253 switches::kEnableGpuMemoryBufferCompositorResources); | 1253 switches::kEnableGpuMemoryBufferCompositorResources); |
1254 } | 1254 } |
1255 | 1255 |
1256 // Persistent buffers may come at a performance hit (not all platform specific | 1256 // Persistent buffers may come at a performance hit (not all platform specific |
1257 // buffers support it), so only enable them if partial raster is enabled and | 1257 // buffers support it), so only enable them if partial raster is enabled and |
1258 // we are actually going to use them. | 1258 // we are actually going to use them. |
| 1259 // TODO(dcastagna): Once GPU_READ_CPU_READ_WRITE_PERSISTENT is removed |
| 1260 // kContentImageTextureTarget and kVideoImageTextureTarget can be merged into |
| 1261 // one flag. |
1259 gfx::BufferUsage buffer_usage = | 1262 gfx::BufferUsage buffer_usage = |
1260 IsPartialRasterEnabled() | 1263 IsPartialRasterEnabled() |
1261 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT | 1264 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT |
1262 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; | 1265 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; |
1263 std::vector<unsigned> image_targets( | 1266 std::vector<unsigned> image_targets( |
1264 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, GL_TEXTURE_2D); | 1267 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, GL_TEXTURE_2D); |
1265 for (size_t format = 0; | 1268 for (size_t format = 0; |
1266 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) { | 1269 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) { |
1267 image_targets[format] = | 1270 image_targets[format] = |
1268 BrowserGpuMemoryBufferManager::GetImageTextureTarget( | 1271 BrowserGpuMemoryBufferManager::GetImageTextureTarget( |
1269 static_cast<gfx::BufferFormat>(format), buffer_usage); | 1272 static_cast<gfx::BufferFormat>(format), buffer_usage); |
1270 } | 1273 } |
1271 command_line->AppendSwitchASCII(switches::kContentImageTextureTarget, | 1274 command_line->AppendSwitchASCII(switches::kContentImageTextureTarget, |
1272 UintVectorToString(image_targets)); | 1275 UintVectorToString(image_targets)); |
1273 | 1276 |
1274 command_line->AppendSwitchASCII( | 1277 for (size_t format = 0; |
1275 switches::kVideoImageTextureTarget, | 1278 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) { |
1276 base::UintToString(BrowserGpuMemoryBufferManager::GetImageTextureTarget( | 1279 image_targets[format] = |
1277 gfx::BufferFormat::R_8, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE))); | 1280 BrowserGpuMemoryBufferManager::GetImageTextureTarget( |
| 1281 static_cast<gfx::BufferFormat>(format), |
| 1282 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE); |
| 1283 } |
| 1284 command_line->AppendSwitchASCII(switches::kVideoImageTextureTarget, |
| 1285 UintVectorToString(image_targets)); |
1278 | 1286 |
1279 // Appending disable-gpu-feature switches due to software rendering list. | 1287 // Appending disable-gpu-feature switches due to software rendering list. |
1280 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1288 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
1281 DCHECK(gpu_data_manager); | 1289 DCHECK(gpu_data_manager); |
1282 gpu_data_manager->AppendRendererCommandLine(command_line); | 1290 gpu_data_manager->AppendRendererCommandLine(command_line); |
1283 } | 1291 } |
1284 | 1292 |
1285 void RenderProcessHostImpl::AppendRendererCommandLine( | 1293 void RenderProcessHostImpl::AppendRendererCommandLine( |
1286 base::CommandLine* command_line) const { | 1294 base::CommandLine* command_line) const { |
1287 // Pass the process type first, so it shows first in process listings. | 1295 // Pass the process type first, so it shows first in process listings. |
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2744 void RenderProcessHostImpl::GetAudioOutputControllers( | 2752 void RenderProcessHostImpl::GetAudioOutputControllers( |
2745 const GetAudioOutputControllersCallback& callback) const { | 2753 const GetAudioOutputControllersCallback& callback) const { |
2746 audio_renderer_host()->GetOutputControllers(callback); | 2754 audio_renderer_host()->GetOutputControllers(callback); |
2747 } | 2755 } |
2748 | 2756 |
2749 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2757 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2750 return bluetooth_dispatcher_host_.get(); | 2758 return bluetooth_dispatcher_host_.get(); |
2751 } | 2759 } |
2752 | 2760 |
2753 } // namespace content | 2761 } // namespace content |
OLD | NEW |