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

Side by Side Diff: src/animator/SkTime.cpp

Issue 1562943002: SkTime: Stop using POSIX entensions to time.h for timezone (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-01-06 (Wednesday) 15:48:07 EST Created 4 years, 11 months 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 | « no previous file | src/core/SkTime.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "SkTime.h" 8 #include "SkTime.h"
9 9
10 #ifdef SK_BUILD_FOR_WIN 10 #ifdef SK_BUILD_FOR_WIN
11 11
12 #ifdef SK_DEBUG 12 #ifdef SK_DEBUG
13 SkMSec gForceTickCount = (SkMSec) -1; 13 SkMSec gForceTickCount = (SkMSec) -1;
mtklein 2016/01/06 21:22:26 Don't see any use of this outside the declaration
hal.canary 2016/01/11 22:31:40 done.
14 #endif 14 #endif
15 15
16 void SkTime::GetDateTime(DateTime* t) {
17 if (t) {
18 SYSTEMTIME syst;
19
20 ::GetLocalTime(&syst);
21 t->fYear = SkToU16(syst.wYear);
22 t->fMonth = SkToU8(syst.wMonth);
23 t->fDayOfWeek = SkToU8(syst.wDayOfWeek);
24 t->fDay = SkToU8(syst.wDay);
25 t->fHour = SkToU8(syst.wHour);
26 t->fMinute = SkToU8(syst.wMinute);
27 t->fSecond = SkToU8(syst.wSecond);
28 }
29 }
30
31 #elif defined(xSK_BUILD_FOR_MAC)
32
33 #include <time.h>
34
35 void SkTime::GetDateTime(DateTime* t) {
36 if (t) {
37 tm syst;
38 time_t tm;
39
40 time(&tm);
41 localtime_r(&tm, &syst);
42 t->fYear = SkToU16(syst.tm_year);
43 t->fMonth = SkToU8(syst.tm_mon + 1);
44 t->fDayOfWeek = SkToU8(syst.tm_wday);
45 t->fDay = SkToU8(syst.tm_mday);
46 t->fHour = SkToU8(syst.tm_hour);
47 t->fMinute = SkToU8(syst.tm_min);
48 t->fSecond = SkToU8(syst.tm_sec);
49 }
50 }
51
52 #endif 16 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkTime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698