Index: tools/PictureRenderer.cpp |
=================================================================== |
--- tools/PictureRenderer.cpp (revision 12709) |
+++ tools/PictureRenderer.cpp (working copy) |
@@ -12,6 +12,7 @@ |
#include "SkCanvas.h" |
#include "SkData.h" |
#include "SkDevice.h" |
+#include "SkDiscardableMemoryPool.h" |
#include "SkGPipe.h" |
#if SK_SUPPORT_GPU |
#include "gl/GrGLDefines.h" |
@@ -240,6 +241,25 @@ |
#endif |
} |
+void PictureRenderer::purgeTextures() { |
+ SkDiscardableMemoryPool* pool = SkGetGlobalDiscardableMemoryPool(); |
+ |
+ pool->dumpPool(); |
+ |
+#if SK_SUPPORT_GPU |
+ SkGLContextHelper* glContext = this->getGLContext(); |
+ if (NULL == glContext) { |
+ SkASSERT(kBitmap_DeviceType == fDeviceType); |
+ return; |
+ } |
+ |
+ // resetState should've already done this |
+ fGrContext->flush(); |
+ |
+ fGrContext->purgeAllUnlockedResources(); |
+#endif |
+} |
+ |
uint32_t PictureRenderer::recordFlags() { |
return ((kNone_BBoxHierarchyType == fBBoxHierarchyType) ? 0 : |
SkPicture::kOptimizeForClippedPlayback_RecordingFlag) | |