OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 UI_OZONE_PLATFORM_PAGE_FLIP_EVENT_HANDLER_H_ |
| 6 #define UI_OZONE_PLATFORM_PAGE_FLIP_EVENT_HANDLER_H_ |
| 7 |
| 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "base/threading/thread.h" |
| 11 #include "ui/ozone/public/surface_ozone_egl.h" |
| 12 |
| 13 namespace ui { |
| 14 |
| 15 class HardwareDisplayController; |
| 16 |
| 17 // Helper class to processes outstanding DRM events of a given HardwareDisplay |
| 18 // Controller in a worker thread. |
| 19 class PageFlipEventHandler : public base::Thread { |
| 20 public: |
| 21 PageFlipEventHandler(); |
| 22 |
| 23 ~PageFlipEventHandler() override; |
| 24 |
| 25 // Checks if any submitted page flip events for Controller have been processed |
| 26 // and callback is called once this data is available. The function doesn't |
| 27 // block. Query to check if the page flip events have been processed |
| 28 // will be done in a worker thread to make sure we dont block the current |
| 29 // thread but the callback will be posted on the same sequenced thread. |
| 30 void GetPageFlipCompleted( |
| 31 HardwareDisplayController* controller, |
| 32 const ui::SurfaceOzoneEGL::PageFlipCompletionCallback& callback); |
| 33 |
| 34 protected: |
| 35 void CleanUp() override; |
| 36 |
| 37 private: |
| 38 static void RunFlipEventCallBack( |
| 39 const ui::SurfaceOzoneEGL::PageFlipCompletionCallback& callback); |
| 40 |
| 41 static void CheckPageFlipEvent( |
| 42 PageFlipEventHandler* data, |
| 43 HardwareDisplayController* controller, |
| 44 const ui::SurfaceOzoneEGL::PageFlipCompletionCallback& callback); |
| 45 |
| 46 private: |
| 47 // Our original calling message loop for the child thread. |
| 48 scoped_refptr<base::MessageLoopProxy> child_message_loop_proxy_; |
| 49 DISALLOW_COPY_AND_ASSIGN(PageFlipEventHandler); |
| 50 }; |
| 51 |
| 52 } // namespace ui |
| 53 |
| 54 #endif // UI_OZONE_PLATFORM_PAGE_FLIP_EVENT_HANDLER_H_ |
OLD | NEW |