| 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>();
|
|
|