diff options
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGLIndexBuffer.cpp | 8 | ||||
-rw-r--r-- | src/gpu/gl/GrGLIndexBuffer.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGLPath.h | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLStencilBuffer.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLStencilBuffer.h | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLVertexArray.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGLVertexArray.h | 8 | ||||
-rw-r--r-- | src/gpu/gl/GrGLVertexBuffer.cpp | 8 | ||||
-rw-r--r-- | src/gpu/gl/GrGLVertexBuffer.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 2 |
10 files changed, 21 insertions, 21 deletions
diff --git a/src/gpu/gl/GrGLIndexBuffer.cpp b/src/gpu/gl/GrGLIndexBuffer.cpp index b6290b1826..4e7f989ce0 100644 --- a/src/gpu/gl/GrGLIndexBuffer.cpp +++ b/src/gpu/gl/GrGLIndexBuffer.cpp @@ -14,7 +14,7 @@ GrGLIndexBuffer::GrGLIndexBuffer(GrGpuGL* gpu, const Desc& desc) } void GrGLIndexBuffer::onRelease() { - if (this->isValid()) { + if (!this->wasDestroyed()) { fImpl.release(this->getGpuGL()); } @@ -27,7 +27,7 @@ void GrGLIndexBuffer::onAbandon() { } void* GrGLIndexBuffer::lock() { - if (this->isValid()) { + if (!this->wasDestroyed()) { return fImpl.lock(this->getGpuGL()); } else { return NULL; @@ -39,7 +39,7 @@ void* GrGLIndexBuffer::lockPtr() const { } void GrGLIndexBuffer::unlock() { - if (this->isValid()) { + if (!this->wasDestroyed()) { fImpl.unlock(this->getGpuGL()); } } @@ -49,7 +49,7 @@ bool GrGLIndexBuffer::isLocked() const { } bool GrGLIndexBuffer::updateData(const void* src, size_t srcSizeInBytes) { - if (this->isValid()) { + if (!this->wasDestroyed()) { return fImpl.updateData(this->getGpuGL(), src, srcSizeInBytes); } else { return false; diff --git a/src/gpu/gl/GrGLIndexBuffer.h b/src/gpu/gl/GrGLIndexBuffer.h index 32a8086063..893e357173 100644 --- a/src/gpu/gl/GrGLIndexBuffer.h +++ b/src/gpu/gl/GrGLIndexBuffer.h @@ -26,7 +26,7 @@ public: size_t baseOffset() const { return fImpl.baseOffset(); } void bind() const { - if (this->isValid()) { + if (!this->wasDestroyed()) { fImpl.bind(this->getGpuGL()); } } @@ -45,7 +45,7 @@ protected: private: GrGpuGL* getGpuGL() const { - SkASSERT(this->isValid()); + SkASSERT(!this->wasDestroyed()); return (GrGpuGL*)(this->getGpu()); } diff --git a/src/gpu/gl/GrGLPath.h b/src/gpu/gl/GrGLPath.h index 3647d4d628..3409547b2b 100644 --- a/src/gpu/gl/GrGLPath.h +++ b/src/gpu/gl/GrGLPath.h @@ -27,7 +27,7 @@ public: GrGLuint pathID() const { return fPathID; } // TODO: Figure out how to get an approximate size of the path in Gpu // memory. - virtual size_t sizeInBytes() const SK_OVERRIDE { return 100; } + virtual size_t gpuMemorySize() const SK_OVERRIDE { return 100; } protected: virtual void onRelease() SK_OVERRIDE; diff --git a/src/gpu/gl/GrGLStencilBuffer.cpp b/src/gpu/gl/GrGLStencilBuffer.cpp index 33e346c617..abcb3c4ba0 100644 --- a/src/gpu/gl/GrGLStencilBuffer.cpp +++ b/src/gpu/gl/GrGLStencilBuffer.cpp @@ -13,7 +13,7 @@ GrGLStencilBuffer::~GrGLStencilBuffer() { this->release(); } -size_t GrGLStencilBuffer::sizeInBytes() const { +size_t GrGLStencilBuffer::gpuMemorySize() const { uint64_t size = this->width(); size *= this->height(); size *= fFormat.fTotalBits; diff --git a/src/gpu/gl/GrGLStencilBuffer.h b/src/gpu/gl/GrGLStencilBuffer.h index 2bf33ef7b2..1cb0a3301a 100644 --- a/src/gpu/gl/GrGLStencilBuffer.h +++ b/src/gpu/gl/GrGLStencilBuffer.h @@ -36,7 +36,7 @@ public: virtual ~GrGLStencilBuffer(); - virtual size_t sizeInBytes() const SK_OVERRIDE; + virtual size_t gpuMemorySize() const SK_OVERRIDE; GrGLuint renderbufferID() const { return fRenderbufferID; diff --git a/src/gpu/gl/GrGLVertexArray.cpp b/src/gpu/gl/GrGLVertexArray.cpp index abd337a806..66feb82053 100644 --- a/src/gpu/gl/GrGLVertexArray.cpp +++ b/src/gpu/gl/GrGLVertexArray.cpp @@ -69,7 +69,7 @@ void GrGLAttribArrayState::disableUnusedArrays(const GrGpuGL* gpu, uint64_t used /////////////////////////////////////////////////////////////////////////////////////////////////// GrGLVertexArray::GrGLVertexArray(GrGpuGL* gpu, GrGLint id, int attribCount) - : GrResource(gpu, false) + : INHERITED(gpu, false) , fID(id) , fAttribArrays(attribCount) , fIndexBufferIDIsValid(false) { diff --git a/src/gpu/gl/GrGLVertexArray.h b/src/gpu/gl/GrGLVertexArray.h index 8a61f1a2c6..0e5bffe4c1 100644 --- a/src/gpu/gl/GrGLVertexArray.h +++ b/src/gpu/gl/GrGLVertexArray.h @@ -8,7 +8,7 @@ #ifndef GrGLVertexArray_DEFINED #define GrGLVertexArray_DEFINED -#include "GrResource.h" +#include "GrGpuObject.h" #include "GrTypesPriv.h" #include "gl/GrGLDefines.h" #include "gl/GrGLFunctions.h" @@ -130,7 +130,7 @@ private: * This class represents an OpenGL vertex array object. It manages the lifetime of the vertex array * and is used to track the state of the vertex array to avoid redundant GL calls. */ -class GrGLVertexArray : public GrResource { +class GrGLVertexArray : public GrGpuObject { public: GrGLVertexArray(GrGpuGL* gpu, GrGLint id, int attribCount); @@ -157,7 +157,7 @@ public: void invalidateCachedState(); - virtual size_t sizeInBytes() const SK_OVERRIDE { return 0; } + virtual size_t gpuMemorySize() const SK_OVERRIDE { return 0; } protected: virtual void onAbandon() SK_OVERRIDE; @@ -170,7 +170,7 @@ private: GrGLuint fIndexBufferID; bool fIndexBufferIDIsValid; - typedef GrResource INHERITED; + typedef GrGpuObject INHERITED; }; #endif diff --git a/src/gpu/gl/GrGLVertexBuffer.cpp b/src/gpu/gl/GrGLVertexBuffer.cpp index 685166c90b..8bfe1f0c96 100644 --- a/src/gpu/gl/GrGLVertexBuffer.cpp +++ b/src/gpu/gl/GrGLVertexBuffer.cpp @@ -14,7 +14,7 @@ GrGLVertexBuffer::GrGLVertexBuffer(GrGpuGL* gpu, const Desc& desc) } void GrGLVertexBuffer::onRelease() { - if (this->isValid()) { + if (!this->wasDestroyed()) { fImpl.release(this->getGpuGL()); } @@ -28,7 +28,7 @@ void GrGLVertexBuffer::onAbandon() { } void* GrGLVertexBuffer::lock() { - if (this->isValid()) { + if (!this->wasDestroyed()) { return fImpl.lock(this->getGpuGL()); } else { return NULL; @@ -40,7 +40,7 @@ void* GrGLVertexBuffer::lockPtr() const { } void GrGLVertexBuffer::unlock() { - if (this->isValid()) { + if (!this->wasDestroyed()) { fImpl.unlock(this->getGpuGL()); } } @@ -50,7 +50,7 @@ bool GrGLVertexBuffer::isLocked() const { } bool GrGLVertexBuffer::updateData(const void* src, size_t srcSizeInBytes) { - if (this->isValid()) { + if (!this->wasDestroyed()) { return fImpl.updateData(this->getGpuGL(), src, srcSizeInBytes); } else { return false; diff --git a/src/gpu/gl/GrGLVertexBuffer.h b/src/gpu/gl/GrGLVertexBuffer.h index 1741adc23d..1b9c4f17be 100644 --- a/src/gpu/gl/GrGLVertexBuffer.h +++ b/src/gpu/gl/GrGLVertexBuffer.h @@ -26,7 +26,7 @@ public: size_t baseOffset() const { return fImpl.baseOffset(); } void bind() const { - if (this->isValid()) { + if (!this->wasDestroyed()) { fImpl.bind(this->getGpuGL()); } } @@ -45,7 +45,7 @@ protected: private: GrGpuGL* getGpuGL() const { - SkASSERT(this->isValid()); + SkASSERT(!this->wasDestroyed()); return (GrGpuGL*)(this->getGpu()); } diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 9b92fe25da..1a1bad7f28 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -2788,7 +2788,7 @@ GrGLAttribArrayState* GrGpuGL::HWGeometryState::bindArrayAndBuffersToDraw( // We use a vertex array if we're on a core profile and the verts are in a VBO. if (gpu->glCaps().isCoreProfile() && !vbuffer->isCPUBacked()) { - if (NULL == fVBOVertexArray || !fVBOVertexArray->isValid()) { + if (NULL == fVBOVertexArray || fVBOVertexArray->wasDestroyed()) { SkSafeUnref(fVBOVertexArray); GrGLuint arrayID; GR_GL_CALL(gpu->glInterface(), GenVertexArrays(1, &arrayID)); |