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

Commit 652493db authored by Alec Mouri's avatar Alec Mouri Committed by Android (Google) Code Review
Browse files

Merge "Delete non-colormanagement code" into main

parents 66f2b3e0 47bcb071
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -281,8 +281,6 @@ interface ISurfaceComposer {
     */
     */
    List<LayerDebugInfo> getLayerDebugInfo();
    List<LayerDebugInfo> getLayerDebugInfo();


    boolean getColorManagement();

    /**
    /**
     * Gets the composition preference of the default data space and default pixel format,
     * Gets the composition preference of the default data space and default pixel format,
     * as well as the wide color gamut data space and wide color gamut pixel format.
     * as well as the wide color gamut data space and wide color gamut pixel format.
+0 −1
Original line number Original line Diff line number Diff line
@@ -110,7 +110,6 @@ public:
                (override));
                (override));
    MOCK_METHOD(binder::Status, onPullAtom, (int32_t, gui::PullAtomData*), (override));
    MOCK_METHOD(binder::Status, onPullAtom, (int32_t, gui::PullAtomData*), (override));
    MOCK_METHOD(binder::Status, getLayerDebugInfo, (std::vector<gui::LayerDebugInfo>*), (override));
    MOCK_METHOD(binder::Status, getLayerDebugInfo, (std::vector<gui::LayerDebugInfo>*), (override));
    MOCK_METHOD(binder::Status, getColorManagement, (bool*), (override));
    MOCK_METHOD(binder::Status, getCompositionPreference, (gui::CompositionPreference*),
    MOCK_METHOD(binder::Status, getCompositionPreference, (gui::CompositionPreference*),
                (override));
                (override));
    MOCK_METHOD(binder::Status, getDisplayedContentSamplingAttributes,
    MOCK_METHOD(binder::Status, getDisplayedContentSamplingAttributes,
+0 −4
Original line number Original line Diff line number Diff line
@@ -879,10 +879,6 @@ public:
        return binder::Status::ok();
        return binder::Status::ok();
    }
    }


    binder::Status getColorManagement(bool* /*outGetColorManagement*/) override {
        return binder::Status::ok();
    }

    binder::Status getCompositionPreference(gui::CompositionPreference* /*outPref*/) override {
    binder::Status getCompositionPreference(gui::CompositionPreference* /*outPref*/) override {
        return binder::Status::ok();
        return binder::Status::ok();
    }
    }
+0 −1
Original line number Original line Diff line number Diff line
@@ -121,7 +121,6 @@ static std::unique_ptr<RenderEngine> createRenderEngine(RenderEngine::RenderEngi
                        .setSupportsBackgroundBlur(true)
                        .setSupportsBackgroundBlur(true)
                        .setContextPriority(RenderEngine::ContextPriority::REALTIME)
                        .setContextPriority(RenderEngine::ContextPriority::REALTIME)
                        .setRenderEngineType(type)
                        .setRenderEngineType(type)
                        .setUseColorManagerment(true)
                        .build();
                        .build();
    return RenderEngine::create(args);
    return RenderEngine::create(args);
}
}
+106 −113
Original line number Original line Diff line number Diff line
@@ -389,7 +389,6 @@ GLESRenderEngine::GLESRenderEngine(const RenderEngineCreationArgs& args, EGLDisp
        mVpWidth(0),
        mVpWidth(0),
        mVpHeight(0),
        mVpHeight(0),
        mFramebufferImageCacheSize(args.imageCacheSize),
        mFramebufferImageCacheSize(args.imageCacheSize),
        mUseColorManagement(args.useColorManagement),
        mPrecacheToneMapperShaderOnly(args.precacheToneMapperShaderOnly) {
        mPrecacheToneMapperShaderOnly(args.precacheToneMapperShaderOnly) {
    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
    glGetIntegerv(GL_MAX_VIEWPORT_DIMS, mMaxViewportDims);
    glGetIntegerv(GL_MAX_VIEWPORT_DIMS, mMaxViewportDims);
@@ -410,7 +409,6 @@ GLESRenderEngine::GLESRenderEngine(const RenderEngineCreationArgs& args, EGLDisp


    // mColorBlindnessCorrection = M;
    // mColorBlindnessCorrection = M;


    if (mUseColorManagement) {
    const ColorSpace srgb(ColorSpace::sRGB());
    const ColorSpace srgb(ColorSpace::sRGB());
    const ColorSpace displayP3(ColorSpace::DisplayP3());
    const ColorSpace displayP3(ColorSpace::DisplayP3());
    const ColorSpace bt2020(ColorSpace::BT2020());
    const ColorSpace bt2020(ColorSpace::BT2020());
@@ -436,7 +434,6 @@ GLESRenderEngine::GLESRenderEngine(const RenderEngineCreationArgs& args, EGLDisp
    // Compute BT2020 to sRGB and Display P3 transform matrix
    // Compute BT2020 to sRGB and Display P3 transform matrix
    mBt2020ToSrgb = mXyzToSrgb * mBt2020ToXyz;
    mBt2020ToSrgb = mXyzToSrgb * mBt2020ToXyz;
    mBt2020ToDisplayP3 = mXyzToDisplayP3 * mBt2020ToXyz;
    mBt2020ToDisplayP3 = mXyzToDisplayP3 * mBt2020ToXyz;
    }


    char value[PROPERTY_VALUE_MAX];
    char value[PROPERTY_VALUE_MAX];
    property_get("debug.egl.traceGpuCompletion", value, "0");
    property_get("debug.egl.traceGpuCompletion", value, "0");
@@ -518,7 +515,7 @@ Framebuffer* GLESRenderEngine::getFramebufferForDrawing() {


std::future<void> GLESRenderEngine::primeCache() {
std::future<void> GLESRenderEngine::primeCache() {
    ProgramCache::getInstance().primeCache(mInProtectedContext ? mProtectedEGLContext : mEGLContext,
    ProgramCache::getInstance().primeCache(mInProtectedContext ? mProtectedEGLContext : mEGLContext,
                                           mUseColorManagement, mPrecacheToneMapperShaderOnly);
                                           mPrecacheToneMapperShaderOnly);
    return {};
    return {};
}
}


@@ -1444,13 +1441,10 @@ void GLESRenderEngine::drawMesh(const Mesh& mesh) {
    // BT2020 data space, in that case, the output data space is set to be
    // BT2020 data space, in that case, the output data space is set to be
    // BT2020_HLG or BT2020_PQ respectively. In GPU fall back we need
    // BT2020_HLG or BT2020_PQ respectively. In GPU fall back we need
    // to respect this and convert non-HDR content to HDR format.
    // to respect this and convert non-HDR content to HDR format.
    if (mUseColorManagement) {
    Dataspace inputStandard = static_cast<Dataspace>(mDataSpace & Dataspace::STANDARD_MASK);
    Dataspace inputStandard = static_cast<Dataspace>(mDataSpace & Dataspace::STANDARD_MASK);
    Dataspace inputTransfer = static_cast<Dataspace>(mDataSpace & Dataspace::TRANSFER_MASK);
    Dataspace inputTransfer = static_cast<Dataspace>(mDataSpace & Dataspace::TRANSFER_MASK);
        Dataspace outputStandard =
    Dataspace outputStandard = static_cast<Dataspace>(mOutputDataSpace & Dataspace::STANDARD_MASK);
                static_cast<Dataspace>(mOutputDataSpace & Dataspace::STANDARD_MASK);
    Dataspace outputTransfer = static_cast<Dataspace>(mOutputDataSpace & Dataspace::TRANSFER_MASK);
        Dataspace outputTransfer =
                static_cast<Dataspace>(mOutputDataSpace & Dataspace::TRANSFER_MASK);
    bool needsXYZConversion = needsXYZTransformMatrix();
    bool needsXYZConversion = needsXYZTransformMatrix();


    // NOTE: if the input standard of the input dataspace is not STANDARD_DCI_P3 or
    // NOTE: if the input standard of the input dataspace is not STANDARD_DCI_P3 or
@@ -1535,7 +1529,6 @@ void GLESRenderEngine::drawMesh(const Mesh& mesh) {
        managedState.outputTransferFunction =
        managedState.outputTransferFunction =
                Description::dataSpaceToTransferFunction(outputTransfer);
                Description::dataSpaceToTransferFunction(outputTransfer);
    }
    }
    }


    ProgramCache::getInstance().useProgram(mInProtectedContext ? mProtectedEGLContext : mEGLContext,
    ProgramCache::getInstance().useProgram(mInProtectedContext ? mProtectedEGLContext : mEGLContext,
                                           managedState);
                                           managedState);
@@ -1547,7 +1540,7 @@ void GLESRenderEngine::drawMesh(const Mesh& mesh) {
        glDrawArrays(mesh.getPrimitive(), 0, mesh.getVertexCount());
        glDrawArrays(mesh.getPrimitive(), 0, mesh.getVertexCount());
    }
    }


    if (mUseColorManagement && outputDebugPPMs) {
    if (outputDebugPPMs) {
        static uint64_t managedColorFrameCount = 0;
        static uint64_t managedColorFrameCount = 0;
        std::ostringstream out;
        std::ostringstream out;
        out << "/data/texture_out" << managedColorFrameCount++;
        out << "/data/texture_out" << managedColorFrameCount++;
Loading