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

Side by Side Diff: chrome/browser/android/vr_shell/fps_meter.h

Issue 2804943003: [vr] Add a frame rate counter for the vr UI (Closed)
Patch Set: Actually implement CanComputeFPS Created 3 years, 8 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
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_FPS_METER_H_
6 #define CHROME_BROWSER_ANDROID_VR_SHELL_FPS_METER_H_
7
8 #include <vector>
9
10 #include "base/macros.h"
11 #include "base/time/time.h"
12
13 namespace vr_shell {
14
15 // Computes fps based on submitted frame times.
16 class FPSMeter {
17 public:
18 FPSMeter();
19 ~FPSMeter();
20
21 void AddFrame(const base::TimeTicks& time_stamp);
22
23 bool CanComputeFPS() const;
24
25 double GetFPS() const;
26
27 private:
28 size_t current_index_;
29 base::TimeTicks last_time_stamp_;
30 std::vector<base::TimeDelta> frame_times_;
31 DISALLOW_COPY_AND_ASSIGN(FPSMeter);
32 };
33
34 } // namespace vr_shell
35
36 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_FPS_METER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698