summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/EventControlThread.h
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/EventControlThread.h')
-rw-r--r--services/surfaceflinger/EventControlThread.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/services/surfaceflinger/EventControlThread.h b/services/surfaceflinger/EventControlThread.h
index 321fb79831..9be4e7cd8e 100644
--- a/services/surfaceflinger/EventControlThread.h
+++ b/services/surfaceflinger/EventControlThread.h
@@ -16,8 +16,8 @@
#pragma once
-#include <cstddef>
#include <condition_variable>
+#include <cstddef>
#include <functional>
#include <mutex>
#include <thread>
@@ -30,12 +30,22 @@ class SurfaceFlinger;
class EventControlThread {
public:
+ virtual ~EventControlThread();
+
+ virtual void setVsyncEnabled(bool enabled) = 0;
+};
+
+namespace impl {
+
+class EventControlThread final : public android::EventControlThread {
+public:
using SetVSyncEnabledFunction = std::function<void(bool)>;
explicit EventControlThread(SetVSyncEnabledFunction function);
~EventControlThread();
- void setVsyncEnabled(bool enabled);
+ // EventControlThread implementation
+ void setVsyncEnabled(bool enabled) override;
private:
void threadMain();
@@ -51,4 +61,5 @@ private:
std::thread mThread{&EventControlThread::threadMain, this};
};
+} // namespace impl
} // namespace android