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

Unified Diff: ui/gl/gl_surface.cc

Issue 15928002: GPU: Keep track of the last real context and real surface made current. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix OSX Created 7 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
Index: ui/gl/gl_surface.cc
diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc
index f09aa35924daf21f1ab19a5eb57ba463eb8e011c..bf78be3e51c80bb6ec17ce7c709004abdf8ad5c0 100644
--- a/ui/gl/gl_surface.cc
+++ b/ui/gl/gl_surface.cc
@@ -20,6 +20,9 @@ namespace gfx {
namespace {
base::LazyInstance<base::ThreadLocalPointer<GLSurface> >::Leaky
current_surface_ = LAZY_INSTANCE_INITIALIZER;
+
+base::LazyInstance<base::ThreadLocalPointer<GLSurface> >::Leaky
+ current_real_surface_ = LAZY_INSTANCE_INITIALIZER;
} // namespace
// static
@@ -154,15 +157,26 @@ GLSurface* GLSurface::GetCurrent() {
return current_surface_.Pointer()->Get();
}
+GLSurface* GLSurface::GetRealCurrent() {
+ return current_real_surface_.Pointer()->Get();
+}
+
GLSurface::~GLSurface() {
if (GetCurrent() == this)
SetCurrent(NULL);
+
+ if (GetRealCurrent() == this)
+ SetRealCurrent(NULL);
}
void GLSurface::SetCurrent(GLSurface* surface) {
current_surface_.Pointer()->Set(surface);
}
+void GLSurface::SetRealCurrent(GLSurface* surface) {
+ current_real_surface_.Pointer()->Set(surface);
+}
+
bool GLSurface::ExtensionsContain(const char* c_extensions, const char* name) {
DCHECK(name);
if (!c_extensions)
« ui/gl/gl_surface.h ('K') | « ui/gl/gl_surface.h ('k') | ui/gl/gl_surface_egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698