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>
This commit is contained in:
parent
ffc2ec46da
commit
3f475d9482
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user