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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_android.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_android.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory_android.cc b/content/common/gpu/gpu_memory_buffer_factory_android.cc
index 4c9226364bd66ce85d07cbb61ef1a882e3c5a1e9..1fce6b676154824bd0455da5ed50553777d11ce8 100644
--- a/content/common/gpu/gpu_memory_buffer_factory_android.cc
+++ b/content/common/gpu/gpu_memory_buffer_factory_android.cc
@@ -18,24 +18,27 @@ 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) {
+ gfx::GpuMemoryBuffer::Usage usage,
+ int client_id) override {
+ switch (type) {
case gfx::SURFACE_TEXTURE_BUFFER:
return surface_texture_factory_.CreateGpuMemoryBuffer(
- handle.global_id, size, format);
+ id, size, format, client_id);
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::SURFACE_TEXTURE_BUFFER:
- surface_texture_factory_.DestroyGpuMemoryBuffer(handle.global_id);
+ surface_texture_factory_.DestroyGpuMemoryBuffer(id, client_id);
break;
default:
NOTREACHED();
@@ -61,12 +64,8 @@ class GpuMemoryBufferFactoryImpl : public GpuMemoryBufferFactory,
return image;
}
case gfx::SURFACE_TEXTURE_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 surface_texture_factory_.CreateImageForGpuMemoryBuffer(
- handle.global_id, size, internalformat);
+ handle.id, size, internalformat, client_id);
}
default:
NOTREACHED();
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory.h ('k') | content/common/gpu/gpu_memory_buffer_factory_io_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698