Chromium Code Reviews| Index: src/gpu/gl/GrGLBuffer.h |
| diff --git a/src/gpu/gl/GrGLBuffer.h b/src/gpu/gl/GrGLBuffer.h |
| index b3b4feb00273bbc33733d58265e79f382cd46ec9..84d05be382b74e1641e0e4c5da231362c3a56880 100644 |
| --- a/src/gpu/gl/GrGLBuffer.h |
| +++ b/src/gpu/gl/GrGLBuffer.h |
| @@ -27,6 +27,15 @@ public: |
| GrGLuint bufferID() const { return fBufferID; } |
| size_t baseOffset() const { return reinterpret_cast<size_t>(fCPUData); } |
| + /** |
| + * Returns the actual size of the underlying GL buffer object. In certain cases we may make this |
| + * smaller than the size reported by GrBuffer. |
| + */ |
| + size_t glSizeInBytes() const { return fGLSizeInBytes; } |
| + |
| + void setHasAttachedToTexture() { fHasAttachedToTexture = true; } |
|
bsalomon
2016/04/11 16:51:38
Maybe (set)isAttachedToTexture? More clear that is
Chris Dalton
2016/04/11 19:48:19
Actually the intention of this bool is to know if
bsalomon
2016/04/11 20:37:11
Got it. I'm ok with it as is.
|
| + bool hasAttachedToTexture() const { return fHasAttachedToTexture; } |
| + |
| protected: |
| GrGLBuffer(GrGLGpu*, size_t size, GrBufferType intendedType, GrAccessPattern, bool cpuBacked, |
| const void* data); |
| @@ -53,8 +62,8 @@ private: |
| GrGLuint fBufferID; |
| size_t fSizeInBytes; |
| GrGLenum fUsage; |
| - size_t fGLSizeInBytes; // In certain cases we make the size of the GL buffer object |
| - // smaller or larger than the size in fDesc. |
| + size_t fGLSizeInBytes; |
| + bool fHasAttachedToTexture; |
| typedef GrBuffer INHERITED; |
| }; |