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

Unified Diff: gpu/command_buffer/client/gles2_implementation.h

Issue 14456004: GPU client side changes for GpuMemoryBuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@glapi
Patch Set: More code reviews Created 7 years, 8 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/client/gles2_implementation.h
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index e176c8b20a2ca761346d004833caa93ba7ccc452..d4c581ffac4e2c172386564e398519aade4b54e8 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -16,6 +16,7 @@
#include "base/memory/scoped_ptr.h"
#include "../client/buffer_tracker.h"
#include "../client/client_context_state.h"
+#include "../client/gpu_memory_buffer_factory.h"
#include "../client/gles2_cmd_helper.h"
#include "../client/gles2_interface.h"
#include "../client/query_tracker.h"
@@ -102,6 +103,8 @@ class TransferBufferInterface;
namespace gles2 {
+class GpuMemoryBufferFactory;
+class GpuMemoryBufferTracker;
class VertexArrayObjectManager;
// This class emulates GLES2 over command buffers. It can be used by a client
@@ -219,6 +222,11 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
return share_group_.get();
}
+ // GLES2Implementation owns the |factory|.
+ void SetGpuMemoryBufferFactory(scoped_ptr<GpuMemoryBufferFactory> factory) {
+ gpu_memory_buffer_factory_ = factory.Pass();
+ }
+
private:
friend class GLES2ImplementationTest;
friend class VertexArrayObjectManager;
@@ -407,6 +415,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
void GenTexturesHelper(GLsizei n, const GLuint* textures);
void GenVertexArraysOESHelper(GLsizei n, const GLuint* arrays);
void GenQueriesEXTHelper(GLsizei n, const GLuint* queries);
+ void GenImageBuffersHelper(GLsizei n, const GLuint* imagebuffers);
void DeleteBuffersHelper(GLsizei n, const GLuint* buffers);
void DeleteFramebuffersHelper(GLsizei n, const GLuint* framebuffers);
@@ -416,9 +425,11 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
bool DeleteShaderHelper(GLuint shader);
void DeleteQueriesEXTHelper(GLsizei n, const GLuint* queries);
void DeleteVertexArraysOESHelper(GLsizei n, const GLuint* arrays);
+ void DeleteImageBuffersHelper(GLsizei n, const GLuint* imagebuffers);
void DeleteBuffersStub(GLsizei n, const GLuint* buffers);
void DeleteFramebuffersStub(GLsizei n, const GLuint* framebuffers);
+ void DeleteImageBuffersStub(GLsizei n, const GLuint* imagebuffers);
void DeleteRenderbuffersStub(GLsizei n, const GLuint* renderbuffers);
void DeleteTexturesStub(GLsizei n, const GLuint* textures);
void DeleteProgramStub(GLsizei n, const GLuint* programs);
@@ -435,6 +446,10 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
GLenum target, GLintptr offset, GLsizeiptr size, const void* data,
ScopedTransferBufferPtr* buffer);
+ // Helper for ImageBufferData
+ void CreateGpuMemoryBuffer2DCHROMIUMHelper(
+ GLuint image_id, GLint width, GLint height);
+
// Helper for GetVertexAttrib
bool GetVertexAttribHelper(GLuint index, GLenum pname, uint32* param);
@@ -498,6 +513,8 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
void FailGLError(GLenum /* error */) { }
#endif
+ void GetBoundGpuMemoryBuffer(const char* function_name, GLuint* buffer_id);
+
GLES2Util util_;
GLES2CmdHelper* helper_;
TransferBufferInterface* transfer_buffer_;
@@ -554,6 +571,9 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
GLuint bound_pixel_pack_transfer_buffer_id_;
GLuint bound_pixel_unpack_transfer_buffer_id_;
+ // The currently bound GPU memory buffer
+ GLuint bound_gpu_memory_buffer_id_;
+
// Client side management for vertex array objects. Needed to correctly
// track client side arrays.
scoped_ptr<VertexArrayObjectManager> vertex_array_object_manager_;
@@ -600,10 +620,14 @@ class GLES2_IMPL_EXPORT GLES2Implementation : public GLES2Interface {
scoped_ptr<BufferTracker> buffer_tracker_;
+ scoped_ptr<GpuMemoryBufferTracker> gpu_memory_buffer_tracker_;
+
ErrorMessageCallback* error_message_callback_;
scoped_ptr<std::string> current_trace_name_;
+ scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GLES2Implementation);
};

Powered by Google App Engine
This is Rietveld 408576698