Loading services/surfaceflinger/Layer.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -2552,7 +2552,10 @@ Region Layer::getVisibleRegion(const DisplayDevice* display) const { return outputLayer ? outputLayer->getState().visibleRegion : Region(); } void Layer::setInitialValuesForClone(const sp<Layer>& clonedFrom) { void Layer::setInitialValuesForClone(const sp<Layer>& clonedFrom, uint32_t mirrorRootId) { mSnapshot->path.id = clonedFrom->getSequence(); mSnapshot->path.mirrorRootId = mirrorRootId; cloneDrawingState(clonedFrom.get()); mClonedFrom = clonedFrom; mPremultipliedAlpha = clonedFrom->mPremultipliedAlpha; Loading Loading @@ -2653,7 +2656,7 @@ void Layer::updateClonedChildren(const sp<Layer>& mirrorRoot, } sp<Layer> clonedChild = clonedLayersMap[child]; if (clonedChild == nullptr) { clonedChild = child->createClone(); clonedChild = child->createClone(mirrorRoot->getSequence()); clonedLayersMap[child] = clonedChild; } addChildToDrawing(clonedChild); Loading Loading @@ -3491,11 +3494,11 @@ Rect Layer::computeBufferCrop(const State& s) { } } sp<Layer> Layer::createClone() { sp<Layer> Layer::createClone(uint32_t mirrorRootId) { LayerCreationArgs args(mFlinger.get(), nullptr, mName + " (Mirror)", 0, LayerMetadata()); args.textureName = mTextureName; sp<Layer> layer = mFlinger->getFactory().createBufferStateLayer(args); layer->setInitialValuesForClone(sp<Layer>::fromExisting(this)); layer->setInitialValuesForClone(sp<Layer>::fromExisting(this), mirrorRootId); return layer; } Loading services/surfaceflinger/Layer.h +2 −2 Original line number Diff line number Diff line Loading @@ -248,7 +248,7 @@ public: // true if this layer is visible, false otherwise virtual bool isVisible() const; virtual sp<Layer> createClone(); virtual sp<Layer> createClone(uint32_t mirrorRoot); // Set a 2x2 transformation matrix on the layer. This transform // will be applied after parent transforms, but before any final Loading Loading @@ -922,7 +922,7 @@ protected: friend class TransactionFrameTracerTest; friend class TransactionSurfaceFrameTest; virtual void setInitialValuesForClone(const sp<Layer>& clonedFrom); virtual void setInitialValuesForClone(const sp<Layer>& clonedFrom, uint32_t mirrorRootId); void preparePerFrameCompositionState(); void preparePerFrameBufferCompositionState(); void preparePerFrameEffectsCompositionState(); Loading services/surfaceflinger/SurfaceFlinger.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -5254,7 +5254,7 @@ status_t SurfaceFlinger::mirrorLayer(const LayerCreationArgs& args, return result; } mirrorLayer->setClonedChild(mirrorFrom->createClone()); mirrorLayer->setClonedChild(mirrorFrom->createClone(mirrorLayer->getSequence())); } outResult.layerId = mirrorLayer->sequence; Loading Loading @@ -8033,7 +8033,7 @@ bool SurfaceFlinger::commitMirrorDisplays(VsyncId vsyncId) { Mutex::Autolock lock(mStateLock); createEffectLayer(mirrorArgs, &unused, &childMirror); MUTEX_ALIAS(mStateLock, childMirror->mFlinger->mStateLock); childMirror->setClonedChild(layer->createClone()); childMirror->setClonedChild(layer->createClone(childMirror->getSequence())); childMirror->reparent(mirrorDisplay.rootHandle); } // lock on mStateLock needs to be released before binder handle gets destroyed Loading services/surfaceflinger/fuzzer/surfaceflinger_scheduler_fuzzer.h +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ public: bool isVisible() const override { return true; } sp<Layer> createClone() override { return nullptr; } sp<Layer> createClone(uint32_t /* mirrorRootId */) override { return nullptr; } }; class FuzzImplVSyncTracker : public scheduler::VSyncTracker { Loading services/surfaceflinger/tests/unittests/mock/MockLayer.h +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ public: MOCK_CONST_METHOD0(getType, const char*()); MOCK_METHOD0(getFrameSelectionPriority, int32_t()); MOCK_CONST_METHOD0(isVisible, bool()); MOCK_METHOD0(createClone, sp<Layer>()); MOCK_METHOD1(createClone, sp<Layer>(uint32_t)); MOCK_CONST_METHOD0(getFrameRateForLayerTree, FrameRate()); MOCK_CONST_METHOD0(getDefaultFrameRateCompatibility, scheduler::LayerInfo::FrameRateCompatibility()); Loading Loading
services/surfaceflinger/Layer.cpp +7 −4 Original line number Diff line number Diff line Loading @@ -2552,7 +2552,10 @@ Region Layer::getVisibleRegion(const DisplayDevice* display) const { return outputLayer ? outputLayer->getState().visibleRegion : Region(); } void Layer::setInitialValuesForClone(const sp<Layer>& clonedFrom) { void Layer::setInitialValuesForClone(const sp<Layer>& clonedFrom, uint32_t mirrorRootId) { mSnapshot->path.id = clonedFrom->getSequence(); mSnapshot->path.mirrorRootId = mirrorRootId; cloneDrawingState(clonedFrom.get()); mClonedFrom = clonedFrom; mPremultipliedAlpha = clonedFrom->mPremultipliedAlpha; Loading Loading @@ -2653,7 +2656,7 @@ void Layer::updateClonedChildren(const sp<Layer>& mirrorRoot, } sp<Layer> clonedChild = clonedLayersMap[child]; if (clonedChild == nullptr) { clonedChild = child->createClone(); clonedChild = child->createClone(mirrorRoot->getSequence()); clonedLayersMap[child] = clonedChild; } addChildToDrawing(clonedChild); Loading Loading @@ -3491,11 +3494,11 @@ Rect Layer::computeBufferCrop(const State& s) { } } sp<Layer> Layer::createClone() { sp<Layer> Layer::createClone(uint32_t mirrorRootId) { LayerCreationArgs args(mFlinger.get(), nullptr, mName + " (Mirror)", 0, LayerMetadata()); args.textureName = mTextureName; sp<Layer> layer = mFlinger->getFactory().createBufferStateLayer(args); layer->setInitialValuesForClone(sp<Layer>::fromExisting(this)); layer->setInitialValuesForClone(sp<Layer>::fromExisting(this), mirrorRootId); return layer; } Loading
services/surfaceflinger/Layer.h +2 −2 Original line number Diff line number Diff line Loading @@ -248,7 +248,7 @@ public: // true if this layer is visible, false otherwise virtual bool isVisible() const; virtual sp<Layer> createClone(); virtual sp<Layer> createClone(uint32_t mirrorRoot); // Set a 2x2 transformation matrix on the layer. This transform // will be applied after parent transforms, but before any final Loading Loading @@ -922,7 +922,7 @@ protected: friend class TransactionFrameTracerTest; friend class TransactionSurfaceFrameTest; virtual void setInitialValuesForClone(const sp<Layer>& clonedFrom); virtual void setInitialValuesForClone(const sp<Layer>& clonedFrom, uint32_t mirrorRootId); void preparePerFrameCompositionState(); void preparePerFrameBufferCompositionState(); void preparePerFrameEffectsCompositionState(); Loading
services/surfaceflinger/SurfaceFlinger.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -5254,7 +5254,7 @@ status_t SurfaceFlinger::mirrorLayer(const LayerCreationArgs& args, return result; } mirrorLayer->setClonedChild(mirrorFrom->createClone()); mirrorLayer->setClonedChild(mirrorFrom->createClone(mirrorLayer->getSequence())); } outResult.layerId = mirrorLayer->sequence; Loading Loading @@ -8033,7 +8033,7 @@ bool SurfaceFlinger::commitMirrorDisplays(VsyncId vsyncId) { Mutex::Autolock lock(mStateLock); createEffectLayer(mirrorArgs, &unused, &childMirror); MUTEX_ALIAS(mStateLock, childMirror->mFlinger->mStateLock); childMirror->setClonedChild(layer->createClone()); childMirror->setClonedChild(layer->createClone(childMirror->getSequence())); childMirror->reparent(mirrorDisplay.rootHandle); } // lock on mStateLock needs to be released before binder handle gets destroyed Loading
services/surfaceflinger/fuzzer/surfaceflinger_scheduler_fuzzer.h +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ public: bool isVisible() const override { return true; } sp<Layer> createClone() override { return nullptr; } sp<Layer> createClone(uint32_t /* mirrorRootId */) override { return nullptr; } }; class FuzzImplVSyncTracker : public scheduler::VSyncTracker { Loading
services/surfaceflinger/tests/unittests/mock/MockLayer.h +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ public: MOCK_CONST_METHOD0(getType, const char*()); MOCK_METHOD0(getFrameSelectionPriority, int32_t()); MOCK_CONST_METHOD0(isVisible, bool()); MOCK_METHOD0(createClone, sp<Layer>()); MOCK_METHOD1(createClone, sp<Layer>(uint32_t)); MOCK_CONST_METHOD0(getFrameRateForLayerTree, FrameRate()); MOCK_CONST_METHOD0(getDefaultFrameRateCompatibility, scheduler::LayerInfo::FrameRateCompatibility()); Loading