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

Commit 1387ea90 authored by Chia-I Wu's avatar Chia-I Wu Committed by Android (Google) Code Review
Browse files

Merge "surfaceflinger: fix screenshot dataspace under WCG" into pi-dev

parents eae8fe3d 36574d99
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -336,13 +336,6 @@ public:
    bool isSecure() const override { return mDevice->isSecure(); }
    bool needsFiltering() const override { return mDevice->needsFiltering(); }
    Rect getSourceCrop() const override { return mSourceCrop; }
    bool getWideColorSupport() const override { return mDevice->hasWideColorGamut(); }
    ui::Dataspace getDataSpace() const override {
        return mDevice->getCompositionDataSpace();
    }
    float getDisplayMaxLuminance() const override {
        return mDevice->getHdrCapabilities().getDesiredMaxLuminance();
    }

private:
    const sp<const DisplayDevice> mDevice;
+0 −3
Original line number Diff line number Diff line
@@ -30,9 +30,6 @@ public:
    virtual bool isSecure() const = 0;
    virtual bool needsFiltering() const = 0;
    virtual Rect getSourceCrop() const = 0;
    virtual bool getWideColorSupport() const = 0;
    virtual ui::Dataspace getDataSpace() const = 0;
    virtual float getDisplayMaxLuminance() const = 0;

    virtual void render(std::function<void()> drawLayers) { drawLayers(); }

+3 −12
Original line number Diff line number Diff line
@@ -4810,12 +4810,6 @@ status_t SurfaceFlinger::captureLayers(const sp<IBinder>& layerHandleBinder,
                return mCrop;
            }
        }
        bool getWideColorSupport() const override { return false; }
        Dataspace getDataSpace() const override { return Dataspace::UNKNOWN; }
        float getDisplayMaxLuminance() const override {
            return DisplayDevice::sDefaultMaxLumiance;
        }

        class ReparentForDrawing {
        public:
            const sp<Layer>& oldParent;
@@ -5013,12 +5007,9 @@ void SurfaceFlinger::renderScreenImplLocked(const RenderArea& renderArea,
        ALOGE("Invalid crop rect: b = %d (> %d)", sourceCrop.bottom, raHeight);
    }

    Dataspace outputDataspace = Dataspace::UNKNOWN;
    if (renderArea.getWideColorSupport()) {
        outputDataspace = renderArea.getDataSpace();
    }
    engine.setOutputDataSpace(outputDataspace);
    engine.setDisplayMaxLuminance(renderArea.getDisplayMaxLuminance());
    // assume ColorMode::SRGB / RenderIntent::COLORIMETRIC
    engine.setOutputDataSpace(Dataspace::SRGB);
    engine.setDisplayMaxLuminance(DisplayDevice::sDefaultMaxLumiance);

    // make sure to clear all GL error flags
    engine.checkErrors();