diff options
author | hendrikw <hendrikw@chromium.org> | 2015-11-24 05:50:23 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-24 05:50:23 -0800 |
commit | 4870e6d4c9ee76ee328969e82238c7adc371fd33 (patch) | |
tree | e9eb46d54f59795c207894f20689d247c7f9ce9f /bench/ImageBench.cpp | |
parent | 514450cb695279e44af8b30c19e9d866e2eeb818 (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.cpp | 7 |
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) { |