From 9291c758490f36fb7139e2a6a8c341e118037d3a Mon Sep 17 00:00:00 2001 From: reveman Date: Mon, 26 Oct 2015 19:39:11 -0700 Subject: ui: Add support for creating GLImage instances from shared memory pools. This adds an offset field to the GpuMemoryBufferHandle struct that allows shared memory backed GLImages to be created from a pool of shared memory. This is useful when importing buffers as it allows the clients to manage the memory used for buffers. BUG=538325 TEST=gl_unittests --gtest_filter=GLImageSharedMemoryPool/GLImageCopyTest/0.CopyTexImage CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1417363006 Cr-Commit-Position: refs/heads/master@{#356212} --- cc/test/test_gpu_memory_buffer_manager.cc | 1 + cc/test/test_image_factory.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'cc') diff --git a/cc/test/test_gpu_memory_buffer_manager.cc b/cc/test/test_gpu_memory_buffer_manager.cc index 78fa6ad..a37ff93 100644 --- a/cc/test/test_gpu_memory_buffer_manager.cc +++ b/cc/test/test_gpu_memory_buffer_manager.cc @@ -56,6 +56,7 @@ class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { gfx::GpuMemoryBufferHandle handle; handle.type = gfx::SHARED_MEMORY_BUFFER; handle.handle = shared_memory_->handle(); + handle.offset = 0; return handle; } ClientBuffer AsClientBuffer() override { diff --git a/cc/test/test_image_factory.cc b/cc/test/test_image_factory.cc index aaf61ac..796b6d8 100644 --- a/cc/test/test_image_factory.cc +++ b/cc/test/test_image_factory.cc @@ -24,7 +24,7 @@ scoped_refptr TestImageFactory::CreateImageForGpuMemoryBuffer( scoped_refptr image( new gfx::GLImageSharedMemory(size, internalformat)); - if (!image->Initialize(handle.handle, handle.id, format)) + if (!image->Initialize(handle.handle, handle.id, format, handle.offset)) return nullptr; return image; -- cgit v1.1