From d41dc171496e20e6918909b4a34776eada4b7862 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Fri, 1 Sep 2017 11:40:08 -0400 Subject: With threaded software paths, free mask memory earlier This alleviates memory pressure in my benchmarking, and makes a measurable impact on overall time when drawing many SW paths. Bug: skia: Change-Id: Iacabc9aa51522578da9f4d9411995b8d4fd381ba Reviewed-on: https://skia-review.googlesource.com/41848 Commit-Queue: Brian Osman Commit-Queue: Mike Klein Reviewed-by: Brian Salomon Reviewed-by: Mike Klein --- src/gpu/GrSoftwarePathRenderer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp index 1363e1ae7c..3070d4d459 100644 --- a/src/gpu/GrSoftwarePathRenderer.cpp +++ b/src/gpu/GrSoftwarePathRenderer.cpp @@ -205,6 +205,9 @@ public: this->fPixels.width(), this->fPixels.height(), kAlpha_8_GrPixelConfig, this->fPixels.addr(), this->fPixels.rowBytes()); + // Free this memory immediately, so it can be recycled. This avoids memory pressure + // when there is a large amount of threaded work still running during flush. + this->fPixels.reset(); } }; flushState->addASAPUpload(std::move(uploadMask)); -- cgit v1.2.3