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

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

Issue 968283002: content: Remove use of GLImage from GpuMemoryBufferImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add size check to gmb code Created 5 years, 9 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 | « no previous file | content/common/gpu/client/command_buffer_proxy_impl.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 "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/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 BufferMap& buffers = clients_[child_client_id]; 133 BufferMap& buffers = clients_[child_client_id];
134 DCHECK(buffers.find(new_id) == buffers.end()); 134 DCHECK(buffers.find(new_id) == buffers.end());
135 135
136 // Fallback to shared memory buffer if |format| and |usage| are not supported 136 // Fallback to shared memory buffer if |format| and |usage| are not supported
137 // by factory. 137 // by factory.
138 if (!gpu_memory_buffer_factory_host_->IsGpuMemoryBufferConfigurationSupported( 138 if (!gpu_memory_buffer_factory_host_->IsGpuMemoryBufferConfigurationSupported(
139 format, usage)) { 139 format, usage)) {
140 // Early out if we cannot fallback to shared memory buffer. 140 // Early out if we cannot fallback to shared memory buffer.
141 if (!GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) || 141 if (!GpuMemoryBufferImplSharedMemory::IsFormatSupported(format) ||
142 !GpuMemoryBufferImplSharedMemory::IsSizeValidForFormat(size, format) ||
142 usage != gfx::GpuMemoryBuffer::MAP) { 143 usage != gfx::GpuMemoryBuffer::MAP) {
143 callback.Run(gfx::GpuMemoryBufferHandle()); 144 callback.Run(gfx::GpuMemoryBufferHandle());
144 return; 145 return;
145 } 146 }
146 147
147 buffers[new_id] = gfx::SHARED_MEMORY_BUFFER; 148 buffers[new_id] = gfx::SHARED_MEMORY_BUFFER;
148 callback.Run(GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( 149 callback.Run(GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
149 new_id, size, format, child_process_handle)); 150 new_id, size, format, child_process_handle));
150 return; 151 return;
151 } 152 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 DCHECK_NE(handle.type, gfx::SHARED_MEMORY_BUFFER); 317 DCHECK_NE(handle.type, gfx::SHARED_MEMORY_BUFFER);
317 318
318 // Store the type of this buffer so it can be cleaned up if the child 319 // Store the type of this buffer so it can be cleaned up if the child
319 // process is removed. 320 // process is removed.
320 buffer_it->second = handle.type; 321 buffer_it->second = handle.type;
321 322
322 callback.Run(handle); 323 callback.Run(handle);
323 } 324 }
324 325
325 } // namespace content 326 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698