Loading services/surfaceflinger/Client.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,8 @@ status_t Client::createWithSurfaceParent(const String8& /* name */, uint32_t /* status_t Client::mirrorSurface(const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, int32_t* outLayerId) { return mFlinger->mirrorLayer(this, mirrorFromHandle, outHandle, outLayerId); LayerCreationArgs args(mFlinger.get(), this, "MirrorRoot", 0 /* flags */, LayerMetadata()); return mFlinger->mirrorLayer(args, mirrorFromHandle, outHandle, outLayerId); } status_t Client::clearLayerFrameStats(const sp<IBinder>& handle) const { Loading services/surfaceflinger/SurfaceFlinger.cpp +17 −9 Original line number Diff line number Diff line Loading @@ -4344,8 +4344,9 @@ uint32_t SurfaceFlinger::addInputWindowCommands(const InputWindowCommands& input return hasChanges ? eTraversalNeeded : 0; } status_t SurfaceFlinger::mirrorLayer(const sp<Client>& client, const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, int32_t* outLayerId) { status_t SurfaceFlinger::mirrorLayer(const LayerCreationArgs& args, const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, int32_t* outLayerId) { if (!mirrorFromHandle) { return NAME_NOT_FOUND; } Loading @@ -4358,7 +4359,6 @@ status_t SurfaceFlinger::mirrorLayer(const sp<Client>& client, const sp<IBinder> if (!mirrorFrom) { return NAME_NOT_FOUND; } LayerCreationArgs args(this, client, "MirrorRoot", 0, LayerMetadata()); status_t result = createContainerLayer(args, outHandle, &mirrorLayer); if (result != NO_ERROR) { return result; Loading @@ -4368,7 +4368,11 @@ status_t SurfaceFlinger::mirrorLayer(const sp<Client>& client, const sp<IBinder> } *outLayerId = mirrorLayer->sequence; return addClientLayer(client, *outHandle, mirrorLayer /* layer */, nullptr /* parent */, if (mTransactionTracingEnabled) { mTransactionTracing.onMirrorLayerAdded((*outHandle)->localBinder(), mirrorLayer->sequence, args.name, mirrorFrom->sequence); } return addClientLayer(args.client, *outHandle, mirrorLayer /* layer */, nullptr /* parent */, false /* addAsRoot */, nullptr /* outTransformHint */); } Loading Loading @@ -4430,8 +4434,10 @@ status_t SurfaceFlinger::createLayer(LayerCreationArgs& args, sp<IBinder>* outHa if (parentSp != nullptr) { parentId = parentSp->getSequence(); } if (mTransactionTracingEnabled) { mTransactionTracing.onLayerAdded((*outHandle)->localBinder(), layer->sequence, args.name, args.flags, parentId); } setTransactionFlags(eTransactionNeeded); *outLayerId = layer->sequence; Loading Loading @@ -4482,14 +4488,14 @@ status_t SurfaceFlinger::createBufferStateLayer(LayerCreationArgs& args, sp<IBin return NO_ERROR; } status_t SurfaceFlinger::createEffectLayer(LayerCreationArgs& args, sp<IBinder>* handle, status_t SurfaceFlinger::createEffectLayer(const LayerCreationArgs& args, sp<IBinder>* handle, sp<Layer>* outLayer) { *outLayer = getFactory().createEffectLayer(args); *handle = (*outLayer)->getHandle(); return NO_ERROR; } status_t SurfaceFlinger::createContainerLayer(LayerCreationArgs& args, sp<IBinder>* handle, status_t SurfaceFlinger::createContainerLayer(const LayerCreationArgs& args, sp<IBinder>* handle, sp<Layer>* outLayer) { *outLayer = getFactory().createContainerLayer(args); *handle = (*outLayer)->getHandle(); Loading Loading @@ -6669,8 +6675,10 @@ void SurfaceFlinger::onLayerDestroyed(Layer* layer) { if (!layer->isRemovedFromCurrentState()) { mScheduler->deregisterLayer(layer); } if (mTransactionTracingEnabled) { mTransactionTracing.onLayerRemoved(layer->getSequence()); } } void SurfaceFlinger::onLayerUpdate() { scheduleCommit(FrameHint::kActive); Loading services/surfaceflinger/SurfaceFlinger.h +3 −3 Original line number Diff line number Diff line Loading @@ -770,13 +770,13 @@ private: status_t createBufferStateLayer(LayerCreationArgs& args, sp<IBinder>* outHandle, sp<Layer>* outLayer); status_t createEffectLayer(LayerCreationArgs& args, sp<IBinder>* outHandle, status_t createEffectLayer(const LayerCreationArgs& args, sp<IBinder>* outHandle, sp<Layer>* outLayer); status_t createContainerLayer(LayerCreationArgs& args, sp<IBinder>* outHandle, status_t createContainerLayer(const LayerCreationArgs& args, sp<IBinder>* outHandle, sp<Layer>* outLayer); status_t mirrorLayer(const sp<Client>& client, const sp<IBinder>& mirrorFromHandle, status_t mirrorLayer(const LayerCreationArgs& args, const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, int32_t* outLayerId); // called when all clients have released all their references to Loading services/surfaceflinger/Tracing/TransactionProtoParser.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -278,6 +278,7 @@ proto::LayerCreationArgs TransactionProtoParser::toProto(const TracingLayerCreat proto.set_name(args.name); proto.set_flags(args.flags); proto.set_parent_id(args.parentId); proto.set_mirror_from_id(args.mirrorFromId); return proto; } Loading Loading @@ -312,6 +313,7 @@ void TransactionProtoParser::fromProto(const proto::LayerCreationArgs& proto, outArgs.name = proto.name(); outArgs.flags = proto.flags(); outArgs.parentId = proto.parent_id(); outArgs.mirrorFromId = proto.mirror_from_id(); } void TransactionProtoParser::fromProto(const proto::LayerState& proto, Loading @@ -320,6 +322,7 @@ void TransactionProtoParser::fromProto(const proto::LayerState& proto, fromProto(proto, getLayerHandle, static_cast<layer_state_t&>(outState)); if (proto.what() & layer_state_t::eReparent) { outState.parentId = proto.parent_id(); outState.args.parentId = outState.parentId; } if (proto.what() & layer_state_t::eRelativeLayerChanged) { outState.relativeParentId = proto.relative_parent_id(); Loading Loading @@ -508,7 +511,9 @@ DisplayState TransactionProtoParser::fromProto(const proto::DisplayState& proto, DisplayIdToHandleFn getDisplayHandle) { DisplayState display; display.what = proto.what(); if (getDisplayHandle != nullptr) { display.token = getDisplayHandle(proto.id()); } if (display.what & DisplayState::eLayerStackChanged) { display.layerStack.id = proto.layer_stack(); Loading services/surfaceflinger/Tracing/TransactionProtoParser.h +4 −4 Original line number Diff line number Diff line Loading @@ -25,8 +25,9 @@ namespace android::surfaceflinger { struct TracingLayerCreationArgs { int32_t layerId; std::string name; uint32_t flags; int32_t parentId; uint32_t flags = 0; int32_t parentId = -1; int32_t mirrorFromId = -1; }; struct TracingLayerState : layer_state_t { Loading @@ -37,8 +38,7 @@ struct TracingLayerState : layer_state_t { int32_t parentId; int32_t relativeParentId; int32_t inputCropId; std::string name; uint32_t layerCreationFlags; TracingLayerCreationArgs args; }; class TransactionProtoParser { Loading Loading
services/surfaceflinger/Client.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,8 @@ status_t Client::createWithSurfaceParent(const String8& /* name */, uint32_t /* status_t Client::mirrorSurface(const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, int32_t* outLayerId) { return mFlinger->mirrorLayer(this, mirrorFromHandle, outHandle, outLayerId); LayerCreationArgs args(mFlinger.get(), this, "MirrorRoot", 0 /* flags */, LayerMetadata()); return mFlinger->mirrorLayer(args, mirrorFromHandle, outHandle, outLayerId); } status_t Client::clearLayerFrameStats(const sp<IBinder>& handle) const { Loading
services/surfaceflinger/SurfaceFlinger.cpp +17 −9 Original line number Diff line number Diff line Loading @@ -4344,8 +4344,9 @@ uint32_t SurfaceFlinger::addInputWindowCommands(const InputWindowCommands& input return hasChanges ? eTraversalNeeded : 0; } status_t SurfaceFlinger::mirrorLayer(const sp<Client>& client, const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, int32_t* outLayerId) { status_t SurfaceFlinger::mirrorLayer(const LayerCreationArgs& args, const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, int32_t* outLayerId) { if (!mirrorFromHandle) { return NAME_NOT_FOUND; } Loading @@ -4358,7 +4359,6 @@ status_t SurfaceFlinger::mirrorLayer(const sp<Client>& client, const sp<IBinder> if (!mirrorFrom) { return NAME_NOT_FOUND; } LayerCreationArgs args(this, client, "MirrorRoot", 0, LayerMetadata()); status_t result = createContainerLayer(args, outHandle, &mirrorLayer); if (result != NO_ERROR) { return result; Loading @@ -4368,7 +4368,11 @@ status_t SurfaceFlinger::mirrorLayer(const sp<Client>& client, const sp<IBinder> } *outLayerId = mirrorLayer->sequence; return addClientLayer(client, *outHandle, mirrorLayer /* layer */, nullptr /* parent */, if (mTransactionTracingEnabled) { mTransactionTracing.onMirrorLayerAdded((*outHandle)->localBinder(), mirrorLayer->sequence, args.name, mirrorFrom->sequence); } return addClientLayer(args.client, *outHandle, mirrorLayer /* layer */, nullptr /* parent */, false /* addAsRoot */, nullptr /* outTransformHint */); } Loading Loading @@ -4430,8 +4434,10 @@ status_t SurfaceFlinger::createLayer(LayerCreationArgs& args, sp<IBinder>* outHa if (parentSp != nullptr) { parentId = parentSp->getSequence(); } if (mTransactionTracingEnabled) { mTransactionTracing.onLayerAdded((*outHandle)->localBinder(), layer->sequence, args.name, args.flags, parentId); } setTransactionFlags(eTransactionNeeded); *outLayerId = layer->sequence; Loading Loading @@ -4482,14 +4488,14 @@ status_t SurfaceFlinger::createBufferStateLayer(LayerCreationArgs& args, sp<IBin return NO_ERROR; } status_t SurfaceFlinger::createEffectLayer(LayerCreationArgs& args, sp<IBinder>* handle, status_t SurfaceFlinger::createEffectLayer(const LayerCreationArgs& args, sp<IBinder>* handle, sp<Layer>* outLayer) { *outLayer = getFactory().createEffectLayer(args); *handle = (*outLayer)->getHandle(); return NO_ERROR; } status_t SurfaceFlinger::createContainerLayer(LayerCreationArgs& args, sp<IBinder>* handle, status_t SurfaceFlinger::createContainerLayer(const LayerCreationArgs& args, sp<IBinder>* handle, sp<Layer>* outLayer) { *outLayer = getFactory().createContainerLayer(args); *handle = (*outLayer)->getHandle(); Loading Loading @@ -6669,8 +6675,10 @@ void SurfaceFlinger::onLayerDestroyed(Layer* layer) { if (!layer->isRemovedFromCurrentState()) { mScheduler->deregisterLayer(layer); } if (mTransactionTracingEnabled) { mTransactionTracing.onLayerRemoved(layer->getSequence()); } } void SurfaceFlinger::onLayerUpdate() { scheduleCommit(FrameHint::kActive); Loading
services/surfaceflinger/SurfaceFlinger.h +3 −3 Original line number Diff line number Diff line Loading @@ -770,13 +770,13 @@ private: status_t createBufferStateLayer(LayerCreationArgs& args, sp<IBinder>* outHandle, sp<Layer>* outLayer); status_t createEffectLayer(LayerCreationArgs& args, sp<IBinder>* outHandle, status_t createEffectLayer(const LayerCreationArgs& args, sp<IBinder>* outHandle, sp<Layer>* outLayer); status_t createContainerLayer(LayerCreationArgs& args, sp<IBinder>* outHandle, status_t createContainerLayer(const LayerCreationArgs& args, sp<IBinder>* outHandle, sp<Layer>* outLayer); status_t mirrorLayer(const sp<Client>& client, const sp<IBinder>& mirrorFromHandle, status_t mirrorLayer(const LayerCreationArgs& args, const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, int32_t* outLayerId); // called when all clients have released all their references to Loading
services/surfaceflinger/Tracing/TransactionProtoParser.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -278,6 +278,7 @@ proto::LayerCreationArgs TransactionProtoParser::toProto(const TracingLayerCreat proto.set_name(args.name); proto.set_flags(args.flags); proto.set_parent_id(args.parentId); proto.set_mirror_from_id(args.mirrorFromId); return proto; } Loading Loading @@ -312,6 +313,7 @@ void TransactionProtoParser::fromProto(const proto::LayerCreationArgs& proto, outArgs.name = proto.name(); outArgs.flags = proto.flags(); outArgs.parentId = proto.parent_id(); outArgs.mirrorFromId = proto.mirror_from_id(); } void TransactionProtoParser::fromProto(const proto::LayerState& proto, Loading @@ -320,6 +322,7 @@ void TransactionProtoParser::fromProto(const proto::LayerState& proto, fromProto(proto, getLayerHandle, static_cast<layer_state_t&>(outState)); if (proto.what() & layer_state_t::eReparent) { outState.parentId = proto.parent_id(); outState.args.parentId = outState.parentId; } if (proto.what() & layer_state_t::eRelativeLayerChanged) { outState.relativeParentId = proto.relative_parent_id(); Loading Loading @@ -508,7 +511,9 @@ DisplayState TransactionProtoParser::fromProto(const proto::DisplayState& proto, DisplayIdToHandleFn getDisplayHandle) { DisplayState display; display.what = proto.what(); if (getDisplayHandle != nullptr) { display.token = getDisplayHandle(proto.id()); } if (display.what & DisplayState::eLayerStackChanged) { display.layerStack.id = proto.layer_stack(); Loading
services/surfaceflinger/Tracing/TransactionProtoParser.h +4 −4 Original line number Diff line number Diff line Loading @@ -25,8 +25,9 @@ namespace android::surfaceflinger { struct TracingLayerCreationArgs { int32_t layerId; std::string name; uint32_t flags; int32_t parentId; uint32_t flags = 0; int32_t parentId = -1; int32_t mirrorFromId = -1; }; struct TracingLayerState : layer_state_t { Loading @@ -37,8 +38,7 @@ struct TracingLayerState : layer_state_t { int32_t parentId; int32_t relativeParentId; int32_t inputCropId; std::string name; uint32_t layerCreationFlags; TracingLayerCreationArgs args; }; class TransactionProtoParser { Loading