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

Commit fa507ffb authored by Jeykumar Sankaran's avatar Jeykumar Sankaran Committed by Linux Build Service Account
Browse files

frameworks/native: Propagate dirty region in hwc_layer.

This change propagates dirty rect value of each layer down to HWC
in hwc_layer structure.

Conflicts:
	include/gui/IGraphicBufferProducer.h
	libs/gui/BufferQueueProducer.cpp
	libs/gui/Surface.cpp
	services/surfaceflinger/Layer.cpp
	services/surfaceflinger/Layer.h

Change-Id: I91d87facf4a321b92539de5353faf09b553d4919
parent 00685bad
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -59,6 +59,9 @@ class BufferItem : public Flattenable<BufferItem> {
    // mCrop is the current crop rectangle for this buffer slot.
    Rect mCrop;

    // mDirtyRect is the dirty rectangle for this buffer slot.
    Rect mDirtyRect;

    // mTransform is the current transform flags for this buffer slot.
    // refer to NATIVE_WINDOW_TRANSFORM_* in <window.h>
    uint32_t mTransform;
+7 −0
Original line number Diff line number Diff line
@@ -176,6 +176,9 @@ public:
    // getCurrentCrop returns the cropping rectangle of the current buffer.
    Rect getCurrentCrop() const;

    // getDirtyRegion returns the dirty rect associated with the current buffer.
    Rect getCurrentDirtyRect() const;

    // getCurrentTransform returns the transform of the current buffer.
    uint32_t getCurrentTransform() const;

@@ -369,6 +372,10 @@ private:
    // It gets set each time updateTexImage is called.
    Rect mCurrentCrop;

    //mCurrentDirtyRect is the dirty rectangle associated with the current
    //buffer.
    Rect mCurrentDirtyRect;

    // mCurrentTransform is the transform identifier for the current texture. It
    // gets set each time updateTexImage is called.
    uint32_t mCurrentTransform;
+3 −0
Original line number Diff line number Diff line
@@ -67,6 +67,9 @@ public:
        // mCrop is the current crop rectangle for this buffer slot.
        Rect mCrop;

        // mDirtyRect is the dirty rectangle for this buffer slot.
        Rect mDirtyRect;

        // mTransform is the current transform flags for this buffer slot.
        // refer to NATIVE_WINDOW_TRANSFORM_* in <window.h>
        uint32_t mTransform;
+27 −0
Original line number Diff line number Diff line
@@ -281,6 +281,14 @@ public:
        : timestamp(timestamp), isAutoTimestamp(isAutoTimestamp), crop(crop),
          scalingMode(scalingMode), transform(transform), stickyTransform(sticky),
          async(async), fence(fence) { }

        inline QueueBufferInput(int64_t timestamp, bool isAutoTimestamp,
                const Rect& crop, const Rect& dirtyRect, int scalingMode, uint32_t transform, bool async,
                const sp<Fence>& fence, uint32_t sticky = 0)
        : timestamp(timestamp), isAutoTimestamp(isAutoTimestamp), crop(crop),
          dirtyRect(dirtyRect),scalingMode(scalingMode), transform(transform), stickyTransform(sticky),
          async(async), fence(fence) { }

        inline void deflate(int64_t* outTimestamp, bool* outIsAutoTimestamp,
                Rect* outCrop, int* outScalingMode, uint32_t* outTransform,
                bool* outAsync, sp<Fence>* outFence,
@@ -297,6 +305,24 @@ public:
            }
        }

        inline void deflate(int64_t* outTimestamp, bool* outIsAutoTimestamp,
                Rect* outCrop, Rect* outDirtyRect, int* outScalingMode, uint32_t* outTransform,
                bool* outAsync, sp<Fence>* outFence,
                uint32_t* outStickyTransform = NULL) const {
            *outTimestamp = timestamp;
            *outIsAutoTimestamp = bool(isAutoTimestamp);
            *outCrop = crop;
            *outDirtyRect = dirtyRect;
            *outScalingMode = scalingMode;
            *outTransform = transform;
            *outAsync = bool(async);
            *outFence = fence;
            if (outStickyTransform != NULL) {
                *outStickyTransform = stickyTransform;
            }
        }


        // Flattenable protocol
        size_t getFlattenedSize() const;
        size_t getFdCount() const;
@@ -307,6 +333,7 @@ public:
        int64_t timestamp;
        int isAutoTimestamp;
        Rect crop;
        Rect dirtyRect;
        int scalingMode;
        uint32_t transform;
        uint32_t stickyTransform;
+8 −0
Original line number Diff line number Diff line
@@ -101,6 +101,10 @@ public:
     */
    void allocateBuffers();

    /* sets dirty rectangle of the buffer that gets queued next for the
     * Surface */
    status_t setDirtyRect(const Rect* dirtyRect);

protected:
    virtual ~Surface();

@@ -226,6 +230,10 @@ private:
    // that gets queued. It is set by calling setCrop.
    Rect mCrop;

    // mDirtyRect is the dirty rectangle set for the next buffer that gets
    // queued. It is set by calling setDirtyRect.
    Rect mDirtyRect;

    // mScalingMode is the scaling mode that will be used for the next
    // buffers that get queued. It is set by calling setScalingMode.
    int mScalingMode;
Loading