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

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

Issue 1589933002: Fixed compilation on mingw. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Minor mingw cross compilation fix. Created 4 years, 9 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 | no next file » | 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 2015 Google Inc. 2 * Copyright 2015 Google Inc.
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 "SkOncePtr.h" 8 #include "SkOncePtr.h"
9 #include "SkString.h" 9 #include "SkString.h"
10 #include "SkTime.h" 10 #include "SkTime.h"
(...skipping 10 matching lines...) Expand all
21 static_cast<unsigned>(fDay), static_cast<unsigned>(fHour), 21 static_cast<unsigned>(fDay), static_cast<unsigned>(fHour),
22 static_cast<unsigned>(fMinute), 22 static_cast<unsigned>(fMinute),
23 static_cast<unsigned>(fSecond), timezoneSign, timeZoneHours, 23 static_cast<unsigned>(fSecond), timezoneSign, timeZoneHours,
24 timeZoneMinutes); 24 timeZoneMinutes);
25 } 25 }
26 } 26 }
27 27
28 28
29 #ifdef SK_BUILD_FOR_WIN32 29 #ifdef SK_BUILD_FOR_WIN32
30 30
31 #include "Windows.h" 31 #include "windows.h"
32 void SkTime::GetDateTime(DateTime* dt) { 32 void SkTime::GetDateTime(DateTime* dt) {
33 if (dt) { 33 if (dt) {
34 SYSTEMTIME st; 34 SYSTEMTIME st;
35 GetSystemTime(&st); 35 GetSystemTime(&st);
36 dt->fTimeZoneMinutes = 0; 36 dt->fTimeZoneMinutes = 0;
37 dt->fYear = st.wYear; 37 dt->fYear = st.wYear;
38 dt->fMonth = SkToU8(st.wMonth); 38 dt->fMonth = SkToU8(st.wMonth);
39 dt->fDayOfWeek = SkToU8(st.wDayOfWeek); 39 dt->fDayOfWeek = SkToU8(st.wDayOfWeek);
40 dt->fDay = SkToU8(st.wDay); 40 dt->fDay = SkToU8(st.wDay);
41 dt->fHour = SkToU8(st.wHour); 41 dt->fHour = SkToU8(st.wHour);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 #else 92 #else
93 // This std::chrono code looks great on Linux and Android, 93 // This std::chrono code looks great on Linux and Android,
94 // but MSVC 2013 returned mostly garbage (0ns times, etc). 94 // but MSVC 2013 returned mostly garbage (0ns times, etc).
95 #include <chrono> 95 #include <chrono>
96 double SkTime::GetNSecs() { 96 double SkTime::GetNSecs() {
97 auto now = std::chrono::high_resolution_clock::now(); 97 auto now = std::chrono::high_resolution_clock::now();
98 std::chrono::duration<double, std::nano> ns = now.time_since_epoch(); 98 std::chrono::duration<double, std::nano> ns = now.time_since_epoch();
99 return ns.count(); 99 return ns.count();
100 } 100 }
101 #endif 101 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698