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

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

Issue 708483003: Allow Windows to use system Vsync for a single window each swap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment spelling correction 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 | « content/common/gpu/image_transport_surface.cc ('k') | ui/gl/gl_surface.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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 DCHECK(IsCurrent(NULL) && GLSurface::GetCurrent()); 176 DCHECK(IsCurrent(NULL) && GLSurface::GetCurrent());
177 177
178 // This is a surfaceless context. eglSwapInterval doesn't take any effect in 178 // This is a surfaceless context. eglSwapInterval doesn't take any effect in
179 // this case and will just return EGL_BAD_SURFACE. 179 // this case and will just return EGL_BAD_SURFACE.
180 if (GLSurface::GetCurrent()->IsSurfaceless()) 180 if (GLSurface::GetCurrent()->IsSurfaceless())
181 return; 181 return;
182 182
183 if (!eglSwapInterval(display_, interval)) { 183 if (!eglSwapInterval(display_, interval)) {
184 LOG(ERROR) << "eglSwapInterval failed with error " 184 LOG(ERROR) << "eglSwapInterval failed with error "
185 << GetLastEGLErrorString(); 185 << GetLastEGLErrorString();
186 } else {
187 GLSurface::GetCurrent()->SetSwapInterval(interval);
186 } 188 }
187 } 189 }
188 190
189 std::string GLContextEGL::GetExtensions() { 191 std::string GLContextEGL::GetExtensions() {
190 const char* extensions = eglQueryString(display_, 192 const char* extensions = eglQueryString(display_,
191 EGL_EXTENSIONS); 193 EGL_EXTENSIONS);
192 if (!extensions) 194 if (!extensions)
193 return GLContext::GetExtensions(); 195 return GLContext::GetExtensions();
194 196
195 return GLContext::GetExtensions() + " " + extensions; 197 return GLContext::GetExtensions() + " " + extensions;
196 } 198 }
197 199
198 bool GLContextEGL::WasAllocatedUsingRobustnessExtension() { 200 bool GLContextEGL::WasAllocatedUsingRobustnessExtension() {
199 return GLSurfaceEGL::IsCreateContextRobustnessSupported(); 201 return GLSurfaceEGL::IsCreateContextRobustnessSupported();
200 } 202 }
201 203
202 GLContextEGL::~GLContextEGL() { 204 GLContextEGL::~GLContextEGL() {
203 Destroy(); 205 Destroy();
204 } 206 }
205 207
206 #if !defined(OS_ANDROID) 208 #if !defined(OS_ANDROID)
207 bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) { 209 bool GLContextEGL::GetTotalGpuMemory(size_t* bytes) {
208 DCHECK(bytes); 210 DCHECK(bytes);
209 *bytes = 0; 211 *bytes = 0;
210 return false; 212 return false;
211 } 213 }
212 #endif 214 #endif
213 215
214 } // namespace gfx 216 } // namespace gfx
OLDNEW
« no previous file with comments | « content/common/gpu/image_transport_surface.cc ('k') | ui/gl/gl_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698