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
This commit is contained in:
Joshua Gross
2021-01-21 23:47:34 -08:00
committed by Facebook GitHub Bot
parent 5a2099fe7d
commit 82e9cb1b4e
4 changed files with 9 additions and 0 deletions
@@ -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<DebugStringConvertibleObject> 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)},
@@ -40,6 +40,7 @@ struct ShadowView final {
ComponentName componentName{};
ComponentHandle componentHandle{};
SurfaceId surfaceId{};
Tag tag{};
Props::Shared props{};
EventEmitter::Shared eventEmitter{};
@@ -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<DebugStringConvertibleObject> 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)},
@@ -31,6 +31,7 @@ class StubView final {
ComponentName componentName;
ComponentHandle componentHandle;
SurfaceId surfaceId;
Tag tag;
SharedProps props;
SharedEventEmitter eventEmitter;