rendering_stats.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright 2012 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 CC_DEBUG_RENDERING_STATS_H_
  5. #define CC_DEBUG_RENDERING_STATS_H_
  6. #include <stdint.h>
  7. #include <memory>
  8. #include <vector>
  9. #include "base/time/time.h"
  10. #include "base/trace_event/traced_value.h"
  11. #include "cc/debug/debug_export.h"
  12. namespace cc {
  13. struct CC_DEBUG_EXPORT RenderingStats {
  14. // Stores a sequence of TimeDelta objects.
  15. class CC_DEBUG_EXPORT TimeDeltaList {
  16. public:
  17. TimeDeltaList();
  18. TimeDeltaList(const TimeDeltaList& other);
  19. ~TimeDeltaList();
  20. void Append(base::TimeDelta value);
  21. void AddToTracedValue(const char* name,
  22. base::trace_event::TracedValue* list_value) const;
  23. void Add(const TimeDeltaList& other);
  24. base::TimeDelta GetLastTimeDelta() const;
  25. private:
  26. std::vector<base::TimeDelta> values;
  27. };
  28. RenderingStats();
  29. RenderingStats(const RenderingStats& other);
  30. ~RenderingStats();
  31. int64_t frame_count;
  32. int64_t visible_content_area;
  33. int64_t approximated_visible_content_area;
  34. int64_t checkerboarded_visible_content_area;
  35. int64_t checkerboarded_no_recording_content_area;
  36. int64_t checkerboarded_needs_raster_content_area;
  37. TimeDeltaList draw_duration;
  38. TimeDeltaList draw_duration_estimate;
  39. TimeDeltaList begin_main_frame_to_commit_duration;
  40. TimeDeltaList commit_to_activate_duration;
  41. TimeDeltaList commit_to_activate_duration_estimate;
  42. std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsTraceableData()
  43. const;
  44. };
  45. } // namespace cc
  46. #endif // CC_DEBUG_RENDERING_STATS_H_