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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 | 68 |
69 context_ = NULL; | 69 context_ = NULL; |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 bool GLContextEGL::MakeCurrent(GLSurface* surface) { | 73 bool GLContextEGL::MakeCurrent(GLSurface* surface) { |
74 DCHECK(context_); | 74 DCHECK(context_); |
75 if (IsCurrent(surface)) | 75 if (IsCurrent(surface)) |
76 return true; | 76 return true; |
77 | 77 |
78 TRACE_EVENT0("gpu", "GLContextEGL::MakeCurrent"); | 78 TRACE_EVENT2("gpu", "GLContextEGL::MakeCurrent", |
79 "context", context_, | |
80 "surface", surface); | |
81 | |
82 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | |
piman
2012/06/22 00:26:58
Could we add a comment why it's there?
| |
83 if (eglGetCurrentContext() != NULL) | |
84 glFinish(); | |
85 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | |
79 | 86 |
80 if (!eglMakeCurrent(display_, | 87 if (!eglMakeCurrent(display_, |
81 surface->GetHandle(), | 88 surface->GetHandle(), |
82 surface->GetHandle(), | 89 surface->GetHandle(), |
83 context_)) { | 90 context_)) { |
84 DVLOG(1) << "eglMakeCurrent failed with error " | 91 DVLOG(1) << "eglMakeCurrent failed with error " |
85 << GetLastEGLErrorString(); | 92 << GetLastEGLErrorString(); |
86 return false; | 93 return false; |
87 } | 94 } |
88 | 95 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 return GLContext::GetExtensions(); | 158 return GLContext::GetExtensions(); |
152 | 159 |
153 return GLContext::GetExtensions() + " " + extensions; | 160 return GLContext::GetExtensions() + " " + extensions; |
154 } | 161 } |
155 | 162 |
156 GLContextEGL::~GLContextEGL() { | 163 GLContextEGL::~GLContextEGL() { |
157 Destroy(); | 164 Destroy(); |
158 } | 165 } |
159 | 166 |
160 } // namespace gfx | 167 } // namespace gfx |
OLD | NEW |