diff options
author | Xin Li <delphij@google.com> | 2020-08-31 21:21:38 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2020-08-31 21:21:38 -0700 |
commit | 628590d7ec80e10a3fc24b1c18a1afb55cca10a8 (patch) | |
tree | 4b1c3f52d86d7fb53afbe9e9438468588fa489f8 /libs/hwui/renderthread/RenderThread.h | |
parent | b11b8ec3aec8bb42f2c07e1c5ac7942da293baa8 (diff) | |
parent | d2d3a20624d968199353ccf6ddbae6f3ac39c9af (diff) |
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.h')
-rw-r--r-- | libs/hwui/renderthread/RenderThread.h | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/libs/hwui/renderthread/RenderThread.h b/libs/hwui/renderthread/RenderThread.h index c96e284df6b4..8be46a6d16e1 100644 --- a/libs/hwui/renderthread/RenderThread.h +++ b/libs/hwui/renderthread/RenderThread.h @@ -17,34 +17,33 @@ #ifndef RENDERTHREAD_H_ #define RENDERTHREAD_H_ -#include "RenderTask.h" - -#include "../JankTracker.h" -#include "CacheManager.h" -#include "TimeLord.h" -#include "WebViewFunctorManager.h" -#include "thread/ThreadBase.h" -#include "utils/TimeUtils.h" - #include <GrContext.h> #include <SkBitmap.h> +#include <apex/choreographer.h> #include <cutils/compiler.h> -#include <ui/DisplayInfo.h> +#include <thread/ThreadBase.h> #include <utils/Looper.h> #include <utils/Thread.h> -#include <thread/ThreadBase.h> #include <memory> #include <mutex> #include <set> +#include "CacheManager.h" +#include "ProfileDataContainer.h" +#include "RenderTask.h" +#include "TimeLord.h" +#include "WebViewFunctorManager.h" +#include "thread/ThreadBase.h" +#include "utils/TimeUtils.h" + namespace android { class Bitmap; -class AutoBackendTextureRelease; namespace uirenderer { +class AutoBackendTextureRelease; class Readback; class RenderState; class TestUtils; @@ -53,6 +52,10 @@ namespace skiapipeline { class VkFunctorDrawHandler; } +namespace VectorDrawable { +class Tree; +} + namespace renderthread { class CanvasContext; @@ -71,10 +74,11 @@ protected: struct VsyncSource { virtual void requestNextVsync() = 0; - virtual nsecs_t latestVsyncEvent() = 0; + virtual void drainPendingEvents() = 0; virtual ~VsyncSource() {} }; +class ChoreographerSource; class DummyVsyncSource; typedef void (*JVMAttachHook)(const char* name); @@ -134,10 +138,12 @@ private: friend class DispatchFrameCallbacks; friend class RenderProxy; friend class DummyVsyncSource; - friend class android::AutoBackendTextureRelease; + friend class ChoreographerSource; + friend class android::uirenderer::AutoBackendTextureRelease; friend class android::uirenderer::TestUtils; friend class android::uirenderer::WebViewFunctor; friend class android::uirenderer::skiapipeline::VkFunctorDrawHandler; + friend class android::uirenderer::VectorDrawable::Tree; RenderThread(); virtual ~RenderThread(); @@ -146,13 +152,21 @@ private: static RenderThread& getInstance(); void initThreadLocals(); - void initializeDisplayEventReceiver(); + void initializeChoreographer(); void setupFrameInterval(); - static int displayEventReceiverCallback(int fd, int events, void* data); + // Callbacks for choreographer events: + // choreographerCallback will call AChoreograper_handleEvent to call the + // corresponding callbacks for each display event type + static int choreographerCallback(int fd, int events, void* data); + // Callback that will be run on vsync ticks. + static void frameCallback(int64_t frameTimeNanos, void* data); + // Callback that will be run whenver there is a refresh rate change. + static void refreshRateCallback(int64_t vsyncPeriod, void* data); void drainDisplayEventQueue(); void dispatchFrameCallbacks(); void requestVsync(); + AChoreographer* mChoreographer; VsyncSource* mVsyncSource; bool mVsyncRequested; std::set<IFrameCallback*> mFrameCallbacks; |