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

Unified Diff: ui/gl/scoped_make_current.cc

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 | « ui/gl/scoped_make_current.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/scoped_make_current.cc
diff --git a/ui/gl/scoped_make_current.cc b/ui/gl/scoped_make_current.cc
index e75a0416e518e95381821ae644a258b4b9a0a980..d93e3171447c86b30342e2dd48d436625e978985 100644
--- a/ui/gl/scoped_make_current.cc
+++ b/ui/gl/scoped_make_current.cc
@@ -35,4 +35,16 @@ bool ScopedMakeCurrent::Succeeded() const {
return succeeded_;
}
+ScopedReleaseCurrent::ScopedReleaseCurrent(gl::GLSurface* this_surface) {
+ gl::GLContext* current_context = gl::GLContext::GetCurrent();
+ bool was_current =
+ current_context && current_context->IsCurrent(this_surface);
+ if (was_current) {
+ make_current_.emplace(current_context, this_surface);
+ current_context->ReleaseCurrent(this_surface);
+ }
+}
+
+ScopedReleaseCurrent::~ScopedReleaseCurrent() {}
+
} // namespace ui
« no previous file with comments | « ui/gl/scoped_make_current.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698