diff options
author | dcastagna <dcastagna@chromium.org> | 2016-01-26 16:07:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-27 00:08:02 +0000 |
commit | 5077d6dc8037fdc2e19c70270083ec5b28e0fe89 (patch) | |
tree | b863ababc81d833e6efad271d846a3aad6afe7bc /content/browser | |
parent | 0864941d980504348a135738d8f061d4fb2267f5 (diff) | |
download | chromium_src-5077d6dc8037fdc2e19c70270083ec5b28e0fe89.zip chromium_src-5077d6dc8037fdc2e19c70270083ec5b28e0fe89.tar.gz chromium_src-5077d6dc8037fdc2e19c70270083ec5b28e0fe89.tar.bz2 |
Make 'kVideoImageTextureTarget' a list of texture targets.
Pass to the renderer a list of texture targets, one per GpuMemoryBuffer
format, via a command line argument.
In this way GMBVFP can pick whatever GMB format it needs to use and bind
to the correct texture target.
This is similar to what we do for content (kContentImageTextureTarget).
kContentImageTextureTarget can't be used since the buffer usage could
differ from the buffer usage in GMBVFP.
Once all GMB formats supports persistent usage and we can consolidate
GPU_READ_CPU_READ_WRITE_PERSISTENT and GPU_READ_CPU_READ_WRITE this
code can go away and we can use just one command line switch.
BUG=524582
Review URL: https://codereview.chromium.org/1605423002
Cr-Commit-Position: refs/heads/master@{#371644}
Diffstat (limited to 'content/browser')
-rw-r--r-- | content/browser/renderer_host/render_process_host_impl.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index e5a1a98..90d4f0d 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1283,6 +1283,9 @@ static void AppendCompositorCommandLineFlags(base::CommandLine* command_line) { // Persistent buffers may come at a performance hit (not all platform specific // buffers support it), so only enable them if partial raster is enabled and // we are actually going to use them. + // TODO(dcastagna): Once GPU_READ_CPU_READ_WRITE_PERSISTENT is removed + // kContentImageTextureTarget and kVideoImageTextureTarget can be merged into + // one flag. gfx::BufferUsage buffer_usage = IsPartialRasterEnabled() ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT @@ -1298,10 +1301,15 @@ static void AppendCompositorCommandLineFlags(base::CommandLine* command_line) { command_line->AppendSwitchASCII(switches::kContentImageTextureTarget, UintVectorToString(image_targets)); - command_line->AppendSwitchASCII( - switches::kVideoImageTextureTarget, - base::UintToString(BrowserGpuMemoryBufferManager::GetImageTextureTarget( - gfx::BufferFormat::R_8, gfx::BufferUsage::GPU_READ_CPU_READ_WRITE))); + for (size_t format = 0; + format < static_cast<size_t>(gfx::BufferFormat::LAST) + 1; format++) { + image_targets[format] = + BrowserGpuMemoryBufferManager::GetImageTextureTarget( + static_cast<gfx::BufferFormat>(format), + gfx::BufferUsage::GPU_READ_CPU_READ_WRITE); + } + command_line->AppendSwitchASCII(switches::kVideoImageTextureTarget, + UintVectorToString(image_targets)); // Appending disable-gpu-feature switches due to software rendering list. GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |