diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-18 08:24:24 +0200 |
commit | fc61780b35af913801d72086456f493f63197da6 (patch) | |
tree | f85891288a7bd988da9f0f15ae64e5c63f00d493 /gfx/angle/src/libANGLE/Buffer.h | |
parent | 69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff) | |
parent | 50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff) | |
download | UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.gz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.lz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.tar.xz UXP-9ccb235f04529c1ec345d87dad6521cb567d20bb.zip |
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts:
# browser/app/profile/firefox.js
# browser/components/preferences/jar.mn
Diffstat (limited to 'gfx/angle/src/libANGLE/Buffer.h')
-rwxr-xr-x | gfx/angle/src/libANGLE/Buffer.h | 72 |
1 files changed, 24 insertions, 48 deletions
diff --git a/gfx/angle/src/libANGLE/Buffer.h b/gfx/angle/src/libANGLE/Buffer.h index dba4d5adf..6c951ef58 100755 --- a/gfx/angle/src/libANGLE/Buffer.h +++ b/gfx/angle/src/libANGLE/Buffer.h @@ -20,20 +20,35 @@ namespace rx { class BufferImpl; -class GLImplFactory; }; namespace gl { -class Buffer; -class BufferState final : angle::NonCopyable +class Buffer final : public RefCountObject, public LabeledObject { public: - BufferState(); - ~BufferState(); + Buffer(rx::BufferImpl *impl, GLuint id); + virtual ~Buffer(); + + void setLabel(const std::string &label) override; + const std::string &getLabel() const override; + + Error bufferData(const void *data, GLsizeiptr size, GLenum usage); + Error bufferSubData(const void *data, GLsizeiptr size, GLintptr offset); + Error copyBufferSubData(Buffer* source, GLintptr sourceOffset, GLintptr destOffset, GLsizeiptr size); + Error map(GLenum access); + Error mapRange(GLintptr offset, GLsizeiptr length, GLbitfield access); + Error unmap(GLboolean *result); + + void onTransformFeedback(); + void onPixelUnpack(); - const std::string &getLabel(); + Error getIndexRange(GLenum type, + size_t offset, + size_t count, + bool primitiveRestartEnabled, + IndexRange *outRange) const; GLenum getUsage() const { return mUsage; } GLbitfield getAccessFlags() const { return mAccessFlags; } @@ -44,8 +59,10 @@ class BufferState final : angle::NonCopyable GLint64 getMapLength() const { return mMapLength; } GLint64 getSize() const { return mSize; } + rx::BufferImpl *getImplementation() const { return mBuffer; } + private: - friend class Buffer; + rx::BufferImpl *mBuffer; std::string mLabel; @@ -57,47 +74,6 @@ class BufferState final : angle::NonCopyable GLvoid *mMapPointer; GLint64 mMapOffset; GLint64 mMapLength; -}; - -class Buffer final : public RefCountObject, public LabeledObject -{ - public: - Buffer(rx::GLImplFactory *factory, GLuint id); - ~Buffer() override; - - void setLabel(const std::string &label) override; - const std::string &getLabel() const override; - - Error bufferData(GLenum target, const void *data, GLsizeiptr size, GLenum usage); - Error bufferSubData(GLenum target, const void *data, GLsizeiptr size, GLintptr offset); - Error copyBufferSubData(Buffer* source, GLintptr sourceOffset, GLintptr destOffset, GLsizeiptr size); - Error map(GLenum access); - Error mapRange(GLintptr offset, GLsizeiptr length, GLbitfield access); - Error unmap(GLboolean *result); - - void onTransformFeedback(); - void onPixelUnpack(); - - Error getIndexRange(GLenum type, - size_t offset, - size_t count, - bool primitiveRestartEnabled, - IndexRange *outRange) const; - - GLenum getUsage() const { return mState.mUsage; } - GLbitfield getAccessFlags() const { return mState.mAccessFlags; } - GLenum getAccess() const { return mState.mAccess; } - GLboolean isMapped() const { return mState.mMapped; } - GLvoid *getMapPointer() const { return mState.mMapPointer; } - GLint64 getMapOffset() const { return mState.mMapOffset; } - GLint64 getMapLength() const { return mState.mMapLength; } - GLint64 getSize() const { return mState.mSize; } - - rx::BufferImpl *getImplementation() const { return mImpl; } - - private: - BufferState mState; - rx::BufferImpl *mImpl; mutable IndexRangeCache mIndexRangeCache; }; |