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

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

Issue 685983005: gpu: Associate all GpuMemoryBuffers with unique IDs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more ozone build fix Created 6 years, 1 month 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_shared_memory.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc b/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc
index dbaf09c6679fbe5644cb1f5d28f61f63f42c2733..9a2ae220c3a56a2470743c6149722b52ec586a03 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc
@@ -17,11 +17,12 @@ void Noop(uint32 sync_point) {
} // namespace
GpuMemoryBufferImplSharedMemory::GpuMemoryBufferImplSharedMemory(
+ gfx::GpuMemoryBufferId id,
const gfx::Size& size,
Format format,
const DestructionCallback& callback,
scoped_ptr<base::SharedMemory> shared_memory)
- : GpuMemoryBufferImpl(size, format, callback),
+ : GpuMemoryBufferImpl(id, size, format, callback),
shared_memory_(shared_memory.Pass()) {
}
@@ -29,7 +30,8 @@ GpuMemoryBufferImplSharedMemory::~GpuMemoryBufferImplSharedMemory() {
}
// static
-void GpuMemoryBufferImplSharedMemory::Create(const gfx::Size& size,
+void GpuMemoryBufferImplSharedMemory::Create(gfx::GpuMemoryBufferId id,
+ const gfx::Size& size,
Format format,
const CreationCallback& callback) {
DCHECK(IsLayoutSupported(size, format));
@@ -42,11 +44,12 @@ void GpuMemoryBufferImplSharedMemory::Create(const gfx::Size& size,
callback.Run(
make_scoped_ptr<GpuMemoryBufferImpl>(new GpuMemoryBufferImplSharedMemory(
- size, format, base::Bind(&Noop), shared_memory.Pass())));
+ id, size, format, base::Bind(&Noop), shared_memory.Pass())));
}
// static
void GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
+ gfx::GpuMemoryBufferId id,
const gfx::Size& size,
Format format,
base::ProcessHandle child_process,
@@ -60,6 +63,7 @@ void GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
}
gfx::GpuMemoryBufferHandle handle;
handle.type = gfx::SHARED_MEMORY_BUFFER;
+ handle.id = id;
shared_memory.GiveToProcess(child_process, &handle.handle);
callback.Run(handle);
}
@@ -78,6 +82,7 @@ GpuMemoryBufferImplSharedMemory::CreateFromHandle(
return make_scoped_ptr<GpuMemoryBufferImpl>(
new GpuMemoryBufferImplSharedMemory(
+ handle.id,
size,
format,
callback,
@@ -152,6 +157,7 @@ uint32 GpuMemoryBufferImplSharedMemory::GetStride() const {
gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSharedMemory::GetHandle() const {
gfx::GpuMemoryBufferHandle handle;
handle.type = gfx::SHARED_MEMORY_BUFFER;
+ handle.id = id_;
handle.handle = shared_memory_->handle();
return handle;
}

Powered by Google App Engine
This is Rietveld 408576698