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

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc

Issue 458313002: Browser side OZONE_NATIVE_BUFFER allocation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_mac.cc b/content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc
similarity index 81%
copy from content/common/gpu/client/gpu_memory_buffer_impl_mac.cc
copy to content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc
index 24e39a6ce761cfa1cb736228f9e468da6af6ec17..2784685debdba2a57fed5f74d4c92980e6457557 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_mac.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_ozone.cc
@@ -4,7 +4,7 @@
#include "content/common/gpu/client/gpu_memory_buffer_impl.h"
-#include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h"
+#include "content/common/gpu/client/gpu_memory_buffer_impl_ozone_native_buffer.h"
#include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h"
namespace content {
@@ -33,7 +33,14 @@ void GpuMemoryBufferImpl::AllocateForChildProcess(
unsigned internalformat,
unsigned usage,
base::ProcessHandle child_process,
+ int child_id,
const AllocationCallback& callback) {
+ if (GpuMemoryBufferImplOzoneNativeBuffer::IsConfigurationSupported(
+ internalformat, usage)) {
+ GpuMemoryBufferImplOzoneNativeBuffer::AllocateOzoneNativeBufferForChildId(
+ size, internalformat, usage, child_id, callback);
+ return;
+ }
if (GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
size, internalformat, usage)) {
GpuMemoryBufferImplSharedMemory::AllocateSharedMemoryForChildProcess(
@@ -65,9 +72,9 @@ scoped_ptr<GpuMemoryBufferImpl> GpuMemoryBufferImpl::CreateFromHandle(
return buffer.PassAs<GpuMemoryBufferImpl>();
}
- case gfx::IO_SURFACE_BUFFER: {
- scoped_ptr<GpuMemoryBufferImplIOSurface> buffer(
- new GpuMemoryBufferImplIOSurface(size, internalformat));
+ case gfx::OZONE_NATIVE_BUFFER: {
+ scoped_ptr<GpuMemoryBufferImplOzoneNativeBuffer> buffer(
+ new GpuMemoryBufferImplOzoneNativeBuffer(size, internalformat));
if (!buffer->InitializeFromHandle(handle))
return scoped_ptr<GpuMemoryBufferImpl>();

Powered by Google App Engine
This is Rietveld 408576698