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

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

Issue 1282313002: Add YUV_420_BIPLANAR to gfx::BufferFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmb-planes
Patch Set: Rebase Created 5 years, 4 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 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 "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 if (enable_native_gpu_memory_buffers) { 108 if (enable_native_gpu_memory_buffers) {
109 const GpuMemoryBufferFactory::Configuration kNativeConfigurations[] = { 109 const GpuMemoryBufferFactory::Configuration kNativeConfigurations[] = {
110 {gfx::BufferFormat::R_8, gfx::BufferUsage::MAP}, 110 {gfx::BufferFormat::R_8, gfx::BufferUsage::MAP},
111 {gfx::BufferFormat::R_8, gfx::BufferUsage::PERSISTENT_MAP}, 111 {gfx::BufferFormat::R_8, gfx::BufferUsage::PERSISTENT_MAP},
112 {gfx::BufferFormat::RGBA_4444, gfx::BufferUsage::MAP}, 112 {gfx::BufferFormat::RGBA_4444, gfx::BufferUsage::MAP},
113 {gfx::BufferFormat::RGBA_4444, gfx::BufferUsage::PERSISTENT_MAP}, 113 {gfx::BufferFormat::RGBA_4444, gfx::BufferUsage::PERSISTENT_MAP},
114 {gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::MAP}, 114 {gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::MAP},
115 {gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::PERSISTENT_MAP}, 115 {gfx::BufferFormat::RGBA_8888, gfx::BufferUsage::PERSISTENT_MAP},
116 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::MAP}, 116 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::MAP},
117 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::PERSISTENT_MAP}}; 117 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::PERSISTENT_MAP},
118 {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::MAP},
119 {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::PERSISTENT_MAP},
120 };
118 for (auto& configuration : kNativeConfigurations) { 121 for (auto& configuration : kNativeConfigurations) {
119 if (IsGpuMemoryBufferFactoryConfigurationSupported(type, configuration)) 122 if (IsGpuMemoryBufferFactoryConfigurationSupported(type, configuration))
120 configurations.push_back(configuration); 123 configurations.push_back(configuration);
121 } 124 }
122 } 125 }
123 126
124 #if defined(USE_OZONE) || defined(OS_MACOSX) 127 #if defined(USE_OZONE) || defined(OS_MACOSX)
125 const GpuMemoryBufferFactory::Configuration kScanoutConfigurations[] = { 128 const GpuMemoryBufferFactory::Configuration kScanoutConfigurations[] = {
126 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::SCANOUT}, 129 {gfx::BufferFormat::BGRA_8888, gfx::BufferUsage::SCANOUT},
127 {gfx::BufferFormat::RGBX_8888, gfx::BufferUsage::SCANOUT}}; 130 {gfx::BufferFormat::RGBX_8888, gfx::BufferUsage::SCANOUT},
131 {gfx::BufferFormat::YUV_420_BIPLANAR, gfx::BufferUsage::SCANOUT},
132 };
128 for (auto& configuration : kScanoutConfigurations) { 133 for (auto& configuration : kScanoutConfigurations) {
129 if (IsGpuMemoryBufferFactoryConfigurationSupported(type, configuration)) 134 if (IsGpuMemoryBufferFactoryConfigurationSupported(type, configuration))
130 configurations.push_back(configuration); 135 configurations.push_back(configuration);
131 } 136 }
132 #endif 137 #endif
133 138
134 return configurations; 139 return configurations;
135 } 140 }
136 141
137 BrowserGpuMemoryBufferManager* g_gpu_memory_buffer_manager = nullptr; 142 BrowserGpuMemoryBufferManager* g_gpu_memory_buffer_manager = nullptr;
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 return gpu_client_tracing_id_; 620 return gpu_client_tracing_id_;
616 } 621 }
617 622
618 // In normal cases, |client_id| is a child process id, so we can perform 623 // In normal cases, |client_id| is a child process id, so we can perform
619 // the standard conversion. 624 // the standard conversion.
620 return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId( 625 return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId(
621 client_id); 626 client_id);
622 } 627 }
623 628
624 } // namespace content 629 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698