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

Commit 23fa79a4 authored by Rob Carr's avatar Rob Carr Committed by android-build-merger
Browse files

Merge changes from topic "capture-child-layers" into pi-dev

am: 17511b05

Change-Id: Ib2ae98549c92f13db5c010533ec6e243d72a230c
parents 601deaa9 17511b05
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -132,12 +132,13 @@ public:

    virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder,
                                   sp<GraphicBuffer>* outBuffer, const Rect& sourceCrop,
                                   float frameScale) {
                                   float frameScale, bool childrenOnly) {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        data.writeStrongBinder(layerHandleBinder);
        data.write(sourceCrop);
        data.writeFloat(frameScale);
        data.writeBool(childrenOnly);
        status_t err = remote()->transact(BnSurfaceComposer::CAPTURE_LAYERS, data, &reply);

        if (err != NO_ERROR) {
@@ -629,8 +630,10 @@ status_t BnSurfaceComposer::onTransact(
            Rect sourceCrop(Rect::EMPTY_RECT);
            data.read(sourceCrop);
            float frameScale = data.readFloat();
            bool childrenOnly = data.readBool();

            status_t res = captureLayers(layerHandleBinder, &outBuffer, sourceCrop, frameScale);
            status_t res = captureLayers(layerHandleBinder, &outBuffer, sourceCrop, frameScale,
                                         childrenOnly);
            reply->writeInt32(res);
            if (res == NO_ERROR) {
                reply->write(*outBuffer);
+11 −1
Original line number Diff line number Diff line
@@ -751,7 +751,17 @@ status_t ScreenshotClient::captureLayers(const sp<IBinder>& layerHandle, Rect so
                                         float frameScale, sp<GraphicBuffer>* outBuffer) {
    sp<ISurfaceComposer> s(ComposerService::getComposerService());
    if (s == NULL) return NO_INIT;
    status_t ret = s->captureLayers(layerHandle, outBuffer, sourceCrop, frameScale);
    status_t ret = s->captureLayers(layerHandle, outBuffer, sourceCrop, frameScale,
                                    false /* childrenOnly */);
    return ret;
}

status_t ScreenshotClient::captureChildLayers(const sp<IBinder>& layerHandle, Rect sourceCrop,
                                              float frameScale, sp<GraphicBuffer>* outBuffer) {
    sp<ISurfaceComposer> s(ComposerService::getComposerService());
    if (s == NULL) return NO_INIT;
    status_t ret = s->captureLayers(layerHandle, outBuffer, sourceCrop, frameScale,
                                    true /* childrenOnly */);
    return ret;
}
// ----------------------------------------------------------------------------
+4 −1
Original line number Diff line number Diff line
@@ -173,9 +173,12 @@ public:
                                   int32_t minLayerZ, int32_t maxLayerZ, bool useIdentityTransform,
                                   Rotation rotation = eRotateNone) = 0;

    /**
     * Capture a subtree of the layer hierarchy, potentially ignoring the root node.
     */
    virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder,
                                   sp<GraphicBuffer>* outBuffer, const Rect& sourceCrop,
                                   float frameScale = 1.0) = 0;
                                   float frameScale = 1.0, bool childrenOnly = false) = 0;

    /* Clears the frame statistics for animations.
     *
+3 −1
Original line number Diff line number Diff line
@@ -297,8 +297,10 @@ public:
                            uint32_t reqHeight, int32_t minLayerZ, int32_t maxLayerZ,
                            bool useIdentityTransform, uint32_t rotation,
                            sp<GraphicBuffer>* outBuffer);
    static status_t captureLayers(const sp<IBinder>& layerHandle, Rect sourceCrop, float fameScale,
    static status_t captureLayers(const sp<IBinder>& layerHandle, Rect sourceCrop, float frameScale,
                                  sp<GraphicBuffer>* outBuffer);
    static status_t captureChildLayers(const sp<IBinder>& layerHandle, Rect sourceCrop,
                                       float frameScale, sp<GraphicBuffer>* outBuffer);
};

// ---------------------------------------------------------------------------
+2 −2
Original line number Diff line number Diff line
@@ -593,8 +593,8 @@ public:
            bool /*useIdentityTransform*/,
            Rotation /*rotation*/) override { return NO_ERROR; }
    virtual status_t captureLayers(const sp<IBinder>& /*parentHandle*/,
                                   sp<GraphicBuffer>* /*outBuffer*/,
                                   const Rect& /*sourceCrop*/, float /*frameScale*/) override {
                                   sp<GraphicBuffer>* /*outBuffer*/, const Rect& /*sourceCrop*/,
                                   float /*frameScale*/, bool /*childrenOnly*/) override {
        return NO_ERROR;
    }
    status_t clearAnimationFrameStats() override { return NO_ERROR; }
Loading