Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: tools/PictureRenderer.cpp

Issue 117583002: Update bench pictures to time image decode & upload costs (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fixed comment Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/PictureRenderer.h ('k') | tools/bench_pictures_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) |
« no previous file with comments | « tools/PictureRenderer.h ('k') | tools/bench_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698