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

Unified Diff: bench/ImageBench.cpp

Issue 1472433002: skia: Holding onto the image in the benchmark causes issues (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add a comment Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/ImageBench.cpp
diff --git a/bench/ImageBench.cpp b/bench/ImageBench.cpp
index 89fbcd6aeff48565cd9b163c4bcb13e43296e5d2..b81c57c6dcb09b8402a7b7bd394ae8f91e1976ee 100644
--- a/bench/ImageBench.cpp
+++ b/bench/ImageBench.cpp
@@ -39,6 +39,13 @@ protected:
fRasterSurface.reset(SkSurface::NewRaster(info));
}
+ void onPerCanvasPostDraw(SkCanvas*) override {
+ // Release the image and raster surface here to prevent out of order destruction
+ // between these and the gpu interface.
+ fRasterSurface.reset(nullptr);
+ fImage.reset(nullptr);
+ }
+
void onDraw(int loops, SkCanvas*) override {
for (int i = 0; i < loops; i++) {
for (int inner = 0; inner < 10; ++inner) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698