diff options
author | 2011-07-26 03:44:05 +0000 | |
---|---|---|
committer | 2011-07-26 03:44:05 +0000 | |
commit | ec36471096d50ed24e259aca2c61e3406ed1a4f5 (patch) | |
tree | 37022f4b1019466556ce5de8d9c88e59f9b65440 /gpu/src/GrGLIndexBuffer.cpp | |
parent | 1f1658985586b30c913dbc935f17ce1aabcdf7b5 (diff) |
Revert "Add sizeInBytes to GrResource, make GrRenderTarget aware of its pixel config (r1951)"
Temporarily revert this change in order to roll other changes into Chrome.
TBR=bsalomon@google.com
Review URL: http://codereview.appspot.com/4807051
git-svn-id: http://skia.googlecode.com/svn/trunk@1958 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 579311a514..1d3f89319d 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, this->sizeInBytes(), NULL, - this->dynamic() ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW)); + GR_GL(BufferData(GR_GL_ELEMENT_ARRAY_BUFFER, size(), NULL, + 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 > this->sizeInBytes()) { + if (srcSizeInBytes > size()) { return false; } this->bind(); GrGLenum usage = dynamic() ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW; - if (this->sizeInBytes() == srcSizeInBytes) { + if (size() == 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, this->sizeInBytes(), NULL, usage)); + GR_GL(BufferData(GR_GL_ELEMENT_ARRAY_BUFFER, size(), 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 > this->sizeInBytes()) { + if (srcSizeInBytes + offset > size()) { return false; } this->bind(); |