Chromium Code Reviews| Index: chrome/browser/android/vr_shell/vr_shell_gl.cc |
| diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc |
| index 2f6ca1858794f98ba5b079eec8914441c31f2b4f..578a90bf578312a62bab65b2e1f82d7c8b84a417 100644 |
| --- a/chrome/browser/android/vr_shell/vr_shell_gl.cc |
| +++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/memory/ptr_util.h" |
| #include "base/metrics/histogram_macros.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| +#include "chrome/browser/android/vr_shell/fps_meter.h" |
| #include "chrome/browser/android/vr_shell/mailbox_to_surface_bridge.h" |
| #include "chrome/browser/android/vr_shell/ui_elements.h" |
| #include "chrome/browser/android/vr_shell/ui_interface.h" |
| @@ -147,6 +148,9 @@ VrShellGl::VrShellGl( |
| binding_(this), |
| weak_vr_shell_(weak_vr_shell), |
| main_thread_task_runner_(std::move(main_thread_task_runner)), |
| +#ifndef NDEBUG |
|
mthiesse
2017/04/11 19:17:13
Also, consider using DCHECK_ALWAYS_ON? Might be us
Ian Vollick
2017/04/12 01:25:06
Sure thing. My hope is that when this is ready (i.
|
| + fps_meter_(new FPSMeter()), |
| +#endif |
| weak_ptr_factory_(this) { |
| GvrInit(gvr_api); |
| } |
| @@ -836,6 +840,13 @@ void VrShellGl::DrawFrame(int16_t frame_index) { |
| TRACE_EVENT0("gpu", "VrShellGl::SwapBuffers"); |
| surface_->SwapBuffers(); |
| } |
| + |
| +#ifndef NDEBUG |
| + // After saving the timestamp, fps will be available via GetFPS(). |
| + // TODO(vollick): enable rendering of this framerate in a HUD. |
| + fps_meter_->AddFrame(current_time); |
| + LOG(ERROR) << "fps: " << fps_meter_->GetFPS(); |
| +#endif |
| } |
| void VrShellGl::DrawWorldElements(const gvr::Mat4f& head_pose) { |