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

Unified Diff: services/ui/common/mus_gpu_memory_buffer_manager.cc

Issue 2551743002: gpu: Move native memory buffer configuration into //gpu (Closed)
Patch Set: . Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/common/mus_gpu_memory_buffer_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/common/mus_gpu_memory_buffer_manager.cc
diff --git a/services/ui/common/mus_gpu_memory_buffer_manager.cc b/services/ui/common/mus_gpu_memory_buffer_manager.cc
index 6158144de0c2e3e67d6667a68e0ac7233dd35644..4e3b63a86300d01d4a9d3aeb40ee4124ac2a12d2 100644
--- a/services/ui/common/mus_gpu_memory_buffer_manager.cc
+++ b/services/ui/common/mus_gpu_memory_buffer_manager.cc
@@ -15,7 +15,10 @@ namespace ui {
MusGpuMemoryBufferManager::MusGpuMemoryBufferManager(
mojom::GpuServiceInternal* gpu_service,
int client_id)
- : gpu_service_(gpu_service), client_id_(client_id), weak_factory_(this) {}
+ : gpu_service_(gpu_service),
+ client_id_(client_id),
+ native_configurations_(gpu::GetNativeGpuMemoryBufferConfigurations()),
+ weak_factory_(this) {}
MusGpuMemoryBufferManager::~MusGpuMemoryBufferManager() {}
@@ -29,8 +32,8 @@ MusGpuMemoryBufferManager::CreateGpuMemoryBufferHandle(
gpu::SurfaceHandle surface_handle) {
DCHECK(CalledOnValidThread());
if (gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER) {
- const bool is_native =
- gpu::IsNativeGpuMemoryBufferConfigurationSupported(format, usage);
+ const bool is_native = native_configurations_.find(std::make_pair(
+ format, usage)) != native_configurations_.end();
if (is_native) {
gfx::GpuMemoryBufferHandle handle;
gpu_service_->CreateGpuMemoryBuffer(id, size, format, usage, client_id,
« no previous file with comments | « services/ui/common/mus_gpu_memory_buffer_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698