| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef GrGLTransferBuffer_DEFINED | 8 #ifndef GrGLTransferBuffer_DEFINED |
| 9 #define GrGLTransferBuffer_DEFINED | 9 #define GrGLTransferBuffer_DEFINED |
| 10 | 10 |
| 11 #include "GrTransferBuffer.h" | 11 #include "GrTransferBuffer.h" |
| 12 #include "GrGLBufferImpl.h" | 12 #include "GrGLBufferImpl.h" |
| 13 #include "gl/GrGLInterface.h" | 13 #include "gl/GrGLInterface.h" |
| 14 | 14 |
| 15 class GrGLGpu; | 15 class GrGLGpu; |
| 16 | 16 |
| 17 class GrGLTransferBuffer : public GrTransferBuffer { | 17 class GrGLTransferBuffer : public GrTransferBuffer { |
| 18 | 18 |
| 19 public: | 19 public: |
| 20 typedef GrGLBufferImpl::Desc Desc; | 20 typedef GrGLBufferImpl::Desc Desc; |
| 21 | 21 |
| 22 GrGLTransferBuffer(GrGLGpu* gpu, const Desc& desc, GrGLenum type); | 22 GrGLTransferBuffer(GrGLGpu* gpu, const Desc& desc, GrGLenum type); |
| 23 | 23 |
| 24 GrGLuint bufferID() const { return fImpl.bufferID(); } | 24 GrGLuint bufferID() const { return fImpl.bufferID(); } |
| 25 size_t baseOffset() const { return fImpl.baseOffset(); } | 25 size_t baseOffset() const { return fImpl.baseOffset(); } |
| 26 GrGLenum bufferType() const { return fImpl.bufferType(); } |
| 26 | 27 |
| 27 protected: | 28 protected: |
| 28 void onAbandon() override; | 29 void onAbandon() override; |
| 29 void onRelease() override; | 30 void onRelease() override; |
| 30 void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, | 31 void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, |
| 31 const SkString& dumpName) const override; | 32 const SkString& dumpName) const override; |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 void* onMap() override; | 35 void* onMap() override; |
| 35 void onUnmap() override; | 36 void onUnmap() override; |
| 36 | 37 |
| 37 GrGLGpu* getGpuGL() const { | 38 GrGLGpu* getGpuGL() const { |
| 38 SkASSERT(!this->wasDestroyed()); | 39 SkASSERT(!this->wasDestroyed()); |
| 39 return (GrGLGpu*)(this->getGpu()); | 40 return (GrGLGpu*)(this->getGpu()); |
| 40 } | 41 } |
| 41 | 42 |
| 42 GrGLBufferImpl fImpl; | 43 GrGLBufferImpl fImpl; |
| 43 | 44 |
| 44 typedef GrTransferBuffer INHERITED; | 45 typedef GrTransferBuffer INHERITED; |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 #endif | 48 #endif |
| OLD | NEW |