diff options
author | Robert Phillips <robertphillips@google.com> | 2017-04-13 12:23:54 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-14 15:55:47 +0000 |
commit | dc83b892a0ae431c5fe123a7e6873d63264bd64c (patch) | |
tree | 9f266166998488a7661a674ea1131bf0f7603979 /src/gpu/GrTextureContext.cpp | |
parent | d64756e66e65f1a8ec500819d22bbdd1c96fa28d (diff) |
sk_sp-ify opList creation & storage
Change-Id: Idd4d81cd248ad2b2169028ac2e269a66c9cad26b
Reviewed-on: https://skia-review.googlesource.com/13400
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrTextureContext.cpp')
-rw-r--r-- | src/gpu/GrTextureContext.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gpu/GrTextureContext.cpp b/src/gpu/GrTextureContext.cpp index 76b7588e39..68e94f9be3 100644 --- a/src/gpu/GrTextureContext.cpp +++ b/src/gpu/GrTextureContext.cpp @@ -26,7 +26,7 @@ GrTextureContext::GrTextureContext(GrContext* context, GrSingleOwner* singleOwner) : GrSurfaceContext(context, drawingMgr, std::move(colorSpace), auditTrail, singleOwner) , fTextureProxy(std::move(textureProxy)) - , fOpList(SkSafeRef(fTextureProxy->getLastTextureOpList())) { + , fOpList(sk_ref_sp(fTextureProxy->getLastTextureOpList())) { SkDEBUGCODE(this->validate();) } @@ -36,14 +36,13 @@ void GrTextureContext::validate() const { fTextureProxy->validate(fContext); if (fOpList && !fOpList->isClosed()) { - SkASSERT(fTextureProxy->getLastOpList() == fOpList); + SkASSERT(fTextureProxy->getLastOpList() == fOpList.get()); } } #endif GrTextureContext::~GrTextureContext() { ASSERT_SINGLE_OWNER - SkSafeUnref(fOpList); } GrRenderTargetProxy* GrTextureContext::asRenderTargetProxy() { @@ -63,10 +62,10 @@ GrTextureOpList* GrTextureContext::getOpList() { SkDEBUGCODE(this->validate();) if (!fOpList || fOpList->isClosed()) { - fOpList = this->drawingManager()->newOpList(fTextureProxy.get()); + fOpList = this->drawingManager()->newTextureOpList(fTextureProxy); } - return fOpList; + return fOpList.get(); } // TODO: move this (and GrRenderTargetContext::copy) to GrSurfaceContext? |