diff options
author | 2015-12-02 13:06:37 -0800 | |
---|---|---|
committer | 2015-12-02 13:06:37 -0800 | |
commit | fa498fe12239988578465d0dee69f0d5645bb361 (patch) | |
tree | 25965bd3f33b4fae893403855d1a9e03d558be49 /src/gpu/gl/GrGLTransferBuffer.h | |
parent | f16f88b779f802bb3c9892e6f1275fe980e956a1 (diff) |
Add transfer buffer support.
BUG=skia:4604
Review URL: https://codereview.chromium.org/1490473003
Diffstat (limited to 'src/gpu/gl/GrGLTransferBuffer.h')
-rwxr-xr-x | src/gpu/gl/GrGLTransferBuffer.h | 47 |
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 |