diff options
author | 2017-11-16 22:31:30 +0000 | |
---|---|---|
committer | 2017-11-16 22:31:39 +0000 | |
commit | 1e09e461d2ffcf8b07242cfe93dd7d12c4d75866 (patch) | |
tree | 59ecb8a613b8a958522036043ed6e5a4c4e329ca /tools/gpu/TestContext.h | |
parent | 8dca18ac7b8af9a945abe4ae0d9190a1d2bff3d6 (diff) |
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 <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
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 <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tools/gpu/TestContext.h')
-rw-r--r-- | tools/gpu/TestContext.h | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/tools/gpu/TestContext.h b/tools/gpu/TestContext.h index 5b512db7ba..84794f3c34 100644 --- a/tools/gpu/TestContext.h +++ b/tools/gpu/TestContext.h @@ -9,11 +9,10 @@ #ifndef TestContext_DEFINED #define TestContext_DEFINED -#include "../private/SkTemplates.h" #include "FenceSync.h" #include "GrTypes.h" #include "SkRefCnt.h" -#include "SkScopeExit.h" +#include "../private/SkTemplates.h" class GrContext; struct GrContextOptions; @@ -46,18 +45,6 @@ public: void makeCurrent() const; - /** - * Like makeCurrent() but this returns an object that will restore the previous current - * context in its destructor. Useful to undo the effect making this current before returning to - * a caller that doesn't expect the current context to be changed underneath it. - * - * The returned object restores the current context of the same type (e.g. egl, glx, ...) in its - * destructor. It is undefined behavior if that context is destroyed before the destructor - * executes. If the concept of a current context doesn't make sense for this context type then - * the returned object's destructor is a no-op. - */ - SkScopeExit SK_WARN_UNUSED_RESULT makeCurrentAndAutoRestore() const; - virtual GrBackend backend() = 0; virtual GrBackendContext backendContext() = 0; @@ -107,14 +94,6 @@ protected: virtual void teardown(); virtual void onPlatformMakeCurrent() const = 0; - /** - * Subclasses should implement such that the returned function will cause the current context - * of this type to be made current again when it is called. It should additionally be the - * case that if "this" is already current when this is called, then "this" is destroyed (thereby - * setting the null context as current), and then the std::function is called the null context - * should remain current. - */ - virtual std::function<void()> onPlatformGetAutoContextRestore() const = 0; virtual void onPlatformSwapBuffers() const = 0; private: |