video_frame_controller.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2013 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_SCHEDULER_VIDEO_FRAME_CONTROLLER_H_
  5. #define CC_SCHEDULER_VIDEO_FRAME_CONTROLLER_H_
  6. #include "cc/cc_export.h"
  7. #include "components/viz/common/frame_sinks/begin_frame_args.h"
  8. namespace cc {
  9. class VideoFrameController;
  10. class CC_EXPORT VideoFrameControllerClient {
  11. public:
  12. virtual void AddVideoFrameController(VideoFrameController* controller) = 0;
  13. virtual void RemoveVideoFrameController(VideoFrameController* controller) = 0;
  14. protected:
  15. virtual ~VideoFrameControllerClient() {}
  16. };
  17. // TODO(sunnyps): Consider making this a viz::BeginFrameObserver some day.
  18. class CC_EXPORT VideoFrameController {
  19. public:
  20. virtual void OnBeginFrame(const viz::BeginFrameArgs& args) = 0;
  21. // Called upon completion of LayerTreeHostImpl::DidDrawAllLayers(), regardless
  22. // of whether the controller issued a SetNeedsRedraw(). May be used to
  23. // determine when SetNeedsRedraw() is called but the draw is aborted.
  24. virtual void DidDrawFrame() = 0;
  25. protected:
  26. virtual ~VideoFrameController() {}
  27. };
  28. } // namespace cc
  29. #endif // CC_SCHEDULER_VIDEO_FRAME_CONTROLLER_H_