Index: src/gpu/gl/GrGLTransferBuffer.cpp |
diff --git a/src/gpu/gl/GrGLIndexBuffer.cpp b/src/gpu/gl/GrGLTransferBuffer.cpp |
old mode 100644 |
new mode 100755 |
similarity index 50% |
copy from src/gpu/gl/GrGLIndexBuffer.cpp |
copy to src/gpu/gl/GrGLTransferBuffer.cpp |
index 230d9a46933ac757c2fe71662c80cda1be409be3..b7ee766d92844fee961954cfbda95ccb62be38fe |
--- a/src/gpu/gl/GrGLIndexBuffer.cpp |
+++ b/src/gpu/gl/GrGLTransferBuffer.cpp |
@@ -1,21 +1,21 @@ |
/* |
- * Copyright 2011 Google Inc. |
+ * Copyright 2015 Google Inc. |
* |
* Use of this source code is governed by a BSD-style license that can be |
* found in the LICENSE file. |
*/ |
-#include "GrGLIndexBuffer.h" |
+#include "GrGLTransferBuffer.h" |
#include "GrGLGpu.h" |
#include "SkTraceMemoryDump.h" |
-GrGLIndexBuffer::GrGLIndexBuffer(GrGLGpu* gpu, const Desc& desc) |
- : INHERITED(gpu, desc.fSizeInBytes, desc.fDynamic, 0 == desc.fID) |
- , fImpl(gpu, desc, GR_GL_ELEMENT_ARRAY_BUFFER) { |
+GrGLTransferBuffer::GrGLTransferBuffer(GrGLGpu* gpu, const Desc& desc, GrGLenum type) |
+ : INHERITED(gpu, desc.fSizeInBytes) |
+ , fImpl(gpu, desc, type) { |
this->registerWithCache(); |
} |
-void GrGLIndexBuffer::onRelease() { |
+void GrGLTransferBuffer::onRelease() { |
if (!this->wasDestroyed()) { |
fImpl.release(this->getGpuGL()); |
} |
@@ -23,12 +23,12 @@ void GrGLIndexBuffer::onRelease() { |
INHERITED::onRelease(); |
} |
-void GrGLIndexBuffer::onAbandon() { |
+void GrGLTransferBuffer::onAbandon() { |
fImpl.abandon(); |
INHERITED::onAbandon(); |
} |
-void* GrGLIndexBuffer::onMap() { |
+void* GrGLTransferBuffer::onMap() { |
if (!this->wasDestroyed()) { |
return fImpl.map(this->getGpuGL()); |
} else { |
@@ -36,22 +36,14 @@ void* GrGLIndexBuffer::onMap() { |
} |
} |
-void GrGLIndexBuffer::onUnmap() { |
+void GrGLTransferBuffer::onUnmap() { |
if (!this->wasDestroyed()) { |
fImpl.unmap(this->getGpuGL()); |
} |
} |
-bool GrGLIndexBuffer::onUpdateData(const void* src, size_t srcSizeInBytes) { |
- if (!this->wasDestroyed()) { |
- return fImpl.updateData(this->getGpuGL(), src, srcSizeInBytes); |
- } else { |
- return false; |
- } |
-} |
- |
-void GrGLIndexBuffer::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, |
- const SkString& dumpName) const { |
+void GrGLTransferBuffer::setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, |
+ const SkString& dumpName) const { |
SkString buffer_id; |
buffer_id.appendU32(this->bufferID()); |
traceMemoryDump->setMemoryBacking(dumpName.c_str(), "gl_buffer", |