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

Unified Diff: ui/gl/sync_control_vsync_provider.cc

Issue 1545113002: Switch to standard integer types in ui/gl/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/sync_control_vsync_provider.h ('k') | ui/gl/test/gl_image_test_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/sync_control_vsync_provider.cc
diff --git a/ui/gl/sync_control_vsync_provider.cc b/ui/gl/sync_control_vsync_provider.cc
index 9fee3687dde9da7eb78ced4623004edeafd9b5da..836ec21b35780fb3418592ae54cc3b03fa2ed527 100644
--- a/ui/gl/sync_control_vsync_provider.cc
+++ b/ui/gl/sync_control_vsync_provider.cc
@@ -9,12 +9,13 @@
#include "base/logging.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
+#include "build/build_config.h"
#if defined(OS_LINUX)
// These constants define a reasonable range for a calculated refresh interval.
// Calculating refreshes out of this range will be considered a fatal error.
-const int64 kMinVsyncIntervalUs = base::Time::kMicrosecondsPerSecond / 400;
-const int64 kMaxVsyncIntervalUs = base::Time::kMicrosecondsPerSecond / 10;
+const int64_t kMinVsyncIntervalUs = base::Time::kMicrosecondsPerSecond / 400;
+const int64_t kMaxVsyncIntervalUs = base::Time::kMicrosecondsPerSecond / 10;
// How much noise we'll tolerate between successive computed intervals before
// we think the latest computed interval is invalid (noisey due to
@@ -47,9 +48,9 @@ void SyncControlVSyncProvider::GetVSyncParameters(
// was produced by the clock whose current time is closest to it, subject
// to the restriction that the returned time must not be in the future
// (since it is the time of a vblank that has already occurred).
- int64 system_time;
- int64 media_stream_counter;
- int64 swap_buffer_counter;
+ int64_t system_time;
+ int64_t media_stream_counter;
+ int64_t swap_buffer_counter;
if (!GetSyncValues(&system_time, &media_stream_counter, &swap_buffer_counter))
return;
@@ -69,10 +70,10 @@ void SyncControlVSyncProvider::GetVSyncParameters(
clock_gettime(CLOCK_REALTIME, &real_time);
clock_gettime(CLOCK_MONOTONIC, &monotonic_time);
- int64 real_time_in_microseconds =
+ int64_t real_time_in_microseconds =
real_time.tv_sec * base::Time::kMicrosecondsPerSecond +
real_time.tv_nsec / base::Time::kNanosecondsPerMicrosecond;
- int64 monotonic_time_in_microseconds =
+ int64_t monotonic_time_in_microseconds =
monotonic_time.tv_sec * base::Time::kMicrosecondsPerSecond +
monotonic_time.tv_nsec / base::Time::kNanosecondsPerMicrosecond;
@@ -86,7 +87,7 @@ void SyncControlVSyncProvider::GetVSyncParameters(
system_time += monotonic_time_in_microseconds - real_time_in_microseconds;
// Return if |system_time| is more than 1 frames in the future.
- int64 interval_in_microseconds = last_good_interval_.InMicroseconds();
+ int64_t interval_in_microseconds = last_good_interval_.InMicroseconds();
if (system_time > monotonic_time_in_microseconds + interval_in_microseconds)
return;
@@ -106,13 +107,13 @@ void SyncControlVSyncProvider::GetVSyncParameters(
while (last_computed_intervals_.size() > 1)
last_computed_intervals_.pop();
- int32 numerator, denominator;
+ int32_t numerator, denominator;
if (GetMscRate(&numerator, &denominator)) {
last_computed_intervals_.push(base::TimeDelta::FromSeconds(denominator) /
numerator);
} else if (!last_timebase_.is_null()) {
base::TimeDelta timebase_diff = timebase - last_timebase_;
- int64 counter_diff = media_stream_counter - last_media_stream_counter_;
+ int64_t counter_diff = media_stream_counter - last_media_stream_counter_;
if (counter_diff > 0 && timebase > last_timebase_)
last_computed_intervals_.push(timebase_diff / counter_diff);
}
« no previous file with comments | « ui/gl/sync_control_vsync_provider.h ('k') | ui/gl/test/gl_image_test_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698