Loading libs/gui/SurfaceControl.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ const std::string& SurfaceControl::getName() const { return mName; } sp<Choreographer> SurfaceControl::getChoreographer() { std::shared_ptr<Choreographer> SurfaceControl::getChoreographer() { if (mChoreographer) { return mChoreographer; } Loading @@ -203,7 +203,7 @@ sp<Choreographer> SurfaceControl::getChoreographer() { ALOGE("%s: No looper prepared for thread", __func__); return nullptr; } mChoreographer = sp<Choreographer>::make(looper, getHandle()); mChoreographer = std::make_shared<Choreographer>(looper, getHandle()); status_t result = mChoreographer->initialize(); if (result != OK) { ALOGE("Failed to initialize choreographer"); Loading libs/gui/include/gui/Choreographer.h +3 −4 Original line number Diff line number Diff line Loading @@ -79,6 +79,9 @@ public: }; static Context gChoreographers; explicit Choreographer(const sp<Looper>& looper, const sp<IBinder>& layerHandle = nullptr) EXCLUDES(gChoreographers.lock); void postFrameCallbackDelayed(AChoreographer_frameCallback cb, AChoreographer_frameCallback64 cb64, AChoreographer_vsyncCallback vsyncCallback, void* data, Loading Loading @@ -111,10 +114,6 @@ public: private: Choreographer(const Choreographer&) = delete; explicit Choreographer(const sp<Looper>& looper, const sp<IBinder>& layerHandle = nullptr) EXCLUDES(gChoreographers.lock); friend class sp<Choreographer>; friend AChoreographer* AChoreographer_create(); void dispatchVsync(nsecs_t timestamp, PhysicalDisplayId displayId, uint32_t count, VsyncEventData vsyncEventData) override; Loading libs/gui/include/gui/SurfaceControl.h +3 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ #include <android/gui/ISurfaceComposerClient.h> #include <gui/Choreographer.h> #include <ui/FrameStats.h> #include <ui/PixelFormat.h> #include <ui/Region.h> Loading @@ -37,6 +36,7 @@ namespace android { // --------------------------------------------------------------------------- class Choreographer; class IGraphicBufferProducer; class Surface; class SurfaceComposerClient; Loading Loading @@ -82,7 +82,7 @@ public: const std::string& getName() const; // TODO(b/267195698): Consider renaming. sp<Choreographer> getChoreographer(); std::shared_ptr<Choreographer> getChoreographer(); sp<IGraphicBufferProducer> getIGraphicBufferProducer(); Loading Loading @@ -134,7 +134,7 @@ private: PixelFormat mFormat = PIXEL_FORMAT_NONE; uint32_t mCreateFlags = 0; uint64_t mFallbackFrameNumber = 100; sp<Choreographer> mChoreographer; std::shared_ptr<Choreographer> mChoreographer; }; }; // namespace android Loading Loading
libs/gui/SurfaceControl.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ const std::string& SurfaceControl::getName() const { return mName; } sp<Choreographer> SurfaceControl::getChoreographer() { std::shared_ptr<Choreographer> SurfaceControl::getChoreographer() { if (mChoreographer) { return mChoreographer; } Loading @@ -203,7 +203,7 @@ sp<Choreographer> SurfaceControl::getChoreographer() { ALOGE("%s: No looper prepared for thread", __func__); return nullptr; } mChoreographer = sp<Choreographer>::make(looper, getHandle()); mChoreographer = std::make_shared<Choreographer>(looper, getHandle()); status_t result = mChoreographer->initialize(); if (result != OK) { ALOGE("Failed to initialize choreographer"); Loading
libs/gui/include/gui/Choreographer.h +3 −4 Original line number Diff line number Diff line Loading @@ -79,6 +79,9 @@ public: }; static Context gChoreographers; explicit Choreographer(const sp<Looper>& looper, const sp<IBinder>& layerHandle = nullptr) EXCLUDES(gChoreographers.lock); void postFrameCallbackDelayed(AChoreographer_frameCallback cb, AChoreographer_frameCallback64 cb64, AChoreographer_vsyncCallback vsyncCallback, void* data, Loading Loading @@ -111,10 +114,6 @@ public: private: Choreographer(const Choreographer&) = delete; explicit Choreographer(const sp<Looper>& looper, const sp<IBinder>& layerHandle = nullptr) EXCLUDES(gChoreographers.lock); friend class sp<Choreographer>; friend AChoreographer* AChoreographer_create(); void dispatchVsync(nsecs_t timestamp, PhysicalDisplayId displayId, uint32_t count, VsyncEventData vsyncEventData) override; Loading
libs/gui/include/gui/SurfaceControl.h +3 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ #include <android/gui/ISurfaceComposerClient.h> #include <gui/Choreographer.h> #include <ui/FrameStats.h> #include <ui/PixelFormat.h> #include <ui/Region.h> Loading @@ -37,6 +36,7 @@ namespace android { // --------------------------------------------------------------------------- class Choreographer; class IGraphicBufferProducer; class Surface; class SurfaceComposerClient; Loading Loading @@ -82,7 +82,7 @@ public: const std::string& getName() const; // TODO(b/267195698): Consider renaming. sp<Choreographer> getChoreographer(); std::shared_ptr<Choreographer> getChoreographer(); sp<IGraphicBufferProducer> getIGraphicBufferProducer(); Loading Loading @@ -134,7 +134,7 @@ private: PixelFormat mFormat = PIXEL_FORMAT_NONE; uint32_t mCreateFlags = 0; uint64_t mFallbackFrameNumber = 100; sp<Choreographer> mChoreographer; std::shared_ptr<Choreographer> mChoreographer; }; }; // namespace android Loading