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

Side by Side Diff: ui/gl/gl_context_egl.cc

Issue 693943003: Update from https://crrev.com/302630 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « ui/gl/gl.gyp ('k') | ui/gl/gl_image_glx.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 166 }
167 167
168 return true; 168 return true;
169 } 169 }
170 170
171 void* GLContextEGL::GetHandle() { 171 void* GLContextEGL::GetHandle() {
172 return context_; 172 return context_;
173 } 173 }
174 174
175 void GLContextEGL::SetSwapInterval(int interval) { 175 void GLContextEGL::SetSwapInterval(int interval) {
176 DCHECK(IsCurrent(NULL)); 176 DCHECK(IsCurrent(NULL) && GLSurface::GetCurrent());
177
178 // This is a surfaceless context. eglSwapInterval doesn't take any effect in
179 // this case and will just return EGL_BAD_SURFACE.
180 if (GLSurface::GetCurrent()->IsSurfaceless())
181 return;
182
177 if (!eglSwapInterval(display_, interval)) { 183 if (!eglSwapInterval(display_, interval)) {
178 LOG(ERROR) << "eglSwapInterval failed with error " 184 LOG(ERROR) << "eglSwapInterval failed with error "
179 << GetLastEGLErrorString(); 185 << GetLastEGLErrorString();
180 } 186 }
181 } 187 }
182 188
183 std::string GLContextEGL::GetExtensions() { 189 std::string GLContextEGL::GetExtensions() {
184 const char* extensions = eglQueryString(display_, 190 const char* extensions = eglQueryString(display_,
185 EGL_EXTENSIONS); 191 EGL_EXTENSIONS);
186 if (!extensions) 192 if (!extensions)
(...skipping 12 matching lines...) Expand all
199 205
200 #if !defined(OS_ANDROID) 206 #if !defined(OS_ANDROID)
201 bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) { 207 bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) {
202 DCHECK(bytes); 208 DCHECK(bytes);
203 *bytes = 0; 209 *bytes = 0;
204 return false; 210 return false;
205 } 211 }
206 #endif 212 #endif
207 213
208 } // namespace gfx 214 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl.gyp ('k') | ui/gl/gl_image_glx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698