From 82e9cb1b4e53d2600c6ff7fe539ccd73ac6b1590 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Thu, 21 Jan 2021 23:44:45 -0800 Subject: [PATCH] Add SurfaceId to ShadowView Summary: See title. Not used in this diff; see next diff in stack. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D26001014 fbshipit-source-id: 475eb265f1c27bd9aff978a49652764a50287e47 --- ReactCommon/react/renderer/mounting/ShadowView.cpp | 4 ++++ ReactCommon/react/renderer/mounting/ShadowView.h | 1 + ReactCommon/react/renderer/mounting/StubView.cpp | 3 +++ ReactCommon/react/renderer/mounting/StubView.h | 1 + 4 files changed, 9 insertions(+) diff --git a/ReactCommon/react/renderer/mounting/ShadowView.cpp b/ReactCommon/react/renderer/mounting/ShadowView.cpp index f717a28fe66..32b84c8b26c 100644 --- a/ReactCommon/react/renderer/mounting/ShadowView.cpp +++ b/ReactCommon/react/renderer/mounting/ShadowView.cpp @@ -22,6 +22,7 @@ static LayoutMetrics layoutMetricsFromShadowNode(ShadowNode const &shadowNode) { ShadowView::ShadowView(const ShadowNode &shadowNode) : componentName(shadowNode.getComponentName()), componentHandle(shadowNode.getComponentHandle()), + surfaceId(shadowNode.getSurfaceId()), tag(shadowNode.getTag()), props(shadowNode.getProps()), eventEmitter(shadowNode.getEventEmitter()), @@ -30,6 +31,7 @@ ShadowView::ShadowView(const ShadowNode &shadowNode) bool ShadowView::operator==(const ShadowView &rhs) const { return std::tie( + this->surfaceId, this->tag, this->componentName, this->props, @@ -37,6 +39,7 @@ bool ShadowView::operator==(const ShadowView &rhs) const { this->layoutMetrics, this->state) == std::tie( + rhs.surfaceId, rhs.tag, rhs.componentName, rhs.props, @@ -59,6 +62,7 @@ std::vector getDebugProps( ShadowView const &object, DebugStringConvertibleOptions options) { return { + {"surfaceId", getDebugDescription(object.surfaceId, options)}, {"tag", getDebugDescription(object.tag, options)}, {"props", getDebugDescription(object.props, options)}, {"eventEmitter", getDebugDescription(object.eventEmitter, options)}, diff --git a/ReactCommon/react/renderer/mounting/ShadowView.h b/ReactCommon/react/renderer/mounting/ShadowView.h index 3e65e0262c5..7d0a7617a68 100644 --- a/ReactCommon/react/renderer/mounting/ShadowView.h +++ b/ReactCommon/react/renderer/mounting/ShadowView.h @@ -40,6 +40,7 @@ struct ShadowView final { ComponentName componentName{}; ComponentHandle componentHandle{}; + SurfaceId surfaceId{}; Tag tag{}; Props::Shared props{}; EventEmitter::Shared eventEmitter{}; diff --git a/ReactCommon/react/renderer/mounting/StubView.cpp b/ReactCommon/react/renderer/mounting/StubView.cpp index 503325a1397..737fbb02867 100644 --- a/ReactCommon/react/renderer/mounting/StubView.cpp +++ b/ReactCommon/react/renderer/mounting/StubView.cpp @@ -14,6 +14,7 @@ StubView::operator ShadowView() const { auto shadowView = ShadowView{}; shadowView.componentName = componentName; shadowView.componentHandle = componentHandle; + shadowView.surfaceId = surfaceId; shadowView.tag = tag; shadowView.props = props; shadowView.eventEmitter = eventEmitter; @@ -25,6 +26,7 @@ StubView::operator ShadowView() const { void StubView::update(ShadowView const &shadowView) { componentName = shadowView.componentName; componentHandle = shadowView.componentHandle; + surfaceId = shadowView.surfaceId; tag = shadowView.tag; props = shadowView.props; eventEmitter = shadowView.eventEmitter; @@ -53,6 +55,7 @@ std::vector getDebugProps( StubView const &stubView, DebugStringConvertibleOptions options) { return { + {"surfaceId", getDebugDescription(stubView.surfaceId, options)}, {"tag", getDebugDescription(stubView.tag, options)}, {"props", getDebugDescription(stubView.props, options)}, {"eventEmitter", getDebugDescription(stubView.eventEmitter, options)}, diff --git a/ReactCommon/react/renderer/mounting/StubView.h b/ReactCommon/react/renderer/mounting/StubView.h index 3c95f68f5be..ca433c953b3 100644 --- a/ReactCommon/react/renderer/mounting/StubView.h +++ b/ReactCommon/react/renderer/mounting/StubView.h @@ -31,6 +31,7 @@ class StubView final { ComponentName componentName; ComponentHandle componentHandle; + SurfaceId surfaceId; Tag tag; SharedProps props; SharedEventEmitter eventEmitter;