aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLTransferBuffer.h
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2015-12-02 13:06:37 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-02 13:06:37 -0800
commitfa498fe12239988578465d0dee69f0d5645bb361 (patch)
tree25965bd3f33b4fae893403855d1a9e03d558be49 /src/gpu/gl/GrGLTransferBuffer.h
parentf16f88b779f802bb3c9892e6f1275fe980e956a1 (diff)
Add transfer buffer support.
Diffstat (limited to 'src/gpu/gl/GrGLTransferBuffer.h')
-rwxr-xr-xsrc/gpu/gl/GrGLTransferBuffer.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLTransferBuffer.h b/src/gpu/gl/GrGLTransferBuffer.h
new file mode 100755
index 0000000000..ff9caeea74
--- /dev/null
+++ b/src/gpu/gl/GrGLTransferBuffer.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrGLTransferBuffer_DEFINED
+#define GrGLTransferBuffer_DEFINED
+
+#include "GrTransferBuffer.h"
+#include "GrGLBufferImpl.h"
+#include "gl/GrGLInterface.h"
+
+class GrGLGpu;
+
+class GrGLTransferBuffer : public GrTransferBuffer {
+
+public:
+ typedef GrGLBufferImpl::Desc Desc;
+
+ GrGLTransferBuffer(GrGLGpu* gpu, const Desc& desc, GrGLenum type);
+
+ GrGLuint bufferID() const { return fImpl.bufferID(); }
+ size_t baseOffset() const { return fImpl.baseOffset(); }
+
+protected:
+ void onAbandon() override;
+ void onRelease() override;
+ void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
+ const SkString& dumpName) const override;
+
+private:
+ void* onMap() override;
+ void onUnmap() override;
+
+ GrGLGpu* getGpuGL() const {
+ SkASSERT(!this->wasDestroyed());
+ return (GrGLGpu*)(this->getGpu());
+ }
+
+ GrGLBufferImpl fImpl;
+
+ typedef GrTransferBuffer INHERITED;
+};
+
+#endif