diff options
13 files changed, 98 insertions, 97 deletions
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp index 90a02b3ad9..26abe1c7c7 100644 --- a/services/surfaceflinger/BufferLayer.cpp +++ b/services/surfaceflinger/BufferLayer.cpp @@ -161,7 +161,8 @@ std::optional<renderengine::LayerSettings> BufferLayer::prepareClientComposition finished = true; return; } - under.orSelf(layer->visibleRegion); + + under.orSelf(layer->getScreenBounds()); }); // if not everything below us is covered, we plug the holes! Region holes(targetSettings.clip.subtract(under)); diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h index 6a0caf0746..b066cd1bda 100644 --- a/services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h +++ b/services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFECompositionState.h @@ -56,10 +56,6 @@ struct LayerFECompositionState { Region geomActiveTransparentRegion; FloatRect geomLayerBounds; - // TODO(lpique): b/121291683 Remove this one we are sure we don't need the - // value recomputed / set every frame. - Region geomVisibleRegion; - /* * Presentation */ diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/LayerCompositionState.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/LayerCompositionState.h index ab01c209d1..726c850780 100644 --- a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/LayerCompositionState.h +++ b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/LayerCompositionState.h @@ -21,6 +21,7 @@ #include <compositionengine/LayerFECompositionState.h> #include <renderengine/Mesh.h> +#include <ui/Region.h> namespace android { @@ -28,7 +29,7 @@ namespace compositionengine::impl { struct LayerCompositionState { /* - * State intended to be set by LayerFE::getCompositionState + * State set by LayerFE::getCompositionState */ LayerFECompositionState frontEnd; diff --git a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/OutputLayerCompositionState.h b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/OutputLayerCompositionState.h index de0f08ace8..13474492af 100644 --- a/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/OutputLayerCompositionState.h +++ b/services/surfaceflinger/CompositionEngine/include/compositionengine/impl/OutputLayerCompositionState.h @@ -40,9 +40,18 @@ class HWComposer; namespace compositionengine::impl { struct OutputLayerCompositionState { - // The region of this layer which is visible on this output + // The portion of the layer that is not obscured by opaque layers on top Region visibleRegion; + // The portion of the layer that is not obscured and is also opaque + Region visibleNonTransparentRegion; + + // The portion of the layer that is obscured by opaque layers on top + Region coveredRegion; + + // The visibleRegion transformed to output space + Region outputSpaceVisibleRegion; + // If true, client composition will be used on this output bool forceClientComposition{false}; @@ -62,7 +71,7 @@ struct OutputLayerCompositionState { ui::Dataspace dataspace{ui::Dataspace::UNKNOWN}; // The Z order index of this layer on this output - uint32_t z; + uint32_t z{0}; /* * HWC state diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp index 903ca9891c..9f4f259f7c 100644 --- a/services/surfaceflinger/CompositionEngine/src/Output.cpp +++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp @@ -601,7 +601,7 @@ std::vector<renderengine::LayerSettings> Output::generateClientCompositionReques const auto& layerFEState = layer->getLayer().getState().frontEnd; auto& layerFE = layer->getLayerFE(); - const Region clip(viewportRegion.intersect(layerFEState.geomVisibleRegion)); + const Region clip(viewportRegion.intersect(layerState.visibleRegion)); ALOGV("Layer: %s", layerFE.getDebugName()); if (clip.isEmpty()) { ALOGV(" Skipping for empty clip"); diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp index 73bb03be02..21f0ce8b15 100644 --- a/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp +++ b/services/surfaceflinger/CompositionEngine/src/OutputLayer.cpp @@ -315,11 +315,6 @@ void OutputLayer::updateCompositionState(bool includeGeometry) { ? outputState.targetDataspace : layerFEState.dataspace; - // TODO(lpique): b/121291683 Remove this one we are sure we don't need the - // value recomputed / set every frame. - mState.visibleRegion = outputState.transform.transform( - layerFEState.geomVisibleRegion.intersect(outputState.viewport)); - // These are evaluated every frame as they can potentially change at any // time. if (layerFEState.forceClientComposition || !profile.isDataspaceSupported(mState.dataspace)) { @@ -421,13 +416,13 @@ void OutputLayer::writeOutputIndependentGeometryStateToHWC( void OutputLayer::writeOutputDependentPerFrameStateToHWC(HWC2::Layer* hwcLayer) { const auto& outputDependentState = getState(); - // TODO(lpique): b/121291683 visibleRegion is output-dependent geometry + // TODO(lpique): b/121291683 outputSpaceVisibleRegion is output-dependent geometry // state and should not change every frame. - if (auto error = hwcLayer->setVisibleRegion(outputDependentState.visibleRegion); + if (auto error = hwcLayer->setVisibleRegion(outputDependentState.outputSpaceVisibleRegion); error != HWC2::Error::None) { ALOGE("[%s] Failed to set visible region: %s (%d)", mLayerFE->getDebugName(), to_string(error).c_str(), static_cast<int32_t>(error)); - outputDependentState.visibleRegion.dump(LOG_TAG); + outputDependentState.outputSpaceVisibleRegion.dump(LOG_TAG); } if (auto error = hwcLayer->setDataspace(outputDependentState.dataspace); diff --git a/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp b/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp index e320bee4e1..ad668b6b89 100644 --- a/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp +++ b/services/surfaceflinger/CompositionEngine/src/OutputLayerCompositionState.cpp @@ -42,6 +42,15 @@ void OutputLayerCompositionState::dump(std::string& out) const { dumpVal(out, "visibleRegion", visibleRegion); out.append(" "); + dumpVal(out, "visibleNonTransparentRegion", visibleNonTransparentRegion); + + out.append(" "); + dumpVal(out, "coveredRegion", coveredRegion); + + out.append(" "); + dumpVal(out, "output visibleRegion", outputSpaceVisibleRegion); + + out.append(" "); dumpVal(out, "forceClientComposition", forceClientComposition); dumpVal(out, "clearClientTarget", clearClientTarget); dumpVal(out, "displayFrame", displayFrame); diff --git a/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp b/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp index 75e960c575..2276dc3691 100644 --- a/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp +++ b/services/surfaceflinger/CompositionEngine/tests/OutputLayerTest.cpp @@ -574,7 +574,7 @@ struct OutputLayerWriteStateToHWCTest : public OutputLayerTest { static const half4 kColor; static const Rect kDisplayFrame; - static const Region kVisibleRegion; + static const Region kOutputSpaceVisibleRegion; static const mat4 kColorTransform; static const Region kSurfaceDamage; static const HdrMetadata kHdrMetadata; @@ -590,7 +590,7 @@ struct OutputLayerWriteStateToHWCTest : public OutputLayerTest { outputLayerState.sourceCrop = kSourceCrop; outputLayerState.z = kZOrder; outputLayerState.bufferTransform = static_cast<Hwc2::Transform>(kBufferTransform); - outputLayerState.visibleRegion = kVisibleRegion; + outputLayerState.outputSpaceVisibleRegion = kOutputSpaceVisibleRegion; outputLayerState.dataspace = kDataspace; mLayerState.frontEnd.blendMode = kBlendMode; @@ -629,7 +629,7 @@ struct OutputLayerWriteStateToHWCTest : public OutputLayerTest { } void expectPerFrameCommonCalls(SimulateUnsupported unsupported = SimulateUnsupported::None) { - EXPECT_CALL(*mHwcLayer, setVisibleRegion(RegionEq(kVisibleRegion))) + EXPECT_CALL(*mHwcLayer, setVisibleRegion(RegionEq(kOutputSpaceVisibleRegion))) .WillOnce(Return(kError)); EXPECT_CALL(*mHwcLayer, setDataspace(kDataspace)).WillOnce(Return(kError)); EXPECT_CALL(*mHwcLayer, setColorTransform(kColorTransform)) @@ -673,7 +673,8 @@ struct OutputLayerWriteStateToHWCTest : public OutputLayerTest { const half4 OutputLayerWriteStateToHWCTest::kColor{81.f / 255.f, 82.f / 255.f, 83.f / 255.f, 84.f / 255.f}; const Rect OutputLayerWriteStateToHWCTest::kDisplayFrame{1001, 1002, 1003, 10044}; -const Region OutputLayerWriteStateToHWCTest::kVisibleRegion{Rect{1005, 1006, 1007, 1008}}; +const Region OutputLayerWriteStateToHWCTest::kOutputSpaceVisibleRegion{ + Rect{1005, 1006, 1007, 1008}}; const mat4 OutputLayerWriteStateToHWCTest::kColorTransform{ 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, diff --git a/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp b/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp index 1d5f2f0d54..b0e8e3699c 100644 --- a/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp +++ b/services/surfaceflinger/CompositionEngine/tests/OutputTest.cpp @@ -661,9 +661,9 @@ TEST_F(GenerateClientCompositionRequestsTest, worksForLandscapeModeSplitScreen) impl::OutputLayerCompositionState leftOutputLayerState; leftOutputLayerState.clearClientTarget = false; + leftOutputLayerState.visibleRegion = Region{Rect{0, 0, 1000, 1000}}; impl::LayerCompositionState leftLayerState; - leftLayerState.frontEnd.geomVisibleRegion = Region{Rect{0, 0, 1000, 1000}}; leftLayerState.frontEnd.isOpaque = true; const half3 leftLayerColor{1.f, 0.f, 0.f}; @@ -672,9 +672,9 @@ TEST_F(GenerateClientCompositionRequestsTest, worksForLandscapeModeSplitScreen) impl::OutputLayerCompositionState rightOutputLayerState; rightOutputLayerState.clearClientTarget = false; + rightOutputLayerState.visibleRegion = Region{Rect{1000, 0, 2000, 1000}}; impl::LayerCompositionState rightLayerState; - rightLayerState.frontEnd.geomVisibleRegion = Region{Rect{1000, 0, 2000, 1000}}; rightLayerState.frontEnd.isOpaque = true; const half3 rightLayerColor{0.f, 1.f, 0.f}; @@ -735,9 +735,9 @@ TEST_F(GenerateClientCompositionRequestsTest, ignoresLayersThatDoNotIntersectWit impl::OutputLayerCompositionState outputLayerState; outputLayerState.clearClientTarget = false; + outputLayerState.visibleRegion = Region{Rect{3000, 0, 4000, 1000}}; impl::LayerCompositionState layerState; - layerState.frontEnd.geomVisibleRegion = Region{Rect{3000, 0, 4000, 1000}}; layerState.frontEnd.isOpaque = true; EXPECT_CALL(*outputLayer, getState()).WillRepeatedly(ReturnRef(outputLayerState)); @@ -790,16 +790,16 @@ TEST_F(GenerateClientCompositionRequestsTest, clearsDeviceLayesAfterFirst) { impl::OutputLayerCompositionState leftOutputLayerState; leftOutputLayerState.clearClientTarget = true; + leftOutputLayerState.visibleRegion = Region{Rect{0, 0, 1000, 1000}}; impl::LayerCompositionState leftLayerState; - leftLayerState.frontEnd.geomVisibleRegion = Region{Rect{0, 0, 1000, 1000}}; leftLayerState.frontEnd.isOpaque = true; impl::OutputLayerCompositionState rightOutputLayerState; rightOutputLayerState.clearClientTarget = true; + rightOutputLayerState.visibleRegion = Region{Rect{1000, 0, 2000, 1000}}; impl::LayerCompositionState rightLayerState; - rightLayerState.frontEnd.geomVisibleRegion = Region{Rect{1000, 0, 2000, 1000}}; rightLayerState.frontEnd.isOpaque = true; const half3 rightLayerColor{0.f, 1.f, 0.f}; diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index c916f74291..5e5302d83c 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -461,10 +461,6 @@ void Layer::latchPerFrameState(compositionengine::LayerFECompositionState& compo const auto& drawingState{getDrawingState()}; compositionState.forceClientComposition = false; - // TODO(lpique): b/121291683 Remove this one we are sure we don't need the - // value recomputed / set every frame. - compositionState.geomVisibleRegion = visibleRegion; - compositionState.isColorspaceAgnostic = isColorSpaceAgnostic(); compositionState.dataspace = mCurrentDataSpace; compositionState.colorTransform = getColorTransform(); @@ -585,27 +581,6 @@ bool Layer::isSecure() const { return (s.flags & layer_state_t::eLayerSecure); } -void Layer::setVisibleRegion(const Region& visibleRegion) { - // always called from main thread - this->visibleRegion = visibleRegion; -} - -void Layer::setCoveredRegion(const Region& coveredRegion) { - // always called from main thread - this->coveredRegion = coveredRegion; -} - -void Layer::setVisibleNonTransparentRegion(const Region& setVisibleNonTransparentRegion) { - // always called from main thread - this->visibleNonTransparentRegion = setVisibleNonTransparentRegion; -} - -void Layer::clearVisibilityRegions() { - visibleRegion.clear(); - visibleNonTransparentRegion.clear(); - coveredRegion.clear(); -} - // ---------------------------------------------------------------------------- // transaction // ---------------------------------------------------------------------------- @@ -1220,7 +1195,8 @@ LayerDebugInfo Layer::getLayerDebugInfo() const { info.mParentName = (parent == nullptr ? std::string("none") : parent->getName().string()); info.mType = getType(); info.mTransparentRegion = ds.activeTransparentRegion_legacy; - info.mVisibleRegion = visibleRegion; + + info.mVisibleRegion = debugGetVisibleRegionOnDefaultDisplay(); info.mSurfaceDamageRegion = surfaceDamageRegion; info.mLayerStack = getLayerStack(); info.mX = ds.active_legacy.transform.tx(); @@ -1851,7 +1827,7 @@ void Layer::writeToProtoDrawingState(LayerProto* layerInfo, uint32_t traceFlags) LayerProtoHelper::writePositionToProto(transform.tx(), transform.ty(), [&]() { return layerInfo->mutable_position(); }); LayerProtoHelper::writeToProto(mBounds, [&]() { return layerInfo->mutable_bounds(); }); - LayerProtoHelper::writeToProto(visibleRegion, + LayerProtoHelper::writeToProto(debugGetVisibleRegionOnDefaultDisplay(), [&]() { return layerInfo->mutable_visible_region(); }); LayerProtoHelper::writeToProto(surfaceDamageRegion, [&]() { return layerInfo->mutable_damage_region(); }); @@ -2028,6 +2004,20 @@ compositionengine::OutputLayer* Layer::findOutputLayerForDisplay( return display->getCompositionDisplay()->getOutputLayerForLayer(getCompositionLayer().get()); } +Region Layer::debugGetVisibleRegionOnDefaultDisplay() const { + sp<DisplayDevice> displayDevice = mFlinger->getDefaultDisplayDeviceLocked(); + if (displayDevice == nullptr) { + return {}; + } + + auto outputLayer = findOutputLayerForDisplay(displayDevice); + if (outputLayer == nullptr) { + return {}; + } + + return outputLayer->getState().visibleRegion; +} + // --------------------------------------------------------------------------- }; // namespace android diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h index 23c1acd759..1486efe8ae 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -98,10 +98,6 @@ class Layer : public compositionengine::LayerFE { public: mutable bool contentDirty{false}; - // regions below are in window-manager space - Region visibleRegion; - Region coveredRegion; - Region visibleNonTransparentRegion; Region surfaceDamageRegion; // Layer serial number. This gives layers an explicit ordering, so we @@ -519,30 +515,6 @@ public: uint32_t doTransaction(uint32_t transactionFlags); /* - * setVisibleRegion - called to set the new visible region. This gives - * a chance to update the new visible region or record the fact it changed. - */ - void setVisibleRegion(const Region& visibleRegion); - - /* - * setCoveredRegion - called when the covered region changes. The covered - * region corresponds to any area of the surface that is covered - * (transparently or not) by another surface. - */ - void setCoveredRegion(const Region& coveredRegion); - - /* - * setVisibleNonTransparentRegion - called when the visible and - * non-transparent region changes. - */ - void setVisibleNonTransparentRegion(const Region& visibleNonTransparentRegion); - - /* - * Clear the visible, covered, and non-transparent regions. - */ - void clearVisibilityRegions(); - - /* * latchBuffer - called each time the screen is redrawn and returns whether * the visible regions need to be recomputed (this is a fairly heavy * operation, so this should be set only if needed). Typically this is used @@ -685,6 +657,8 @@ public: compositionengine::OutputLayer* findOutputLayerForDisplay( const sp<const DisplayDevice>& display) const; + Region debugGetVisibleRegionOnDefaultDisplay() const; + protected: // constant sp<SurfaceFlinger> mFlinger; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 914a79dc32..3498419cdf 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2794,7 +2794,6 @@ void SurfaceFlinger::computeVisibleRegions( */ Region transparentRegion; - // handle hidden surfaces by setting the visible region to empty if (CC_LIKELY(layer->isVisible())) { const bool translucent = !layer->isOpaque(s); @@ -2827,7 +2826,6 @@ void SurfaceFlinger::computeVisibleRegions( } if (visibleRegion.isEmpty()) { - layer->clearVisibilityRegions(); return; } @@ -2840,12 +2838,21 @@ void SurfaceFlinger::computeVisibleRegions( // subtract the opaque region covered by the layers above us visibleRegion.subtractSelf(aboveOpaqueLayers); + // Get coverage information for the layer as previously displayed + auto prevOutputLayer = display->getOutputLayerForLayer(compositionLayer.get()); + // TODO(b/121291683): Define this as a constant in Region.h + const Region kEmptyRegion; + const Region& oldVisibleRegion = + prevOutputLayer ? prevOutputLayer->getState().visibleRegion : kEmptyRegion; + const Region& oldCoveredRegion = + prevOutputLayer ? prevOutputLayer->getState().coveredRegion : kEmptyRegion; + // compute this layer's dirty region if (layer->contentDirty) { // we need to invalidate the whole region dirty = visibleRegion; // as well, as the old visible region - dirty.orSelf(layer->visibleRegion); + dirty.orSelf(oldVisibleRegion); layer->contentDirty = false; } else { /* compute the exposed region: @@ -2861,8 +2868,6 @@ void SurfaceFlinger::computeVisibleRegions( * exposed because of a resize. */ const Region newExposed = visibleRegion - coveredRegion; - const Region oldVisibleRegion = layer->visibleRegion; - const Region oldCoveredRegion = layer->coveredRegion; const Region oldExposed = oldVisibleRegion - oldCoveredRegion; dirty = (visibleRegion&oldCoveredRegion) | (newExposed-oldExposed); } @@ -2874,16 +2879,13 @@ void SurfaceFlinger::computeVisibleRegions( // Update aboveOpaqueLayers for next (lower) layer aboveOpaqueLayers.orSelf(opaqueRegion); - // Store the visible region in screen space - layer->setVisibleRegion(visibleRegion); - layer->setCoveredRegion(coveredRegion); - layer->setVisibleNonTransparentRegion( - visibleRegion.subtract(transparentRegion)); + // Compute the visible non-transparent region + Region visibleNonTransparentRegion = visibleRegion.subtract(transparentRegion); - // Setup an output layer for this output if the layer is - // visible on this output + // Setup an output layer for this output if the layer is visible on this + // output const auto& displayState = display->getState(); - Region drawRegion(displayState.transform.transform(layer->visibleNonTransparentRegion)); + Region drawRegion(displayState.transform.transform(visibleNonTransparentRegion)); drawRegion.andSelf(displayState.bounds); if (drawRegion.isEmpty()) { return; @@ -2896,8 +2898,11 @@ void SurfaceFlinger::computeVisibleRegions( outLayersSortedByZ.emplace_back( display->getOrCreateOutputLayer(displayId, compositionLayer, layerFE)); auto& outputLayerState = outLayersSortedByZ.back()->editState(); - outputLayerState.visibleRegion = displayState.transform.transform( - layer->visibleRegion.intersect(displayState.viewport)); + outputLayerState.visibleRegion = std::move(visibleRegion); + outputLayerState.visibleNonTransparentRegion = std::move(visibleNonTransparentRegion); + outputLayerState.coveredRegion = std::move(coveredRegion); + outputLayerState.outputSpaceVisibleRegion = displayState.transform.transform( + outputLayerState.visibleRegion.intersect(displayState.viewport)); }); outOpaqueRegion = aboveOpaqueLayers; diff --git a/services/surfaceflinger/tests/unittests/CompositionTest.cpp b/services/surfaceflinger/tests/unittests/CompositionTest.cpp index 425768e244..9e4d57e7dc 100644 --- a/services/surfaceflinger/tests/unittests/CompositionTest.cpp +++ b/services/surfaceflinger/tests/unittests/CompositionTest.cpp @@ -614,6 +614,12 @@ struct BaseLayerProperties { displaySettings.clip); // screen capture adds an additional color layer as an alpha // prefill, so gtet the back layer. + if (layerSettings.empty()) { + ADD_FAILURE() << "layerSettings was not expected to be empty in " + "setupREBufferCompositionCommonCallExpectations " + "verification lambda"; + return NO_ERROR; + } renderengine::LayerSettings layer = layerSettings.back(); EXPECT_THAT(layer.source.buffer.buffer, Not(IsNull())); EXPECT_THAT(layer.source.buffer.fence, Not(IsNull())); @@ -657,6 +663,12 @@ struct BaseLayerProperties { displaySettings.clip); // screen capture adds an additional color layer as an alpha // prefill, so get the back layer. + if (layerSettings.empty()) { + ADD_FAILURE() + << "layerSettings was not expected to be empty in " + "setupREColorCompositionCallExpectations verification lambda"; + return NO_ERROR; + } renderengine::LayerSettings layer = layerSettings.back(); EXPECT_THAT(layer.source.buffer.buffer, IsNull()); EXPECT_EQ(half3(LayerProperties::COLOR[0], LayerProperties::COLOR[1], @@ -727,6 +739,12 @@ struct SecureLayerProperties : public BaseLayerProperties<SecureLayerProperties> displaySettings.clip); // screen capture adds an additional color layer as an alpha // prefill, so get the back layer. + if (layerSettings.empty()) { + ADD_FAILURE() << "layerSettings was not expected to be empty in " + "setupInsecureREBufferCompositionCommonCallExpectations " + "verification lambda"; + return NO_ERROR; + } renderengine::LayerSettings layer = layerSettings.back(); EXPECT_THAT(layer.source.buffer.buffer, IsNull()); EXPECT_EQ(half3(0.0f, 0.0f, 0.0f), layer.source.solidColor); @@ -786,7 +804,6 @@ struct BaseLayerVariant { layerDrawingState.color = half4(LayerProperties::COLOR[0], LayerProperties::COLOR[1], LayerProperties::COLOR[2], LayerProperties::COLOR[3]); layer->computeBounds(FloatRect(0, 0, 100, 100), ui::Transform()); - layer->setVisibleRegion(Region(Rect(0, 0, 100, 100))); return layer; } @@ -801,6 +818,9 @@ struct BaseLayerVariant { layer->getCompositionLayer(), layer)); + outputLayers.back()->editState().visibleRegion = Region(Rect(0, 0, 100, 100)); + outputLayers.back()->editState().outputSpaceVisibleRegion = Region(Rect(0, 0, 100, 100)); + test->mDisplay->getCompositionDisplay()->setOutputLayersOrderedByZ(std::move(outputLayers)); Mock::VerifyAndClear(test->mComposer); |