Differentiator.h 998 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #pragma once
  8. #include <react/core/ShadowNode.h>
  9. #include <react/mounting/ShadowViewMutation.h>
  10. namespace facebook {
  11. namespace react {
  12. enum class DifferentiatorMode { Classic, OptimizedMoves };
  13. /*
  14. * Calculates a list of view mutations which describes how the old
  15. * `ShadowTree` can be transformed to the new one.
  16. * The list of mutations might be and might not be optimal.
  17. */
  18. ShadowViewMutationList calculateShadowViewMutations(
  19. DifferentiatorMode differentiatorMode,
  20. ShadowNode const &oldRootShadowNode,
  21. ShadowNode const &newRootShadowNode);
  22. /*
  23. * Generates a list of `ShadowViewNodePair`s that represents a layer of a
  24. * flattened view hierarchy.
  25. */
  26. ShadowViewNodePair::List sliceChildShadowNodeViewPairs(
  27. ShadowNode const &shadowNode);
  28. } // namespace react
  29. } // namespace facebook