diff options
author | 2017-07-25 16:26:35 -0400 | |
---|---|---|
committer | 2017-07-25 20:52:59 +0000 | |
commit | 3f475d948251e00a1525914469ee72e891bf436c (patch) | |
tree | 022f8e748608fa3f6ba27b97a854c1faa711fab2 /tests | |
parent | ffc2ec46da40776c0b8056bbbaa2f43e92b46729 (diff) |
Update CrossContext Image test to fix memory leak
Bug: skia:
Change-Id: I8c0abf16d5eb366cdc5296f8df9f33cc0e8f4cc4
Reviewed-on: https://skia-review.googlesource.com/26662
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ImageTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index 69b2a2290d..814dc9b971 100644 --- a/tests/ImageTest.cpp +++ b/tests/ImageTest.cpp @@ -906,6 +906,14 @@ DEF_GPUTEST(SkImage_MakeCrossContextRelease, reporter, /*factory*/) { otherTestContext->makeCurrent(); canvas->flush(); + + // This readPixels call is needed for Vulkan to make sure the ReleaseProc is called. + // Even though we flushed above, this does not guarantee the command buffer will finish + // which is when we call the ReleaseProc. The readPixels forces a CPU sync so we know + // that the command buffer has finished and we've called the ReleaseProc. + SkBitmap bitmap; + bitmap.allocPixels(info); + canvas->readPixels(bitmap, 0, 0); } // Case #6: Verify that only one context can be using the image at a time |