aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/ImageBench.cpp
diff options
context:
space:
mode:
authorGravatar hendrikw <hendrikw@chromium.org>2015-11-24 05:50:23 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-24 05:50:23 -0800
commit4870e6d4c9ee76ee328969e82238c7adc371fd33 (patch)
treee9eb46d54f59795c207894f20689d247c7f9ce9f /bench/ImageBench.cpp
parent514450cb695279e44af8b30c19e9d866e2eeb818 (diff)
skia: Holding onto the image in the benchmark causes issues
Skia'a nanobench can hold onto an image, that causes the lifetime of GrGLGpu to extend past that of the GL interface. Kill reference to surface and image before killing the interface Review URL: https://codereview.chromium.org/1472433002
Diffstat (limited to 'bench/ImageBench.cpp')
-rw-r--r--bench/ImageBench.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/bench/ImageBench.cpp b/bench/ImageBench.cpp
index 89fbcd6aef..b81c57c6dc 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) {