Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(443)

Unified Diff: ui/gl/scoped_make_current.h

Issue 2926763002: Split DirectCompositionSurfaceWin into two parts. (Closed)
Patch Set: add disallow copy and assign Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/service/direct_composition_surface_win.cc ('k') | ui/gl/scoped_make_current.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « gpu/ipc/service/direct_composition_surface_win.cc ('k') | ui/gl/scoped_make_current.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698