diff options
author | Ben Wagner <bungeman@google.com> | 2018-07-11 14:56:22 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-11 20:31:18 +0000 |
commit | 97c6a0ee41bb1af9cc81695590e2bb97ec85fecf (patch) | |
tree | 9e6de14afba4ecbfa913196c92ae4f078da10be7 /tools | |
parent | 4eebd9eed06039d265f06edb759765731f963271 (diff) |
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 <bsalomon@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gpu/gl/debug/DebugGLTestContext.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<GrVertexArrayObj> fVertexArray; GrGLint fPackRowLength; GrGLint fUnpackRowLength; GrGLint fPackAlignment; @@ -1089,14 +1089,14 @@ private: fBoundBuffers[buffIdx] = buffer; } - void setVertexArray(GrVertexArrayObj* vertexArray) { + void setVertexArray(sk_sp<GrVertexArrayObj> 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); |