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 extern "C" { | 5 extern "C" { |
6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
7 } | 7 } |
8 | 8 |
9 #include "ui/gl/gl_surface_glx.h" | 9 #include "ui/gl/gl_surface_glx.h" |
10 | 10 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 if (!context_ || cancel_vsync_flag_.IsSet()) | 204 if (!context_ || cancel_vsync_flag_.IsSet()) |
205 return; | 205 return; |
206 | 206 |
207 glXMakeCurrent(display_, window_, context_); | 207 glXMakeCurrent(display_, window_, context_); |
208 | 208 |
209 unsigned int retrace_count = 0; | 209 unsigned int retrace_count = 0; |
210 if (glXWaitVideoSyncSGI(1, 0, &retrace_count) != 0) | 210 if (glXWaitVideoSyncSGI(1, 0, &retrace_count) != 0) |
211 return; | 211 return; |
212 | 212 |
213 TRACE_EVENT_INSTANT0("gpu", "vblank", TRACE_EVENT_SCOPE_THREAD); | 213 TRACE_EVENT_INSTANT0("gpu", "vblank", TRACE_EVENT_SCOPE_THREAD); |
214 now = base::TimeTicks::HighResNow(); | 214 now = base::TimeTicks::Now(); |
215 | 215 |
216 glXMakeCurrent(display_, 0, 0); | 216 glXMakeCurrent(display_, 0, 0); |
217 } | 217 } |
218 | 218 |
219 const base::TimeDelta kDefaultInterval = | 219 const base::TimeDelta kDefaultInterval = |
220 base::TimeDelta::FromSeconds(1) / 60; | 220 base::TimeDelta::FromSeconds(1) / 60; |
221 | 221 |
222 task_runner_->PostTask( | 222 task_runner_->PostTask( |
223 FROM_HERE, base::Bind(callback, now, kDefaultInterval)); | 223 FROM_HERE, base::Bind(callback, now, kDefaultInterval)); |
224 } | 224 } |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 | 689 |
690 void* PbufferGLSurfaceGLX::GetConfig() { | 690 void* PbufferGLSurfaceGLX::GetConfig() { |
691 return config_; | 691 return config_; |
692 } | 692 } |
693 | 693 |
694 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { | 694 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { |
695 Destroy(); | 695 Destroy(); |
696 } | 696 } |
697 | 697 |
698 } // namespace gfx | 698 } // namespace gfx |
OLD | NEW |