diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp index 15aae1e2dc..f8e81a3b80 100644 --- a/src/gpu/GrClipMaskManager.cpp +++ b/src/gpu/GrClipMaskManager.cpp @@ -121,6 +121,15 @@ bool GrClipMaskManager::createClipMask(GrGpu* gpu, } #endif // GR_AA_CLIP + // Either a hard (stencil buffer) clip was explicitly requested or + // an antialiased clip couldn't be created. In either case, free up + // the texture in the antialiased mask cache. + // TODO: this may require more investigation. Ganesh performs a lot of + // utility draws (e.g., clears, InOderDrawBuffer playbacks) that hit + // the stencil buffer path. These may be incorrectly messing up the + // AA cache. + fAACache.reset(); + GrRect bounds; GrRect rtRect; rtRect.setLTRB(0, 0, diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 5ec6511b9f..bd6d829095 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -67,6 +67,11 @@ GrContext* GrContext::Create(GrEngine engine, GrContext::~GrContext() { this->flush(); + + // Since the gpu can hold scratch textures, give it a chance to let go + // of them before freeing the texture cache + fGpu->purgeResources(); + delete fTextureCache; delete fFontCache; delete fDrawBuffer;