| Index: ui/gl/scoped_make_current.h
|
| diff --git a/ui/gl/scoped_make_current.h b/ui/gl/scoped_make_current.h
|
| index fb25fc08ce28cc8bca3bb1215e605e5c14849ab1..ba50583c618200907c87a343f62d8b152c62b5bb 100644
|
| --- a/ui/gl/scoped_make_current.h
|
| +++ b/ui/gl/scoped_make_current.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/optional.h"
|
| #include "ui/gl/gl_export.h"
|
|
|
| namespace gl {
|
| @@ -33,6 +34,20 @@ class GL_EXPORT ScopedMakeCurrent {
|
| DISALLOW_COPY_AND_ASSIGN(ScopedMakeCurrent);
|
| };
|
|
|
| +// This class is used to make sure a specified surface isn't current, and upon
|
| +// destruction it will make the surface current again if it had been before.
|
| +class GL_EXPORT ScopedReleaseCurrent {
|
| + public:
|
| + explicit ScopedReleaseCurrent(gl::GLSurface* this_surface);
|
| +
|
| + ~ScopedReleaseCurrent();
|
| +
|
| + private:
|
| + base::Optional<ScopedMakeCurrent> make_current_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ScopedReleaseCurrent);
|
| +};
|
| +
|
| } // namespace ui
|
|
|
| #endif // UI_GL_SCOPED_MAKE_CURRENT_H_
|
|
|