From 1e09e461d2ffcf8b07242cfe93dd7d12c4d75866 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Thu, 16 Nov 2017 22:31:30 +0000 Subject: Revert "Add method to sk_gpu_test::TestContext to automatically restore the previous context." This reverts commit 5627d65146cb92624b682389e017d488872228c7. Reason for revert: Google3 Original change's description: > Add method to sk_gpu_test::TestContext to automatically restore the previous context. > > The motivation for this is to allow a GM to create a GL context, do some some work in it, and then return to the context that was set when it was invoked. > > Change-Id: Ie8496072a10f8f3ff36a08889e593a6ca961b61a > Reviewed-on: https://skia-review.googlesource.com/70720 > Commit-Queue: Brian Salomon > Reviewed-by: Brian Osman TBR=bsalomon@google.com,brianosman@google.com Change-Id: Ifb79638c9d4500ca3be9a5be39a5ad78b20247c1 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/72981 Reviewed-by: Brian Osman Commit-Queue: Brian Osman --- tests/ImageTest.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'tests/ImageTest.cpp') diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index d18e6a9674..30ae635c98 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. - [otherContextInfo] { - auto restore = otherContextInfo.testContext()->makeCurrentAndAutoRestore(); + [testContext, otherContextInfo] { + otherContextInfo.testContext()->makeCurrent(); sk_sp otherContextImage = create_gpu_image(otherContextInfo.grContext()); - otherContextInfo.grContext()->flush(); + testContext->makeCurrent(); return otherContextImage; } }; @@ -487,6 +487,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkImage_makeTextureImage, reporter, contextIn } } + testContext->makeCurrent(); context->flush(); } } @@ -1196,10 +1197,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. - { [otherContextInfo] { - auto restore = otherContextInfo.testContext()->makeCurrentAndAutoRestore(); + { [testContext, otherContextInfo] { + otherContextInfo.testContext()->makeCurrent(); sk_sp otherContextImage = create_gpu_image(otherContextInfo.grContext()); - otherContextInfo.grContext()->flush(); + testContext->makeCurrent(); return otherContextImage; }, false, false }, // Create an image that is too large to be texture backed. @@ -1231,6 +1232,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(makeBackendTexture, reporter, ctxInfo) { kExpectedState[testCase.fCanTakeDirectly]); } + testContext->makeCurrent(); context->flush(); } } -- cgit v1.2.3