[Mirror Layers] Added clone function to layers (1/4)
Added a cloning function to each layer in preparation for mirroring
Test: Nothing to test yet since no calls
Bug: 131622422
Change-Id: Iba0692b75c4d99841de48f40ed55b3dbccf2b9b9
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index ba948cf..52a09b3 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -2015,6 +2015,15 @@
return outputLayer->getState().visibleRegion;
}
+void Layer::setInitialValuesForClone(const sp<Layer>& clonedFrom) {
+ // copy drawing state from cloned layer
+ mDrawingState = clonedFrom->mDrawingState;
+ mClonedFrom = clonedFrom;
+
+ // TODO: (b/140756730) Ignore input for now since InputDispatcher doesn't support multiple
+ // InputWindows per client token yet.
+ mDrawingState.inputInfo.token = nullptr;
+}
// ---------------------------------------------------------------------------
}; // namespace android