OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
10 #include <X11/XKBlib.h> | 10 #include <X11/XKBlib.h> |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 // Some helper code to load the correct version of glXSwapInterval | 331 // Some helper code to load the correct version of glXSwapInterval |
332 #define GLX_GET_PROC_ADDR(name) glXGetProcAddress(reinterpret_cast<const GLubyte
*>((name))) | 332 #define GLX_GET_PROC_ADDR(name) glXGetProcAddress(reinterpret_cast<const GLubyte
*>((name))) |
333 #define EXT_WRANGLE(name, type, ...) \ | 333 #define EXT_WRANGLE(name, type, ...) \ |
334 if (GLX_GET_PROC_ADDR(#name)) { \ | 334 if (GLX_GET_PROC_ADDR(#name)) { \ |
335 static type k##name; \ | 335 static type k##name; \ |
336 if (!k##name) { \ | 336 if (!k##name) { \ |
337 k##name = (type) GLX_GET_PROC_ADDR(#name); \ | 337 k##name = (type) GLX_GET_PROC_ADDR(#name); \ |
338 } \ | 338 } \ |
339 k##name(__VA_ARGS__); \ | 339 k##name(__VA_ARGS__); \ |
340 SkDebugf("using %s\n", #name); \ | 340 /*SkDebugf("using %s\n", #name);*/ \ |
341 return; \ | 341 return; \ |
342 } | 342 } |
343 | 343 |
344 static void glXSwapInterval(Display* dsp, GLXDrawable drawable, int interval) { | 344 static void glXSwapInterval(Display* dsp, GLXDrawable drawable, int interval) { |
345 EXT_WRANGLE(glXSwapIntervalEXT, PFNGLXSWAPINTERVALEXTPROC, dsp, drawable, in
terval); | 345 EXT_WRANGLE(glXSwapIntervalEXT, PFNGLXSWAPINTERVALEXTPROC, dsp, drawable, in
terval); |
346 EXT_WRANGLE(glXSwapIntervalMESA, PFNGLXSWAPINTERVALMESAPROC, interval); | 346 EXT_WRANGLE(glXSwapIntervalMESA, PFNGLXSWAPINTERVALMESAPROC, interval); |
347 EXT_WRANGLE(glXSwapIntervalSGI, PFNGLXSWAPINTERVALSGIPROC, interval); | 347 EXT_WRANGLE(glXSwapIntervalSGI, PFNGLXSWAPINTERVALSGIPROC, interval); |
348 } | 348 } |
349 | 349 |
350 ///////////////////////////////////////////////////////////////////////// | 350 ///////////////////////////////////////////////////////////////////////// |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 | 510 |
511 void SkEvent::SignalNonEmptyQueue() { | 511 void SkEvent::SignalNonEmptyQueue() { |
512 // nothing to do, since we spin on our event-queue, polling for XPending | 512 // nothing to do, since we spin on our event-queue, polling for XPending |
513 } | 513 } |
514 | 514 |
515 void SkEvent::SignalQueueTimer(SkMSec delay) { | 515 void SkEvent::SignalQueueTimer(SkMSec delay) { |
516 // just need to record the delay time. We handle waking up for it in | 516 // just need to record the delay time. We handle waking up for it in |
517 // MyXNextEventWithDelay() | 517 // MyXNextEventWithDelay() |
518 gTimerDelay = delay; | 518 gTimerDelay = delay; |
519 } | 519 } |
OLD | NEW |