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

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl_shm.h

Issue 263553009: content: Cleanup GpuMemoryBuffer allocation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac build fix Created 6 years, 7 months 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_shm.h
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_shm.h b/content/common/gpu/client/gpu_memory_buffer_impl_shm.h
index 9e2682715c6a9d55bcf72e0299a452e1651ade97..961ab52d5a08ccf9d6cd1897d9958f24cc81abdd 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_shm.h
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_shm.h
@@ -9,21 +9,33 @@
namespace content {
-// Provides implementation of a GPU memory buffer based
-// on a shared memory handle.
+// Implementation of GPU memory buffer based on shared memory.
class GpuMemoryBufferImplShm : public GpuMemoryBufferImpl {
public:
- GpuMemoryBufferImplShm(gfx::Size size, unsigned internalformat);
+ GpuMemoryBufferImplShm(const gfx::Size& size, unsigned internalformat);
virtual ~GpuMemoryBufferImplShm();
+ // Allocates a shared memory backed GPU memory buffer with |size| and
+ // |internalformat| for use by |child_process|.
+ static void AllocateSharedMemoryForChildProcess(
+ const gfx::Size& size,
+ unsigned internalformat,
+ base::ProcessHandle child_process,
+ gfx::GpuMemoryBufferHandle* handle);
+
+ static bool IsLayoutSupported(const gfx::Size& size, unsigned internalformat);
static bool IsUsageSupported(unsigned usage);
+ static bool IsConfigurationSupported(const gfx::Size& size,
+ unsigned internalformat,
+ unsigned usage);
- bool Initialize(gfx::GpuMemoryBufferHandle handle);
- bool InitializeFromSharedMemory(scoped_ptr<base::SharedMemory> shared_memory);
+ bool Initialize();
+ bool InitializeFromHandle(gfx::GpuMemoryBufferHandle handle);
// Overridden from gfx::GpuMemoryBuffer:
virtual void* Map() OVERRIDE;
virtual void Unmap() OVERRIDE;
+ virtual uint32 GetStride() const OVERRIDE;
virtual gfx::GpuMemoryBufferHandle GetHandle() const OVERRIDE;
private:
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl_mac.cc ('k') | content/common/gpu/client/gpu_memory_buffer_impl_shm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698