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

Unified Diff: gpu/command_buffer/service/command_buffer_service.h

Issue 20017005: gpu: Refactor GpuMemoryBuffer framework for multi-process support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include proper internalformat support.[D Created 7 years, 5 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: gpu/command_buffer/service/command_buffer_service.h
diff --git a/gpu/command_buffer/service/command_buffer_service.h b/gpu/command_buffer/service/command_buffer_service.h
index 232bdc0a56b66574419a7d5cea86ed1d844be50e..c74772619b7e9c2d2dda608209104226d14a233c 100644
--- a/gpu/command_buffer/service/command_buffer_service.h
+++ b/gpu/command_buffer/service/command_buffer_service.h
@@ -5,22 +5,31 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_
#define GPU_COMMAND_BUFFER_SERVICE_COMMAND_BUFFER_SERVICE_H_
+#include <map>
+
#include "base/callback.h"
#include "base/memory/shared_memory.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/command_buffer_shared.h"
+#include "ui/gfx/gpu_memory_buffer.h"
namespace gpu {
-
+class GpuMemoryBufferFactory;
class TransferBufferManagerInterface;
+namespace gles2 {
+class ImageManager;
+}
+
// An object that implements a shared memory command buffer and a synchronous
// API to manage the put and get pointers.
class GPU_EXPORT CommandBufferService : public CommandBuffer {
public:
typedef base::Callback<bool(int32)> GetBufferChangedCallback;
- explicit CommandBufferService(
- TransferBufferManagerInterface* transfer_buffer_manager);
+ CommandBufferService(
+ TransferBufferManagerInterface* transfer_buffer_manager,
+ gles2::ImageManager* image_manager,
+ GpuMemoryBufferFactory* gpu_memory_buffer_factory);
virtual ~CommandBufferService();
// CommandBuffer implementation:
@@ -39,6 +48,13 @@ class GPU_EXPORT CommandBufferService : public CommandBuffer {
virtual void SetParseError(error::Error error) OVERRIDE;
virtual void SetContextLostReason(error::ContextLostReason) OVERRIDE;
virtual uint32 InsertSyncPoint() OVERRIDE;
+ virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(
+ size_t width,
+ size_t height,
+ unsigned internalformat,
+ int32* id) OVERRIDE;
+ virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE;
+ virtual gfx::GLImage* GetImage(int32 id) OVERRIDE;
// Sets a callback that is called whenever the put offset is changed. When
// called with sync==true, the callback must not return until some progress
@@ -67,6 +83,14 @@ class GPU_EXPORT CommandBufferService : public CommandBuffer {
base::SharedMemory* shared_memory,
size_t size);
+ // Register an existing gpu memory buffer and get an ID that can be used
+ // to identify it in the command buffer.
+ bool RegisterGpuMemoryBuffer(int32 id,
+ gfx::GpuMemoryBufferHandle buffer,
+ size_t width,
+ size_t height,
+ unsigned internalformat);
+
private:
int32 ring_buffer_id_;
Buffer ring_buffer_;
@@ -83,6 +107,10 @@ class GPU_EXPORT CommandBufferService : public CommandBuffer {
uint32 generation_;
error::Error error_;
error::ContextLostReason context_lost_reason_;
+ GpuMemoryBufferFactory* gpu_memory_buffer_factory_;
+ gles2::ImageManager* image_manager_;
+ typedef std::map<int32, gfx::GpuMemoryBuffer*> GpuMemoryBufferMap;
+ GpuMemoryBufferMap gpu_memory_buffers_;
DISALLOW_COPY_AND_ASSIGN(CommandBufferService);
};

Powered by Google App Engine
This is Rietveld 408576698