| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkEvent_DEFINED | 8 #ifndef SkEvent_DEFINED |
| 9 #define SkEvent_DEFINED | 9 #define SkEvent_DEFINED |
| 10 | 10 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 * the specifed millisecond delay. | 199 * the specifed millisecond delay. |
| 200 * | 200 * |
| 201 * The event must be dynamically allocated, as ownership is transferred to | 201 * The event must be dynamically allocated, as ownership is transferred to |
| 202 * the event queue. It cannot be allocated on the stack or in a global. | 202 * the event queue. It cannot be allocated on the stack or in a global. |
| 203 */ | 203 */ |
| 204 void postDelay(SkMSec delay); | 204 void postDelay(SkMSec delay); |
| 205 | 205 |
| 206 /** | 206 /** |
| 207 * Post to the event queue using the event's targetID or target-proc. | 207 * Post to the event queue using the event's targetID or target-proc. |
| 208 * The event will be delivered no sooner than the specified millisecond | 208 * The event will be delivered no sooner than the specified millisecond |
| 209 * time, as measured by SkTime::GetMSecs(). | 209 * time, as measured by GetMSecsSinceStartup(). |
| 210 * | 210 * |
| 211 * The event must be dynamically allocated, as ownership is transferred to | 211 * The event must be dynamically allocated, as ownership is transferred to |
| 212 * the event queue. It cannot be allocated on the stack or in a global. | 212 * the event queue. It cannot be allocated on the stack or in a global. |
| 213 */ | 213 */ |
| 214 void postTime(SkMSec time); | 214 void postTime(SkMSec time); |
| 215 | 215 |
| 216 /** |
| 217 * Returns ~zero the first time it's called, then returns the number of |
| 218 * milliseconds since the first call. Behavior is undefined if the program |
| 219 * runs more than ~25 days. |
| 220 */ |
| 221 static SkMSec GetMSecsSinceStartup(); |
| 222 |
| 216 /////////////////////////////////////////////// | 223 /////////////////////////////////////////////// |
| 217 /** Porting layer must call these functions **/ | 224 /** Porting layer must call these functions **/ |
| 218 /////////////////////////////////////////////// | 225 /////////////////////////////////////////////// |
| 219 | 226 |
| 220 /** Global initialization function for the SkEvent system. Should be called
exactly | 227 /** Global initialization function for the SkEvent system. Should be called
exactly |
| 221 once before any other event method is called, and should be called after
the | 228 once before any other event method is called, and should be called after
the |
| 222 call to SkGraphics::Init(). | 229 call to SkGraphics::Init(). |
| 223 */ | 230 */ |
| 224 static void Init(); | 231 static void Init(); |
| 225 /** Global cleanup function for the SkEvent system. Should be called exactly
once after | 232 /** Global cleanup function for the SkEvent system. Should be called exactly
once after |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 282 |
| 276 void initialize(const char* type, size_t typeLen, SkEventSinkID); | 283 void initialize(const char* type, size_t typeLen, SkEventSinkID); |
| 277 | 284 |
| 278 static bool Enqueue(SkEvent* evt); | 285 static bool Enqueue(SkEvent* evt); |
| 279 static SkMSec EnqueueTime(SkEvent* evt, SkMSec time); | 286 static SkMSec EnqueueTime(SkEvent* evt, SkMSec time); |
| 280 static SkEvent* Dequeue(); | 287 static SkEvent* Dequeue(); |
| 281 static bool QHasEvents(); | 288 static bool QHasEvents(); |
| 282 }; | 289 }; |
| 283 | 290 |
| 284 #endif | 291 #endif |
| OLD | NEW |