Skip to content

Commit

Permalink
Add SurfaceId to ShadowView
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JoshuaGross authored and facebook-github-bot committed Jan 22, 2021
1 parent 5a2099f commit 82e9cb1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ReactCommon/react/renderer/mounting/ShadowView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand All @@ -30,13 +31,15 @@ ShadowView::ShadowView(const ShadowNode &shadowNode)

bool ShadowView::operator==(const ShadowView &rhs) const {
return std::tie(
this->surfaceId,
this->tag,
this->componentName,
this->props,
this->eventEmitter,
this->layoutMetrics,
this->state) ==
std::tie(
rhs.surfaceId,
rhs.tag,
rhs.componentName,
rhs.props,
Expand All @@ -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)},
Expand Down
1 change: 1 addition & 0 deletions ReactCommon/react/renderer/mounting/ShadowView.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ struct ShadowView final {

ComponentName componentName{};
ComponentHandle componentHandle{};
SurfaceId surfaceId{};
Tag tag{};
Props::Shared props{};
EventEmitter::Shared eventEmitter{};
Expand Down
3 changes: 3 additions & 0 deletions ReactCommon/react/renderer/mounting/StubView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)},
Expand Down
1 change: 1 addition & 0 deletions ReactCommon/react/renderer/mounting/StubView.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class StubView final {

ComponentName componentName;
ComponentHandle componentHandle;
SurfaceId surfaceId;
Tag tag;
SharedProps props;
SharedEventEmitter eventEmitter;
Expand Down

0 comments on commit 82e9cb1

Please sign in to comment.