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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_ozone.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/gpu_memory_buffer_factory_ozone.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory_ozone.cc b/content/common/gpu/gpu_memory_buffer_factory_ozone.cc
index 4259a4653f5e3d9177b0ffa156716529a02ad049..f2a296e72b6d56c6ac5d23452c5fb0a84e61823b 100644
--- a/content/common/gpu/gpu_memory_buffer_factory_ozone.cc
+++ b/content/common/gpu/gpu_memory_buffer_factory_ozone.cc
@@ -18,26 +18,34 @@ class GpuMemoryBufferFactoryImpl : public GpuMemoryBufferFactory,
public:
// Overridden from GpuMemoryBufferFactory:
virtual gfx::GpuMemoryBufferHandle CreateGpuMemoryBuffer(
- const gfx::GpuMemoryBufferHandle& handle,
+ gfx::GpuMemoryBufferType type,
+ gfx::GpuMemoryBufferId id,
const gfx::Size& size,
gfx::GpuMemoryBuffer::Format format,
- gfx::GpuMemoryBuffer::Usage usage) override {
- switch (handle.type) {
- case gfx::OZONE_NATIVE_BUFFER:
- return ozone_buffer_factory_.CreateGpuMemoryBuffer(
- handle.global_id, size, format, usage)
- ? handle
- : gfx::GpuMemoryBufferHandle();
+ gfx::GpuMemoryBuffer::Usage usage,
+ int client_id) override {
+ switch (type) {
+ case gfx::OZONE_NATIVE_BUFFER: {
+ if (!ozone_buffer_factory_.CreateGpuMemoryBuffer(
+ id, size, format, usage, client_id)) {
+ return gfx::GpuMemoryBufferHandle();
+ }
+ gfx::GpuMemoryBufferHandle handle;
+ handle.type = gfx::OZONE_NATIVE_BUFFER;
+ handle.id = id;
+ return handle;
+ }
default:
NOTREACHED();
return gfx::GpuMemoryBufferHandle();
}
}
- virtual void DestroyGpuMemoryBuffer(
- const gfx::GpuMemoryBufferHandle& handle) override {
- switch (handle.type) {
+ virtual void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferType type,
+ gfx::GpuMemoryBufferId id,
+ int client_id) override {
+ switch (type) {
case gfx::OZONE_NATIVE_BUFFER:
- ozone_buffer_factory_.DestroyGpuMemoryBuffer(handle.global_id);
+ ozone_buffer_factory_.DestroyGpuMemoryBuffer(id, client_id);
break;
default:
NOTREACHED();
@@ -63,12 +71,8 @@ class GpuMemoryBufferFactoryImpl : public GpuMemoryBufferFactory,
return image;
}
case gfx::OZONE_NATIVE_BUFFER:
- // Verify that client is the owner of the buffer we're about to use.
- if (handle.global_id.secondary_id != client_id)
- return scoped_refptr<gfx::GLImage>();
-
return ozone_buffer_factory_.CreateImageForGpuMemoryBuffer(
- handle.global_id, size, format, internalformat);
+ handle.id, size, format, internalformat, client_id);
default:
NOTREACHED();
return scoped_refptr<gfx::GLImage>();
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_mac.cc ('k') | content/common/gpu/gpu_memory_buffer_factory_surface_texture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698