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

Side by Side Diff: content/browser/gpu/browser_gpu_memory_buffer_manager.cc

Issue 2052003006: More YVU_420 buffers support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address dnicoara's comment. Created 4 years, 6 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
« no previous file with comments | « components/exo/buffer.cc ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 NOTREACHED(); 77 NOTREACHED();
78 return false; 78 return false;
79 } 79 }
80 } 80 }
81 81
82 GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() { 82 GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() {
83 GpuMemoryBufferConfigurationSet configurations; 83 GpuMemoryBufferConfigurationSet configurations;
84 84
85 if (BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled()) { 85 if (BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled()) {
86 const gfx::BufferFormat kNativeFormats[] = { 86 const gfx::BufferFormat kNativeFormats[] = {
87 gfx::BufferFormat::R_8, 87 gfx::BufferFormat::R_8, gfx::BufferFormat::BGR_565,
88 gfx::BufferFormat::BGR_565, 88 gfx::BufferFormat::RGBA_4444, gfx::BufferFormat::RGBA_8888,
89 gfx::BufferFormat::RGBA_4444, 89 gfx::BufferFormat::BGRA_8888, gfx::BufferFormat::UYVY_422,
90 gfx::BufferFormat::RGBA_8888, 90 gfx::BufferFormat::YVU_420, gfx::BufferFormat::YUV_420_BIPLANAR};
91 gfx::BufferFormat::BGRA_8888,
92 gfx::BufferFormat::UYVY_422,
93 gfx::BufferFormat::YUV_420_BIPLANAR};
94 const gfx::BufferUsage kNativeUsages[] = { 91 const gfx::BufferUsage kNativeUsages[] = {
95 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT, 92 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT,
96 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, 93 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE,
97 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT}; 94 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT};
98 for (auto& format : kNativeFormats) { 95 for (auto& format : kNativeFormats) {
99 for (auto& usage : kNativeUsages) { 96 for (auto& usage : kNativeUsages) {
100 if (IsNativeGpuMemoryBufferFactoryConfigurationSupported(format, usage)) 97 if (IsNativeGpuMemoryBufferFactoryConfigurationSupported(format, usage))
101 configurations.insert(std::make_pair(format, usage)); 98 configurations.insert(std::make_pair(format, usage));
102 } 99 }
103 } 100 }
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 : size(other.size), 838 : size(other.size),
842 type(other.type), 839 type(other.type),
843 format(other.format), 840 format(other.format),
844 usage(other.usage), 841 usage(other.usage),
845 gpu_host_id(other.gpu_host_id), 842 gpu_host_id(other.gpu_host_id),
846 buffer(std::move(other.buffer)) {} 843 buffer(std::move(other.buffer)) {}
847 844
848 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} 845 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {}
849 846
850 } // namespace content 847 } // namespace content
OLDNEW
« no previous file with comments | « components/exo/buffer.cc ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698