Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 1605423002: Make 'kVideoImageTextureTarget' a list of texture targets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TEXTURE_2D for 420 biplanar. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 if (IsForceGpuRasterizationEnabled()) 1248 if (IsForceGpuRasterizationEnabled())
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.
reveman 2016/01/25 18:50:56 nit: Can you add a TODO here for merging this with
Daniele Castagna 2016/01/25 20:49:01 Done.
1259 gfx::BufferUsage buffer_usage = 1259 gfx::BufferUsage buffer_usage =
1260 IsPartialRasterEnabled() 1260 IsPartialRasterEnabled()
1261 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT 1261 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT
1262 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; 1262 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE;
1263 std::vector<unsigned> image_targets( 1263 std::vector<unsigned> image_targets(
1264 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, GL_TEXTURE_2D); 1264 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, GL_TEXTURE_2D);
1265 for (size_t format = 0; 1265 for (size_t format = 0;
1266 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) { 1266 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) {
1267 image_targets[format] = 1267 image_targets[format] =
1268 BrowserGpuMemoryBufferManager::GetImageTextureTarget( 1268 BrowserGpuMemoryBufferManager::GetImageTextureTarget(
1269 static_cast<gfx::BufferFormat>(format), buffer_usage); 1269 static_cast<gfx::BufferFormat>(format), buffer_usage);
1270 } 1270 }
1271 command_line->AppendSwitchASCII(switches::kContentImageTextureTarget, 1271 command_line->AppendSwitchASCII(switches::kContentImageTextureTarget,
1272 UintVectorToString(image_targets)); 1272 UintVectorToString(image_targets));
1273 1273
1274 command_line->AppendSwitchASCII( 1274 for (size_t format = 0;
1275 switches::kVideoImageTextureTarget, 1275 format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) {
1276 base::UintToString(BrowserGpuMemoryBufferManager::GetImageTextureTarget( 1276 image_targets[format] =
1277 gfx::BufferFormat::R_8, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE))); 1277 BrowserGpuMemoryBufferManager::GetImageTextureTarget(
1278 static_cast<gfx::BufferFormat>(format),
1279 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE);
1280 }
1281 command_line->AppendSwitchASCII(switches::kVideoImageTextureTarget,
1282 UintVectorToString(image_targets));
1278 1283
1279 // Appending disable-gpu-feature switches due to software rendering list. 1284 // Appending disable-gpu-feature switches due to software rendering list.
1280 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); 1285 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
1281 DCHECK(gpu_data_manager); 1286 DCHECK(gpu_data_manager);
1282 gpu_data_manager->AppendRendererCommandLine(command_line); 1287 gpu_data_manager->AppendRendererCommandLine(command_line);
1283 } 1288 }
1284 1289
1285 void RenderProcessHostImpl::AppendRendererCommandLine( 1290 void RenderProcessHostImpl::AppendRendererCommandLine(
1286 base::CommandLine* command_line) const { 1291 base::CommandLine* command_line) const {
1287 // Pass the process type first, so it shows first in process listings. 1292 // Pass the process type first, so it shows first in process listings.
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 void RenderProcessHostImpl::GetAudioOutputControllers( 2749 void RenderProcessHostImpl::GetAudioOutputControllers(
2745 const GetAudioOutputControllersCallback& callback) const { 2750 const GetAudioOutputControllersCallback& callback) const {
2746 audio_renderer_host()->GetOutputControllers(callback); 2751 audio_renderer_host()->GetOutputControllers(callback);
2747 } 2752 }
2748 2753
2749 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { 2754 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() {
2750 return bluetooth_dispatcher_host_.get(); 2755 return bluetooth_dispatcher_host_.get();
2751 } 2756 }
2752 2757
2753 } // namespace content 2758 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698