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

Commit 46b61b9b authored by Patrick Williams's avatar Patrick Williams
Browse files

SF: Remove EffectLayer class

Bug: 238781169
Test: refactor, existing tests pass
Change-Id: I05724f6af3a207d566589420c2e3346b378b70e0
parent 0d169d90
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -154,7 +154,6 @@ filegroup {
        "DisplayHardware/PowerAdvisor.cpp",
        "DisplayHardware/VirtualDisplaySurface.cpp",
        "DisplayRenderArea.cpp",
        "EffectLayer.cpp",
        "Effects/Daltonizer.cpp",
        "EventLog/EventLog.cpp",
        "FlagManager.cpp",
+0 −47
Original line number Diff line number Diff line
/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// TODO(b/129481165): remove the #pragma below and fix conversion issues
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wconversion"

// #define LOG_NDEBUG 0
#undef LOG_TAG
#define LOG_TAG "EffectLayer"

#include "EffectLayer.h"

#include <stdint.h>
#include <stdlib.h>
#include <sys/types.h>

#include <compositionengine/CompositionEngine.h>
#include <compositionengine/LayerFECompositionState.h>
#include <renderengine/RenderEngine.h>
#include <ui/GraphicBuffer.h>
#include <utils/Errors.h>
#include <utils/Log.h>

#include "DisplayDevice.h"
#include "SurfaceFlinger.h"

namespace android {
// ---------------------------------------------------------------------------

EffectLayer::EffectLayer(const LayerCreationArgs& args) : BufferStateLayer(args) {}
EffectLayer::~EffectLayer() = default;

} // namespace android
+0 −36
Original line number Diff line number Diff line
/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#pragma once

#include <sys/types.h>

#include <cstdint>

#include "BufferStateLayer.h"

namespace android {

// A layer that can render a combination of the following effects.
//   * fill the bounds of the layer with a color
//   * render a shadow cast by the bounds of the layer
// If no effects are enabled, the layer is considered to be invisible.
class EffectLayer : public BufferStateLayer {
public:
    explicit EffectLayer(const LayerCreationArgs&);
    ~EffectLayer() override;
};

} // namespace android
+3 −3
Original line number Diff line number Diff line
@@ -65,9 +65,9 @@
#include <mutex>
#include <sstream>

#include "BufferStateLayer.h"
#include "DisplayDevice.h"
#include "DisplayHardware/HWComposer.h"
#include "EffectLayer.h"
#include "FrameTimeline.h"
#include "FrameTracer/FrameTracer.h"
#include "LayerProtoHelper.h"
@@ -2205,8 +2205,8 @@ void Layer::prepareShadowClientComposition(LayerFE::LayerSettings& caster,
    renderengine::ShadowSettings state = mFlinger->mDrawingState.globalShadowSettings;

    // Note: this preserves existing behavior of shadowing the entire layer and not cropping it if
    // transparent regions are present. This may not be necessary since shadows are only cast by
    // SurfaceFlinger's EffectLayers, which do not typically use transparent regions.
    // transparent regions are present. This may not be necessary since shadows are typically cast
    // by layers without transparent regions.
    state.boundaries = mBounds;

    // Shift the spot light x-position to the middle of the display and then
+1 −2
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
#include <ui/Transform.h>

#include "DisplayDevice.h"
#include "EffectLayer.h"
#include "Layer.h"
#include "LayerRenderArea.h"
#include "SurfaceFlinger.h"
@@ -110,7 +109,7 @@ void LayerRenderArea::render(std::function<void()> drawLayers) {
        // layer which has no properties set and which does not draw.
        //  We hold the statelock as the reparent-for-drawing operation modifies the
        //  hierarchy and there could be readers on Binder threads, like dump.
        sp<EffectLayer> screenshotParentLayer = mFlinger.getFactory().createEffectLayer(
        auto screenshotParentLayer = mFlinger.getFactory().createEffectLayer(
                {&mFlinger, nullptr, "Screenshot Parent"s, ISurfaceComposerClient::eNoColorFill,
                 LayerMetadata()});
        {
Loading