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

Unified Diff: android_webview/browser/scoped_app_gl_state_restore.cc

Issue 2375743002: [Merge M54] aw: Fix FBO restore in webview functor (Closed)
Patch Set: Created 4 years, 3 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 | « android_webview/browser/scoped_app_gl_state_restore.h ('k') | android_webview/browser/surfaces_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/scoped_app_gl_state_restore.cc
diff --git a/android_webview/browser/scoped_app_gl_state_restore.cc b/android_webview/browser/scoped_app_gl_state_restore.cc
index da1c5aaa9f1fa5545dde708ddfbe8492a7bfbb4a..15895dd508ec0e8ed382909bf4bfc4f4c2e4d53f 100644
--- a/android_webview/browser/scoped_app_gl_state_restore.cc
+++ b/android_webview/browser/scoped_app_gl_state_restore.cc
@@ -66,6 +66,7 @@ bool ClearGLErrors(bool warn, const char* msg) {
bool g_globals_initialized = false;
GLint g_gl_max_texture_units = 0;
bool g_supports_oes_vertex_array_object = false;
+ScopedAppGLStateRestore* g_current_instance = nullptr;
} // namespace
@@ -416,11 +417,22 @@ ScopedAppGLStateRestoreImpl::~ScopedAppGLStateRestoreImpl() {
} // namespace internal
+// static
+ScopedAppGLStateRestore* ScopedAppGLStateRestore::Current() {
+ DCHECK(g_current_instance);
+ return g_current_instance;
+}
+
ScopedAppGLStateRestore::ScopedAppGLStateRestore(CallMode mode)
: impl_(new internal::ScopedAppGLStateRestoreImpl(mode)) {
+ DCHECK(!g_current_instance);
+ g_current_instance = this;
}
-ScopedAppGLStateRestore::~ScopedAppGLStateRestore() {}
+ScopedAppGLStateRestore::~ScopedAppGLStateRestore() {
+ DCHECK_EQ(this, g_current_instance);
+ g_current_instance = nullptr;
+}
StencilState ScopedAppGLStateRestore::stencil_state() const {
return impl_->stencil_state();
« no previous file with comments | « android_webview/browser/scoped_app_gl_state_restore.h ('k') | android_webview/browser/surfaces_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698