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

Unified Diff: ui/gl/gpu_timing.cc

Issue 1162203006: Unit tests have been created for the GPUTiming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted egl unit test changes, wrong cl Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gpu_timing.h ('k') | ui/gl/gpu_timing_fake.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gpu_timing.cc
diff --git a/ui/gl/gpu_timing.cc b/ui/gl/gpu_timing.cc
index 01a0e192e005ad44c84efe3599bbe6550d0015e9..dc720df58e03774b20fbe027460497a9b1d32cb1 100644
--- a/ui/gl/gpu_timing.cc
+++ b/ui/gl/gpu_timing.cc
@@ -52,7 +52,7 @@ int64 GPUTiming::CalculateTimerOffset(base::Callback<int64(void)> cpu_time) {
int64 now =
cpu_time.is_null()
? (base::TraceTicks::Now() - base::TraceTicks()).InMicroseconds()
- : cpu_time.Run();
+ : cpu_time.Run();
offset_ = now - gl_now / base::Time::kNanosecondsPerMicrosecond;
offset_valid_ = (timer_type_ == kTimerTypeARB);
} else {
@@ -251,6 +251,12 @@ void GPUTimingClient::SetCpuTimeForTesting(
cpu_time_for_testing_ = cpu_time;
}
+int64 GPUTimingClient::GetCurrentCPUTime() {
+ return cpu_time_for_testing_.is_null()
+ ? (base::TraceTicks::Now() - base::TraceTicks()).InMicroseconds()
+ : cpu_time_for_testing_.Run();
+}
+
GPUTimingClient::~GPUTimingClient() {
}
« no previous file with comments | « ui/gl/gpu_timing.h ('k') | ui/gl/gpu_timing_fake.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698