Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(857)

Unified Diff: src/gpu/gl/GrGLTransferBuffer.cpp

Issue 1490473003: Add transfer buffer support. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix roll issue Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLTransferBuffer.h ('k') | src/gpu/gl/GrGLVertexBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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",
« no previous file with comments | « src/gpu/gl/GrGLTransferBuffer.h ('k') | src/gpu/gl/GrGLVertexBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698