diff options
author | 2011-07-26 12:32:36 +0000 | |
---|---|---|
committer | 2011-07-26 12:32:36 +0000 | |
commit | cee661af926cc977addc6e039b7022975a448ace (patch) | |
tree | 4552e0f7f1fa4f9a93a8e18e176876de066941ee /gpu/src/GrGLIndexBuffer.cpp | |
parent | ec36471096d50ed24e259aca2c61e3406ed1a4f5 (diff) |
Reapply r1951.
git-svn-id: http://skia.googlecode.com/svn/trunk@1959 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(); |