OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |