diff options
author | 2011-07-25 17:41:12 +0000 | |
---|---|---|
committer | 2011-07-25 17:41:12 +0000 | |
commit | aab1fd921c9fd2f52f5a1db46d2cfd665500b164 (patch) | |
tree | 1ea6387309de35268a07d43a43f2be279731748a /gpu/src/GrGLIndexBuffer.cpp | |
parent | 4067d7d5cdbf6d052cf1519c79db82bad9e47b7e (diff) |
Add sizeInBytes to GrResource, make GrRenderTarget aware of its pixel config
Review URL: http://codereview.appspot.com/4802058/
git-svn-id: http://skia.googlecode.com/svn/trunk@1951 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrGLIndexBuffer.cpp')
-rw-r--r-- | gpu/src/GrGLIndexBuffer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gpu/src/GrGLIndexBuffer.cpp b/gpu/src/GrGLIndexBuffer.cpp index 1d3f89319d..579311a514 100644 --- a/gpu/src/GrGLIndexBuffer.cpp +++ b/gpu/src/GrGLIndexBuffer.cpp @@ -59,8 +59,8 @@ void* GrGLIndexBuffer::lock() { if (GPUGL->supportsBufferLocking()) { this->bind(); // Let driver know it can discard the old data - GR_GL(BufferData(GR_GL_ELEMENT_ARRAY_BUFFER, size(), NULL, - dynamic() ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW)); + GR_GL(BufferData(GR_GL_ELEMENT_ARRAY_BUFFER, this->sizeInBytes(), NULL, + this->dynamic() ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW)); fLockPtr = GR_GL(MapBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, GR_GL_WRITE_ONLY)); return fLockPtr; @@ -98,16 +98,16 @@ bool GrGLIndexBuffer::isLocked() const { bool GrGLIndexBuffer::updateData(const void* src, size_t srcSizeInBytes) { GrAssert(fBufferID); GrAssert(!isLocked()); - if (srcSizeInBytes > size()) { + if (srcSizeInBytes > this->sizeInBytes()) { return false; } this->bind(); GrGLenum usage = dynamic() ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW; - if (size() == srcSizeInBytes) { + if (this->sizeInBytes() == srcSizeInBytes) { GR_GL(BufferData(GR_GL_ELEMENT_ARRAY_BUFFER, srcSizeInBytes, src, usage)); } else { #if GR_GL_USE_BUFFER_DATA_NULL_HINT - GR_GL(BufferData(GR_GL_ELEMENT_ARRAY_BUFFER, size(), NULL, usage)); + GR_GL(BufferData(GR_GL_ELEMENT_ARRAY_BUFFER, this->sizeInBytes(), NULL, usage)); #endif GR_GL(BufferSubData(GR_GL_ELEMENT_ARRAY_BUFFER, 0, srcSizeInBytes, src)); } @@ -119,7 +119,7 @@ bool GrGLIndexBuffer::updateSubData(const void* src, size_t offset) { GrAssert(fBufferID); GrAssert(!isLocked()); - if (srcSizeInBytes + offset > size()) { + if (srcSizeInBytes + offset > this->sizeInBytes()) { return false; } this->bind(); |