Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00c66839 authored by Kevin DuBois's avatar Kevin DuBois
Browse files

libgui: add sampling fns to SurfaceComposerClient

{add,remove}RegionSamplingListener was missing from
SurfaceComposerClient. Add them here to make the JNI
connection easier.

Test: boot
Test: atest CompositionSamplingListenerTest
Bug: 124305231
Change-Id: Ifd8833c25c112743524cee0ac5f2eae035011161
parent 613e49e9
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1464,6 +1464,19 @@ status_t SurfaceComposerClient::isWideColorDisplay(const sp<IBinder>& display,
                                                                     outIsWideColorDisplay);
}

status_t SurfaceComposerClient::addRegionSamplingListener(
        const Rect& samplingArea, const sp<IBinder>& stopLayerHandle,
        const sp<IRegionSamplingListener>& listener) {
    return ComposerService::getComposerService()->addRegionSamplingListener(samplingArea,
                                                                            stopLayerHandle,
                                                                            listener);
}

status_t SurfaceComposerClient::removeRegionSamplingListener(
        const sp<IRegionSamplingListener>& listener) {
    return ComposerService::getComposerService()->removeRegionSamplingListener(listener);
}

// ----------------------------------------------------------------------------

status_t ScreenshotClient::capture(const sp<IBinder>& display, const ui::Dataspace reqDataSpace,
+5 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ struct DisplayInfo;
class HdrCapabilities;
class ISurfaceComposerClient;
class IGraphicBufferProducer;
class IRegionSamplingListener;
class Region;

// ---------------------------------------------------------------------------
@@ -436,6 +437,10 @@ public:

    static status_t getDisplayedContentSample(const sp<IBinder>& display, uint64_t maxFrames,
                                              uint64_t timestamp, DisplayedFrameStats* outStats);
    static status_t addRegionSamplingListener(const Rect& samplingArea,
                                              const sp<IBinder>& stopLayerHandle,
                                              const sp<IRegionSamplingListener>& listener);
    static status_t removeRegionSamplingListener(const sp<IRegionSamplingListener>& listener);

private:
    virtual void onFirstRef();