diff options
author | Brian Salomon <bsalomon@google.com> | 2017-11-17 09:25:23 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-17 16:22:56 +0000 |
commit | 55ad77481290384038d7638ac4136ebf32a4ee2b (patch) | |
tree | c5c99f170efa149a933d0839c7ae96645e25c243 /tests/ImageTest.cpp | |
parent | 3e4d1fde7fab46875cb70e23003b40aac262f0bc (diff) |
Revert "Revert "Add method to sk_gpu_test::TestContext to automatically restore the previous context.""
This reverts commit 1e09e461d2ffcf8b07242cfe93dd7d12c4d75866.
Change-Id: I95d5544a7baaa078536790493ce4119816a77e94
Reviewed-on: https://skia-review.googlesource.com/72903
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests/ImageTest.cpp')
-rw-r--r-- | tests/ImageTest.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index 30ae635c98..d18e6a9674 100644 --- a/tests/ImageTest.cpp +++ b/tests/ImageTest.cpp @@ -436,10 +436,10 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkImage_makeTextureImage, reporter, contextIn // Create a texture image. [context] { return create_gpu_image(context); }, // Create a texture image in a another GrContext. - [testContext, otherContextInfo] { - otherContextInfo.testContext()->makeCurrent(); + [otherContextInfo] { + auto restore = otherContextInfo.testContext()->makeCurrentAndAutoRestore(); sk_sp<SkImage> otherContextImage = create_gpu_image(otherContextInfo.grContext()); - testContext->makeCurrent(); + otherContextInfo.grContext()->flush(); return otherContextImage; } }; @@ -487,7 +487,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkImage_makeTextureImage, reporter, contextIn } } - testContext->makeCurrent(); context->flush(); } } @@ -1197,10 +1196,10 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(makeBackendTexture, reporter, ctxInfo) { { create_picture_image, true, false }, { [context] { return create_gpu_image(context); }, true, true }, // Create a texture image in a another GrContext. - { [testContext, otherContextInfo] { - otherContextInfo.testContext()->makeCurrent(); + { [otherContextInfo] { + auto restore = otherContextInfo.testContext()->makeCurrentAndAutoRestore(); sk_sp<SkImage> otherContextImage = create_gpu_image(otherContextInfo.grContext()); - testContext->makeCurrent(); + otherContextInfo.grContext()->flush(); return otherContextImage; }, false, false }, // Create an image that is too large to be texture backed. @@ -1232,7 +1231,6 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(makeBackendTexture, reporter, ctxInfo) { kExpectedState[testCase.fCanTakeDirectly]); } - testContext->makeCurrent(); context->flush(); } } |