From 97c6a0ee41bb1af9cc81695590e2bb97ec85fecf Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Wed, 11 Jul 2018 14:56:22 -0400 Subject: Remove interal use of SkRefCnt_SafeAssign. It turns out that SkDeviceProfile is no longer used and can just be deleted. The ResourceCacheTest and DebugGLTestContext are changed to use smart pointers where possible. This also clarifies the squirrelly part of the test. DebugGLTestContext is going away soon anyway. Change-Id: I95ef24afa58aa4d356429b93d4dec0d72e3fd827 Reviewed-on: https://skia-review.googlesource.com/140577 Reviewed-by: Brian Salomon Commit-Queue: Ben Wagner --- tools/gpu/gl/debug/DebugGLTestContext.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/gpu/gl/debug/DebugGLTestContext.cpp b/tools/gpu/gl/debug/DebugGLTestContext.cpp index 3a2c0b93f6..01e151cb76 100644 --- a/tools/gpu/gl/debug/DebugGLTestContext.cpp +++ b/tools/gpu/gl/debug/DebugGLTestContext.cpp @@ -789,7 +789,7 @@ public: GrGLvoid bindVertexArray(GrGLuint id) override { GrVertexArrayObj* array = FIND(id, GrVertexArrayObj, kVertexArray_ObjTypes); GrAlwaysAssert((0 == id) || array); - this->setVertexArray(array); + this->setVertexArray(sk_ref_sp(array)); } GrGLvoid bindBuffer(GrGLenum target, GrGLuint bufferID) override { @@ -939,7 +939,7 @@ private: GrGLuint fCurrTextureUnit; GrTextureUnitObj* fTextureUnits[kDefaultMaxTextureUnits]; GrBufferObj* fBoundBuffers[kNumBufferTargets]; - GrVertexArrayObj* fVertexArray; + sk_sp fVertexArray; GrGLint fPackRowLength; GrGLint fUnpackRowLength; GrGLint fPackAlignment; @@ -1089,14 +1089,14 @@ private: fBoundBuffers[buffIdx] = buffer; } - void setVertexArray(GrVertexArrayObj* vertexArray) { + void setVertexArray(sk_sp vertexArray) { if (vertexArray) { SkASSERT(!vertexArray->getDeleted()); } - SkRefCnt_SafeAssign(fVertexArray, vertexArray); + fVertexArray = std::move(vertexArray); } - GrVertexArrayObj* getVertexArray() { return fVertexArray; } + GrVertexArrayObj* getVertexArray() { return fVertexArray.get(); } void setTexture(GrTextureObj *texture) { fTextureUnits[fCurrTextureUnit]->setTexture(texture); -- cgit v1.2.3