diff options
author | Brian Osman <brianosman@google.com> | 2017-09-01 11:40:08 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-01 16:03:27 +0000 |
commit | d41dc171496e20e6918909b4a34776eada4b7862 (patch) | |
tree | 030f9d6006f11a359bed5bde518f9a4d3f37e2c5 | |
parent | adbbfa6c06e2dd5f4feb8acb3f820a4ddeb14dbb (diff) |
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 <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
-rw-r--r-- | src/gpu/GrSoftwarePathRenderer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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)); |