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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 command_line->AppendSwitch(switches::kEnableGpuRasterization); | 1131 command_line->AppendSwitch(switches::kEnableGpuRasterization); |
1132 | 1132 |
1133 int msaa_sample_count = GpuRasterizationMSAASampleCount(); | 1133 int msaa_sample_count = GpuRasterizationMSAASampleCount(); |
1134 if (msaa_sample_count >= 0) { | 1134 if (msaa_sample_count >= 0) { |
1135 command_line->AppendSwitchASCII(switches::kGpuRasterizationMSAASampleCount, | 1135 command_line->AppendSwitchASCII(switches::kGpuRasterizationMSAASampleCount, |
1136 base::IntToString(msaa_sample_count)); | 1136 base::IntToString(msaa_sample_count)); |
1137 } | 1137 } |
1138 | 1138 |
1139 if (IsZeroCopyUploadEnabled()) | 1139 if (IsZeroCopyUploadEnabled()) |
1140 command_line->AppendSwitch(switches::kEnableZeroCopy); | 1140 command_line->AppendSwitch(switches::kEnableZeroCopy); |
1141 if (IsPersistentGpuMemoryBufferEnabled()) | 1141 if (IsPartialRasterEnabled()) |
1142 command_line->AppendSwitch(switches::kEnablePersistentGpuMemoryBuffer); | 1142 command_line->AppendSwitch(switches::kEnablePartialRaster); |
1143 | 1143 |
1144 if (IsForceGpuRasterizationEnabled()) | 1144 if (IsForceGpuRasterizationEnabled()) |
1145 command_line->AppendSwitch(switches::kForceGpuRasterization); | 1145 command_line->AppendSwitch(switches::kForceGpuRasterization); |
1146 | 1146 |
1147 gfx::BufferUsage buffer_usage = IsPersistentGpuMemoryBufferEnabled() | 1147 // Persistent buffers may come at a performance hit (not all platform specific |
| 1148 // buffers support it), so only enable them if partial raster is enabled and |
| 1149 // we are actually going to use them. |
| 1150 gfx::BufferUsage buffer_usage = IsPartialRasterEnabled() |
1148 ? gfx::BufferUsage::PERSISTENT_MAP | 1151 ? gfx::BufferUsage::PERSISTENT_MAP |
1149 : gfx::BufferUsage::MAP; | 1152 : gfx::BufferUsage::MAP; |
1150 std::vector<unsigned> image_targets( | 1153 std::vector<unsigned> image_targets( |
1151 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, GL_TEXTURE_2D); | 1154 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, GL_TEXTURE_2D); |
1152 for (size_t format = 0; | 1155 for (size_t format = 0; |
1153 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) { | 1156 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) { |
1154 image_targets[format] = | 1157 image_targets[format] = |
1155 BrowserGpuMemoryBufferManager::GetImageTextureTarget( | 1158 BrowserGpuMemoryBufferManager::GetImageTextureTarget( |
1156 static_cast<gfx::BufferFormat>(format), buffer_usage); | 1159 static_cast<gfx::BufferFormat>(format), buffer_usage); |
1157 } | 1160 } |
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2532 void RenderProcessHostImpl::GetAudioOutputControllers( | 2535 void RenderProcessHostImpl::GetAudioOutputControllers( |
2533 const GetAudioOutputControllersCallback& callback) const { | 2536 const GetAudioOutputControllersCallback& callback) const { |
2534 audio_renderer_host()->GetOutputControllers(callback); | 2537 audio_renderer_host()->GetOutputControllers(callback); |
2535 } | 2538 } |
2536 | 2539 |
2537 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2540 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
2538 return bluetooth_dispatcher_host_.get(); | 2541 return bluetooth_dispatcher_host_.get(); |
2539 } | 2542 } |
2540 | 2543 |
2541 } // namespace content | 2544 } // namespace content |
OLD | NEW |