egl_timestamps.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (c) 2018 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. #ifndef UI_GL_EGL_TIMESTAMPS_H_
  5. #define UI_GL_EGL_TIMESTAMPS_H_
  6. #include "base/time/time.h"
  7. #include "ui/gl/gl_export.h"
  8. namespace gl {
  9. // Interface to query EGL timestamps.
  10. class GL_EXPORT EGLTimestampClient {
  11. public:
  12. virtual ~EGLTimestampClient() {}
  13. // Returns whether EGL Timestamps are supported or not.
  14. virtual bool IsEGLTimestampSupported() const = 0;
  15. // Returns false if the egl timestamps are pending for the given frame id. If
  16. // timestamps are pending, it means the frame is not yet done. Also returns
  17. // the presentation time, composite interval and presentation flags for a
  18. // frame as out parameters.
  19. virtual bool GetFrameTimestampInfoIfAvailable(
  20. base::TimeTicks* presentation_time,
  21. base::TimeDelta* composite_interval,
  22. base::TimeTicks* writes_done_time,
  23. uint32_t* presentation_flags,
  24. int frame_id) = 0;
  25. };
  26. } // namespace gl
  27. #endif // UI_GL_EGL_TIMESTAMPS_H_