diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-25 17:26:29 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-25 17:26:29 +0000 |
commit | f41f4d22576c95f0e3ddfc87be40fcf4ee34b408 (patch) | |
tree | f2a5b4af29584a719a69a2b3477ff42153b2c5ce /src | |
parent | edae1416ba6ca8a47e208ed056680677d568dd73 (diff) |
Enable Scratch texture detach in SW path renderer's onDrawPath (take 2)
http://codereview.appspot.com/6331057/
git-svn-id: http://skia.googlecode.com/svn/trunk@4324 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrSoftwarePathRenderer.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrTexture.cpp | 6 |
2 files changed, 2 insertions, 8 deletions
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index bfad6dfb69..5e4f6f1735 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -336,11 +336,7 @@ bool GrSoftwarePathRenderer::onDrawPath(const SkPath& path, if (sw_draw_path_to_mask_texture(path, pathBounds, fill, fContext, translate, &ast, antiAlias)) { -#if 1 - GrTexture* texture = ast.texture(); -#else SkAutoTUnref<GrTexture> texture(ast.detach()); -#endif GrAssert(NULL != texture); GrDrawTarget::AutoDeviceCoordDraw adcd(target, stageMask); enum { diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp index 19dc32220d..8c12bd2d5e 100644 --- a/src/gpu/GrTexture.cpp +++ b/src/gpu/GrTexture.cpp @@ -30,10 +30,8 @@ void GrTexture::internal_dispose() const { nonConstThis->resetFlag((GrTextureFlags) kReturnToCache_FlagBit); nonConstThis->INHERITED::getContext()->addExistingTextureToCache(nonConstThis); - // Note: this next assert is only correct for the texture cache's - // current single threaded usage. If we ever start accessing it via - // threads it isn't guaranteed to be correct. - GrAssert(1 == this->INHERITED::getRefCnt()); + // Note: "this" texture might be freed inside addExistingTextureToCache + // if it is purged. return; } |