diff options
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.h')
-rw-r--r-- | libs/hwui/renderthread/RenderThread.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/hwui/renderthread/RenderThread.h b/libs/hwui/renderthread/RenderThread.h index 80960999ef53..076e3d43a2c9 100644 --- a/libs/hwui/renderthread/RenderThread.h +++ b/libs/hwui/renderthread/RenderThread.h @@ -25,8 +25,6 @@ #include <cutils/compiler.h> #include <ui/DisplayInfo.h> #include <utils/Looper.h> -#include <utils/Mutex.h> -#include <utils/Singleton.h> #include <utils/Thread.h> #include <memory> @@ -39,6 +37,7 @@ class DisplayEventReceiver; namespace uirenderer { class RenderState; +class TestUtils; namespace renderthread { @@ -71,11 +70,12 @@ protected: ~IFrameCallback() {} }; -class ANDROID_API RenderThread : public Thread, protected Singleton<RenderThread> { +class ANDROID_API RenderThread : public Thread { public: // RenderThread takes complete ownership of tasks that are queued // and will delete them after they are run ANDROID_API void queue(RenderTask* task); + ANDROID_API void queueAndWait(RenderTask* task); ANDROID_API void queueAtFront(RenderTask* task); void queueAt(RenderTask* task, nsecs_t runAtNs); void remove(RenderTask* task); @@ -98,13 +98,16 @@ protected: virtual bool threadLoop() override; private: - friend class Singleton<RenderThread>; friend class DispatchFrameCallbacks; friend class RenderProxy; + friend class android::uirenderer::TestUtils; RenderThread(); virtual ~RenderThread(); + static bool hasInstance(); + static RenderThread& getInstance(); + void initThreadLocals(); void initializeDisplayEventReceiver(); static int displayEventReceiverCallback(int fd, int events, void* data); |