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

Side by Side Diff: ui/gl/gl_context_egl.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: Make GetRealCurrent protected. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_context_egl.h" 5 #include "ui/gl/gl_context_egl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 bool GLContextEGL::IsCurrent(GLSurface* surface) { 148 bool GLContextEGL::IsCurrent(GLSurface* surface) {
149 DCHECK(context_); 149 DCHECK(context_);
150 150
151 bool native_context_is_current = context_ == eglGetCurrentContext(); 151 bool native_context_is_current = context_ == eglGetCurrentContext();
152 152
153 // If our context is current then our notion of which GLContext is 153 // If our context is current then our notion of which GLContext is
154 // current must be correct. On the other hand, third-party code 154 // current must be correct. On the other hand, third-party code
155 // using OpenGL might change the current context. 155 // using OpenGL might change the current context.
156 DCHECK(!native_context_is_current || (GetCurrent() == this)); 156 DCHECK(!native_context_is_current || (GetRealCurrent() == this));
157 157
158 if (!native_context_is_current) 158 if (!native_context_is_current)
159 return false; 159 return false;
160 160
161 if (surface) { 161 if (surface) {
162 if (surface->GetHandle() != eglGetCurrentSurface(EGL_DRAW)) 162 if (surface->GetHandle() != eglGetCurrentSurface(EGL_DRAW))
163 return false; 163 return false;
164 } 164 }
165 165
166 return true; 166 return true;
(...skipping 30 matching lines...) Expand all
197 197
198 #if !defined(OS_ANDROID) 198 #if !defined(OS_ANDROID)
199 bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) { 199 bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) {
200 DCHECK(bytes); 200 DCHECK(bytes);
201 *bytes = 0; 201 *bytes = 0;
202 return false; 202 return false;
203 } 203 }
204 #endif 204 #endif
205 205
206 } // namespace gfx 206 } // namespace gfx
OLDNEW
« ui/gl/gl_context.cc ('K') | « ui/gl/gl_context_cgl.cc ('k') | ui/gl/gl_context_glx.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698