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

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

Merge changes I3110de53,I0dc549eb into main

* changes:
  Dim correctly in screenshots on some devices
  Delete genTextures and deleteTextures from RenderEngine
parents 2978b5eb 9af38ba9
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -46,10 +46,6 @@ struct Buffer {
    // Fence that will fire when the buffer is ready to be bound.
    sp<Fence> fence = nullptr;

    // Texture identifier to bind the external texture to.
    // TODO(alecmouri): This is GL-specific...make the type backend-agnostic.
    uint32_t textureName = 0;

    // Whether to use filtering when rendering the texture.
    bool useTextureFiltering = false;

@@ -182,7 +178,6 @@ struct LayerSettings {
// compositionengine/impl/ClientCompositionRequestCache.cpp
static inline bool operator==(const Buffer& lhs, const Buffer& rhs) {
    return lhs.buffer == rhs.buffer && lhs.fence == rhs.fence &&
            lhs.textureName == rhs.textureName &&
            lhs.useTextureFiltering == rhs.useTextureFiltering &&
            lhs.textureTransform == rhs.textureTransform &&
            lhs.usePremultipliedAlpha == rhs.usePremultipliedAlpha &&
@@ -237,7 +232,6 @@ static inline void PrintTo(const Buffer& settings, ::std::ostream* os) {
        << (settings.buffer.get() ? decodePixelFormat(settings.buffer->getPixelFormat()).c_str()
                                  : "");
    *os << "\n    .fence = " << settings.fence.get();
    *os << "\n    .textureName = " << settings.textureName;
    *os << "\n    .useTextureFiltering = " << settings.useTextureFiltering;
    *os << "\n    .textureTransform = ";
    PrintMatrix(settings.textureTransform, os);
+0 −3
Original line number Diff line number Diff line
@@ -112,9 +112,6 @@ public:
    // dump the extension strings. always call the base class.
    virtual void dump(std::string& result) = 0;

    virtual void genTextures(size_t count, uint32_t* names) = 0;
    virtual void deleteTextures(size_t count, uint32_t const* names) = 0;

    // queries that are required to be thread safe
    virtual size_t getMaxTextureSize() const = 0;
    virtual size_t getMaxViewportDims() const = 0;
+0 −4
Original line number Diff line number Diff line
@@ -35,9 +35,6 @@ public:

    MOCK_METHOD0(primeCache, std::future<void>());
    MOCK_METHOD1(dump, void(std::string&));
    MOCK_METHOD2(genTextures, void(size_t, uint32_t*));
    MOCK_METHOD2(deleteTextures, void(size_t, uint32_t const*));
    MOCK_METHOD1(drawMesh, void(const renderengine::Mesh&));
    MOCK_CONST_METHOD0(getMaxTextureSize, size_t());
    MOCK_CONST_METHOD0(getMaxViewportDims, size_t());
    MOCK_CONST_METHOD0(isProtected, bool());
@@ -53,7 +50,6 @@ public:
                 void(const std::shared_ptr<std::promise<FenceResult>>&&, const DisplaySettings&,
                      const std::vector<LayerSettings>&, const std::shared_ptr<ExternalTexture>&,
                      const bool, base::unique_fd&&));
    MOCK_METHOD0(cleanFramebufferCache, void());
    MOCK_METHOD0(getContextPriority, int());
    MOCK_METHOD0(supportsBackgroundBlur, bool());
    MOCK_METHOD1(onActiveDisplaySizeChanged, void(ui::Size));
+0 −2
Original line number Diff line number Diff line
@@ -70,8 +70,6 @@ public:
    void onActiveDisplaySizeChanged(ui::Size size) override final;
    int reportShadersCompiled();

    virtual void genTextures(size_t /*count*/, uint32_t* /*names*/) override final{};
    virtual void deleteTextures(size_t /*count*/, uint32_t const* /*names*/) override final{};
    virtual void setEnableTracing(bool tracingEnabled) override final;

    void useProtectedContext(bool useProtectedContext) override;
+0 −21
Original line number Diff line number Diff line
@@ -278,9 +278,6 @@ public:
        if (WRITE_BUFFER_TO_FILE_ON_FAILURE && ::testing::Test::HasFailure()) {
            writeBufferToFile("/data/texture_out_");
        }
        for (uint32_t texName : mTexNames) {
            mRE->deleteTextures(1, &texName);
        }
        const ::testing::TestInfo* const test_info =
                ::testing::UnitTest::GetInstance()->current_test_info();
        ALOGD("**** Tearing down after %s.%s\n", test_info->test_case_name(), test_info->name());
@@ -623,8 +620,6 @@ public:

    std::unique_ptr<renderengine::RenderEngine> mRE;
    std::shared_ptr<renderengine::ExternalTexture> mBuffer;

    std::vector<uint32_t> mTexNames;
};

void RenderEngineTest::initializeRenderEngine() {
@@ -668,9 +663,6 @@ struct BufferSourceVariant {
    static void fillColor(renderengine::LayerSettings& layer, half r, half g, half b,
                          RenderEngineTest* fixture) {
        const auto buf = fixture->allocateSourceBuffer(1, 1);
        uint32_t texName;
        fixture->mRE->genTextures(1, &texName);
        fixture->mTexNames.push_back(texName);

        uint8_t* pixels;
        buf->getBuffer()->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN,
@@ -690,7 +682,6 @@ struct BufferSourceVariant {
        buf->getBuffer()->unlock();

        layer.source.buffer.buffer = buf;
        layer.source.buffer.textureName = texName;
        layer.sourceDataspace = ui::Dataspace::V0_SRGB_LINEAR;
        OpaquenessVariant::setOpaqueBit(layer);
    }
@@ -1239,9 +1230,6 @@ void RenderEngineTest::fillRedBufferTextureTransform() {
    // Here will allocate a checker board texture, but transform texture
    // coordinates so that only the upper left is applied.
    const auto buf = allocateSourceBuffer(2, 2);
    uint32_t texName;
    RenderEngineTest::mRE->genTextures(1, &texName);
    this->mTexNames.push_back(texName);

    uint8_t* pixels;
    buf->getBuffer()->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN,
@@ -1262,7 +1250,6 @@ void RenderEngineTest::fillRedBufferTextureTransform() {
    buf->getBuffer()->unlock();

    layer.source.buffer.buffer = buf;
    layer.source.buffer.textureName = texName;
    // Transform coordinates to only be inside the red quadrant.
    layer.source.buffer.textureTransform = mat4::scale(vec4(0.2f, 0.2f, 1.f, 1.f));
    layer.alpha = 1.0f;
@@ -1288,9 +1275,6 @@ void RenderEngineTest::fillRedBufferWithPremultiplyAlpha() {

    renderengine::LayerSettings layer;
    const auto buf = allocateSourceBuffer(1, 1);
    uint32_t texName;
    RenderEngineTest::mRE->genTextures(1, &texName);
    this->mTexNames.push_back(texName);

    uint8_t* pixels;
    buf->getBuffer()->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN,
@@ -1302,7 +1286,6 @@ void RenderEngineTest::fillRedBufferWithPremultiplyAlpha() {
    buf->getBuffer()->unlock();

    layer.source.buffer.buffer = buf;
    layer.source.buffer.textureName = texName;
    layer.source.buffer.usePremultipliedAlpha = true;
    layer.alpha = 0.5f;
    layer.geometry.boundaries = Rect(1, 1).toFloatRect();
@@ -1327,9 +1310,6 @@ void RenderEngineTest::fillRedBufferWithoutPremultiplyAlpha() {

    renderengine::LayerSettings layer;
    const auto buf = allocateSourceBuffer(1, 1);
    uint32_t texName;
    RenderEngineTest::mRE->genTextures(1, &texName);
    this->mTexNames.push_back(texName);

    uint8_t* pixels;
    buf->getBuffer()->lock(GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN,
@@ -1341,7 +1321,6 @@ void RenderEngineTest::fillRedBufferWithoutPremultiplyAlpha() {
    buf->getBuffer()->unlock();

    layer.source.buffer.buffer = buf;
    layer.source.buffer.textureName = texName;
    layer.source.buffer.usePremultipliedAlpha = false;
    layer.alpha = 0.5f;
    layer.geometry.boundaries = Rect(1, 1).toFloatRect();
Loading