diff options
author | 2022-07-01 22:47:33 +0000 | |
---|---|---|
committer | 2022-08-01 17:49:27 +0000 | |
commit | b21272e8e6d8a145d27dc325c83d8adb72c60f73 (patch) | |
tree | 7e45670d54dd173e7dc481e1f3060becf5e99250 | |
parent | 29810f7554e86a2fa5dbb2d8b1de6552ac07f4a6 (diff) |
Remove container layer
Change-Id: Ib7a58820134705746415b1007a1ae75f27331830
13 files changed, 9 insertions, 129 deletions
diff --git a/services/surfaceflinger/Android.bp b/services/surfaceflinger/Android.bp index a8ba15f36d..c162487f63 100644 --- a/services/surfaceflinger/Android.bp +++ b/services/surfaceflinger/Android.bp @@ -145,7 +145,6 @@ filegroup { "ClientCache.cpp", "Client.cpp", "EffectLayer.cpp", - "ContainerLayer.cpp", "DisplayDevice.cpp", "DisplayHardware/AidlComposerHal.cpp", "DisplayHardware/HidlComposerHal.cpp", diff --git a/services/surfaceflinger/ContainerLayer.cpp b/services/surfaceflinger/ContainerLayer.cpp deleted file mode 100644 index 3ccc229261..0000000000 --- a/services/surfaceflinger/ContainerLayer.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2018 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 "ContainerLayer" - -#include "ContainerLayer.h" - -namespace android { - -ContainerLayer::ContainerLayer(const LayerCreationArgs& args) : Layer(args) {} - -ContainerLayer::~ContainerLayer() = default; - -bool ContainerLayer::isVisible() const { - return false; -} - -sp<Layer> ContainerLayer::createClone() { - sp<ContainerLayer> layer = mFlinger->getFactory().createContainerLayer( - LayerCreationArgs(mFlinger.get(), nullptr, mName + " (Mirror)", 0, LayerMetadata())); - layer->setInitialValuesForClone(this); - return layer; -} - -} // namespace android - -// TODO(b/129481165): remove the #pragma below and fix conversion issues -#pragma clang diagnostic pop // ignored "-Wconversion" diff --git a/services/surfaceflinger/ContainerLayer.h b/services/surfaceflinger/ContainerLayer.h deleted file mode 100644 index 9b7bab1e1d..0000000000 --- a/services/surfaceflinger/ContainerLayer.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2018 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 "Layer.h" - -namespace android { - -class ContainerLayer : public Layer { -public: - explicit ContainerLayer(const LayerCreationArgs&); - ~ContainerLayer() override; - - const char* getType() const override { return "ContainerLayer"; } - bool isVisible() const override; - - bool isCreatedFromMainThread() const override { return true; } - -protected: - bool canDrawShadows() const override { return false; } - sp<Layer> createClone() override; -}; - -} // namespace android diff --git a/services/surfaceflinger/LayerRenderArea.cpp b/services/surfaceflinger/LayerRenderArea.cpp index 896f25404d..e17b01f520 100644 --- a/services/surfaceflinger/LayerRenderArea.cpp +++ b/services/surfaceflinger/LayerRenderArea.cpp @@ -17,8 +17,8 @@ #include <ui/GraphicTypes.h> #include <ui/Transform.h> -#include "ContainerLayer.h" #include "DisplayDevice.h" +#include "EffectLayer.h" #include "Layer.h" #include "LayerRenderArea.h" #include "SurfaceFlinger.h" @@ -110,8 +110,9 @@ 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<ContainerLayer> screenshotParentLayer = mFlinger.getFactory().createContainerLayer( - {&mFlinger, nullptr, "Screenshot Parent"s, 0, LayerMetadata()}); + sp<EffectLayer> screenshotParentLayer = mFlinger.getFactory().createEffectLayer( + {&mFlinger, nullptr, "Screenshot Parent"s, ISurfaceComposerClient::eNoColorFill, + LayerMetadata()}); { Mutex::Autolock _l(mFlinger.mStateLock); reparentForDrawing(mLayer, screenshotParentLayer, sourceCrop); diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 569caa68b0..1ceb84a39d 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -108,7 +108,6 @@ #include "BufferStateLayer.h" #include "Client.h" #include "Colorizer.h" -#include "ContainerLayer.h" #include "DisplayDevice.h" #include "DisplayHardware/ComposerHal.h" #include "DisplayHardware/FramebufferSurface.h" @@ -4584,7 +4583,9 @@ status_t SurfaceFlinger::mirrorLayer(const LayerCreationArgs& args, if (!mirrorFrom) { return NAME_NOT_FOUND; } - status_t result = createContainerLayer(args, outHandle, &mirrorLayer); + LayerCreationArgs mirrorArgs = args; + mirrorArgs.flags |= ISurfaceComposerClient::eNoColorFill; + status_t result = createEffectLayer(mirrorArgs, outHandle, &mirrorLayer); if (result != NO_ERROR) { return result; } @@ -4684,13 +4685,6 @@ status_t SurfaceFlinger::createEffectLayer(const LayerCreationArgs& args, sp<IBi return NO_ERROR; } -status_t SurfaceFlinger::createContainerLayer(const LayerCreationArgs& args, sp<IBinder>* handle, - sp<Layer>* outLayer) { - *outLayer = getFactory().createContainerLayer(args); - *handle = (*outLayer)->getHandle(); - return NO_ERROR; -} - void SurfaceFlinger::markLayerPendingRemovalLocked(const sp<Layer>& layer) { mLayersPendingRemoval.add(layer); mLayersRemoved = true; diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index 46d941fbd6..551b0e8e78 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -816,9 +816,6 @@ private: status_t createEffectLayer(const LayerCreationArgs& args, sp<IBinder>* outHandle, sp<Layer>* outLayer); - status_t createContainerLayer(const LayerCreationArgs& args, sp<IBinder>* outHandle, - sp<Layer>* outLayer); - status_t mirrorLayer(const LayerCreationArgs& args, const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, int32_t* outLayerId); diff --git a/services/surfaceflinger/SurfaceFlingerDefaultFactory.cpp b/services/surfaceflinger/SurfaceFlingerDefaultFactory.cpp index 2399a39241..eb4c83927c 100644 --- a/services/surfaceflinger/SurfaceFlingerDefaultFactory.cpp +++ b/services/surfaceflinger/SurfaceFlingerDefaultFactory.cpp @@ -23,7 +23,6 @@ #include <ui/GraphicBuffer.h> #include "BufferStateLayer.h" -#include "ContainerLayer.h" #include "DisplayDevice.h" #include "EffectLayer.h" #include "FrameTracer/FrameTracer.h" @@ -90,10 +89,6 @@ std::unique_ptr<compositionengine::CompositionEngine> DefaultFactory::createComp return compositionengine::impl::createCompositionEngine(); } -sp<ContainerLayer> DefaultFactory::createContainerLayer(const LayerCreationArgs& args) { - return new ContainerLayer(args); -} - sp<BufferStateLayer> DefaultFactory::createBufferStateLayer(const LayerCreationArgs& args) { return new BufferStateLayer(args); } diff --git a/services/surfaceflinger/SurfaceFlingerDefaultFactory.h b/services/surfaceflinger/SurfaceFlingerDefaultFactory.h index 4000e09bbc..8d00379ba2 100644 --- a/services/surfaceflinger/SurfaceFlingerDefaultFactory.h +++ b/services/surfaceflinger/SurfaceFlingerDefaultFactory.h @@ -43,7 +43,6 @@ public: std::unique_ptr<compositionengine::CompositionEngine> createCompositionEngine() override; sp<BufferStateLayer> createBufferStateLayer(const LayerCreationArgs& args) override; sp<EffectLayer> createEffectLayer(const LayerCreationArgs& args) override; - sp<ContainerLayer> createContainerLayer(const LayerCreationArgs& args) override; std::unique_ptr<FrameTracer> createFrameTracer() override; std::unique_ptr<frametimeline::FrameTimeline> createFrameTimeline( std::shared_ptr<TimeStats> timeStats, pid_t surfaceFlingerPid) override; diff --git a/services/surfaceflinger/SurfaceFlingerFactory.h b/services/surfaceflinger/SurfaceFlingerFactory.h index 77a75c4e25..291838f81a 100644 --- a/services/surfaceflinger/SurfaceFlingerFactory.h +++ b/services/surfaceflinger/SurfaceFlingerFactory.h @@ -32,7 +32,6 @@ typedef int32_t PixelFormat; class BufferLayerConsumer; class BufferStateLayer; -class ContainerLayer; class DisplayDevice; class EffectLayer; class FrameTracer; @@ -93,7 +92,6 @@ public: virtual sp<BufferStateLayer> createBufferStateLayer(const LayerCreationArgs& args) = 0; virtual sp<EffectLayer> createEffectLayer(const LayerCreationArgs& args) = 0; - virtual sp<ContainerLayer> createContainerLayer(const LayerCreationArgs& args) = 0; virtual std::unique_ptr<FrameTracer> createFrameTracer() = 0; virtual std::unique_ptr<frametimeline::FrameTimeline> createFrameTimeline( std::shared_ptr<TimeStats> timeStats, pid_t surfaceFlingerPid) = 0; diff --git a/services/surfaceflinger/Tracing/tools/LayerTraceGenerator.cpp b/services/surfaceflinger/Tracing/tools/LayerTraceGenerator.cpp index c4b1b0fb13..1c06c92c17 100644 --- a/services/surfaceflinger/Tracing/tools/LayerTraceGenerator.cpp +++ b/services/surfaceflinger/Tracing/tools/LayerTraceGenerator.cpp @@ -80,10 +80,6 @@ public: return compositionengine::impl::createCompositionEngine(); } - sp<ContainerLayer> createContainerLayer(const LayerCreationArgs& args) { - return sp<ContainerLayer>::make(args); - } - sp<BufferStateLayer> createBufferStateLayer(const LayerCreationArgs& args) { return new BufferStateLayer(args); } diff --git a/services/surfaceflinger/fuzzer/surfaceflinger_fuzzers_utils.h b/services/surfaceflinger/fuzzer/surfaceflinger_fuzzers_utils.h index ed57e187b0..7152571cd3 100644 --- a/services/surfaceflinger/fuzzer/surfaceflinger_fuzzers_utils.h +++ b/services/surfaceflinger/fuzzer/surfaceflinger_fuzzers_utils.h @@ -31,7 +31,6 @@ #include <ui/DynamicDisplayInfo.h> #include "BufferStateLayer.h" -#include "ContainerLayer.h" #include "DisplayDevice.h" #include "DisplayHardware/ComposerHal.h" #include "EffectLayer.h" @@ -351,10 +350,6 @@ public: return new EffectLayer(args); } - sp<ContainerLayer> createContainerLayer(const LayerCreationArgs &args) override { - return new ContainerLayer(args); - } - std::unique_ptr<FrameTracer> createFrameTracer() override { return std::make_unique<android::mock::FrameTracer>(); } diff --git a/services/surfaceflinger/tests/unittests/CompositionTest.cpp b/services/surfaceflinger/tests/unittests/CompositionTest.cpp index 9c16e4cba8..accd07b7fa 100644 --- a/services/surfaceflinger/tests/unittests/CompositionTest.cpp +++ b/services/surfaceflinger/tests/unittests/CompositionTest.cpp @@ -37,7 +37,6 @@ #include <system/window.h> #include <utils/String8.h> -#include "ContainerLayer.h" #include "DisplayRenderArea.h" #include "EffectLayer.h" #include "Layer.h" @@ -952,12 +951,12 @@ struct BufferLayerVariant : public BaseLayerVariant<LayerProperties> { template <typename LayerProperties> struct ContainerLayerVariant : public BaseLayerVariant<LayerProperties> { using Base = BaseLayerVariant<LayerProperties>; - using FlingerLayerType = sp<ContainerLayer>; + using FlingerLayerType = sp<EffectLayer>; static FlingerLayerType createLayer(CompositionTest* test) { LayerCreationArgs args(test->mFlinger.flinger(), sp<Client>(), "test-container-layer", LayerProperties::LAYER_FLAGS, LayerMetadata()); - FlingerLayerType layer = new ContainerLayer(args); + FlingerLayerType layer = new EffectLayer(args); Base::template initLayerDrawingStateAndComputeBounds(test, layer); return layer; } diff --git a/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h b/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h index 77cefa62cc..d311e22e35 100644 --- a/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h +++ b/services/surfaceflinger/tests/unittests/TestableSurfaceFlinger.h @@ -30,7 +30,6 @@ #include <gui/ScreenCaptureResults.h> #include "BufferStateLayer.h" -#include "ContainerLayer.h" #include "DisplayDevice.h" #include "EffectLayer.h" #include "FakeVsyncConfiguration.h" @@ -127,10 +126,6 @@ public: sp<EffectLayer> createEffectLayer(const LayerCreationArgs&) override { return nullptr; } - sp<ContainerLayer> createContainerLayer(const LayerCreationArgs&) override { - return nullptr; - } - std::unique_ptr<FrameTracer> createFrameTracer() override { return std::make_unique<mock::FrameTracer>(); } |