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 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 DCHECK_IMPLIES(IsZeroCopyUploadEnabled(), !IsOneCopyUploadEnabled()); | 1101 DCHECK_IMPLIES(IsZeroCopyUploadEnabled(), !IsOneCopyUploadEnabled()); |
1102 DCHECK_IMPLIES(IsOneCopyUploadEnabled(), !IsZeroCopyUploadEnabled()); | 1102 DCHECK_IMPLIES(IsOneCopyUploadEnabled(), !IsZeroCopyUploadEnabled()); |
1103 if (IsZeroCopyUploadEnabled()) | 1103 if (IsZeroCopyUploadEnabled()) |
1104 command_line->AppendSwitch(switches::kEnableZeroCopy); | 1104 command_line->AppendSwitch(switches::kEnableZeroCopy); |
1105 if (!IsOneCopyUploadEnabled()) | 1105 if (!IsOneCopyUploadEnabled()) |
1106 command_line->AppendSwitch(switches::kDisableOneCopy); | 1106 command_line->AppendSwitch(switches::kDisableOneCopy); |
1107 | 1107 |
1108 if (IsForceGpuRasterizationEnabled()) | 1108 if (IsForceGpuRasterizationEnabled()) |
1109 command_line->AppendSwitch(switches::kForceGpuRasterization); | 1109 command_line->AppendSwitch(switches::kForceGpuRasterization); |
1110 | 1110 |
1111 if (BrowserGpuChannelHostFactory::IsGpuMemoryBufferFactoryUsageEnabled( | 1111 command_line->AppendSwitchASCII( |
1112 gfx::GpuMemoryBuffer::MAP)) { | 1112 switches::kUseImageTextureTarget, |
1113 std::vector<gfx::GpuMemoryBufferType> supported_types; | 1113 base::UintToString( |
1114 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); | 1114 BrowserGpuChannelHostFactory::GetImageTextureTarget())); |
1115 DCHECK(!supported_types.empty()); | |
1116 | |
1117 // The GPU service will always use the preferred type. | |
1118 gfx::GpuMemoryBufferType type = supported_types[0]; | |
1119 | |
1120 switch (type) { | |
1121 case gfx::SURFACE_TEXTURE_BUFFER: | |
1122 // Surface texture backed GPU memory buffers require | |
1123 // TEXTURE_EXTERNAL_OES. | |
1124 command_line->AppendSwitchASCII( | |
1125 switches::kUseImageTextureTarget, | |
1126 gpu::gles2::GLES2Util::GetStringEnum(GL_TEXTURE_EXTERNAL_OES)); | |
1127 break; | |
1128 case gfx::IO_SURFACE_BUFFER: | |
1129 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB. | |
1130 command_line->AppendSwitchASCII( | |
1131 switches::kUseImageTextureTarget, | |
1132 gpu::gles2::GLES2Util::GetStringEnum(GL_TEXTURE_RECTANGLE_ARB)); | |
1133 break; | |
1134 default: | |
1135 break; | |
1136 } | |
1137 } | |
1138 | 1115 |
1139 // Appending disable-gpu-feature switches due to software rendering list. | 1116 // Appending disable-gpu-feature switches due to software rendering list. |
1140 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 1117 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
1141 DCHECK(gpu_data_manager); | 1118 DCHECK(gpu_data_manager); |
1142 gpu_data_manager->AppendRendererCommandLine(command_line); | 1119 gpu_data_manager->AppendRendererCommandLine(command_line); |
1143 } | 1120 } |
1144 | 1121 |
1145 void RenderProcessHostImpl::AppendRendererCommandLine( | 1122 void RenderProcessHostImpl::AppendRendererCommandLine( |
1146 base::CommandLine* command_line) const { | 1123 base::CommandLine* command_line) const { |
1147 // Pass the process type first, so it shows first in process listings. | 1124 // Pass the process type first, so it shows first in process listings. |
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2413 if (worker_ref_count_ == 0) | 2390 if (worker_ref_count_ == 0) |
2414 Cleanup(); | 2391 Cleanup(); |
2415 } | 2392 } |
2416 | 2393 |
2417 void RenderProcessHostImpl::GetAudioOutputControllers( | 2394 void RenderProcessHostImpl::GetAudioOutputControllers( |
2418 const GetAudioOutputControllersCallback& callback) const { | 2395 const GetAudioOutputControllersCallback& callback) const { |
2419 audio_renderer_host()->GetOutputControllers(callback); | 2396 audio_renderer_host()->GetOutputControllers(callback); |
2420 } | 2397 } |
2421 | 2398 |
2422 } // namespace content | 2399 } // namespace content |
OLD | NEW |