mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98ca19eec7 | ||
|
|
4d1f1a4e29 | ||
|
|
a98ee9147a | ||
|
|
d1730ff960 |
+2
-2
@@ -28,8 +28,8 @@
|
||||
"set-version": "node ./scripts/releases/set-version.js",
|
||||
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
|
||||
"test-ci": "jest --maxWorkers=2 --ci --reporters=\"default\" --reporters=\"jest-junit\"",
|
||||
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
|
||||
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
|
||||
"test-release-local-clean": "node ./scripts/release-testing/test-release-local-clean.js",
|
||||
"test-release-local": "node ./scripts/release-testing/test-release-local.js",
|
||||
"test-ios": "./scripts/objc-test.sh test",
|
||||
"test-typescript": "tsc -p packages/react-native/types/tsconfig.json",
|
||||
"test-generated-typescript": "tsc -p packages/react-native/types_generated/tsconfig.test.json",
|
||||
|
||||
@@ -112,6 +112,8 @@ val preparePrefab by
|
||||
Pair(
|
||||
"../ReactCommon/react/renderer/animations/",
|
||||
"react/renderer/animations/"),
|
||||
// react_renderer_bridging
|
||||
Pair("../ReactCommon/react/renderer/bridging/", "react/renderer/bridging/"),
|
||||
// react_renderer_componentregistry
|
||||
Pair(
|
||||
"../ReactCommon/react/renderer/componentregistry/",
|
||||
|
||||
@@ -82,6 +82,15 @@ class ShadowNodeTraits {
|
||||
// Must not be set directly. It is used by the view culling algorithm to
|
||||
// efficiently determine if a node is uncullable.
|
||||
Unstable_uncullableTrace = 1 << 13,
|
||||
|
||||
// Indicates that the `YogaLayoutableShadowNode` must set `isDirty` flag for
|
||||
// Yoga node when a `ShadowNode` is being cloned. `ShadowNode`s that modify
|
||||
// Yoga styles in the constructor (or later) *after* the `ShadowNode`
|
||||
// is cloned must set this trait.
|
||||
// Any Yoga node (not only Leaf ones) can have this trait.
|
||||
// **Deprecated**: This trait is deprecated and will be removed in a future
|
||||
// version of React Native.
|
||||
DirtyYogaNode = 1 << 14,
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
@@ -28,22 +28,22 @@ ColorComponents colorComponentsFromColor(SharedColor sharedColor) {
|
||||
}
|
||||
|
||||
// Read alpha channel in [0, 255] range
|
||||
uint8_t alphaFromColor(SharedColor color) {
|
||||
uint8_t alphaFromColor(SharedColor color) noexcept {
|
||||
return static_cast<uint8_t>(std::round(alphaFromHostPlatformColor(*color)));
|
||||
}
|
||||
|
||||
// Read red channel in [0, 255] range
|
||||
uint8_t redFromColor(SharedColor color) {
|
||||
uint8_t redFromColor(SharedColor color) noexcept {
|
||||
return static_cast<uint8_t>(std::round(redFromHostPlatformColor(*color)));
|
||||
}
|
||||
|
||||
// Read green channel in [0, 255] range
|
||||
uint8_t greenFromColor(SharedColor color) {
|
||||
uint8_t greenFromColor(SharedColor color) noexcept {
|
||||
return static_cast<uint8_t>(std::round(greenFromHostPlatformColor(*color)));
|
||||
}
|
||||
|
||||
// Read blue channel in [0, 255] range
|
||||
uint8_t blueFromColor(SharedColor color) {
|
||||
uint8_t blueFromColor(SharedColor color) noexcept {
|
||||
return static_cast<uint8_t>(std::round(blueFromHostPlatformColor(*color)));
|
||||
}
|
||||
|
||||
|
||||
@@ -61,10 +61,10 @@ bool isColorMeaningful(const SharedColor& color) noexcept;
|
||||
SharedColor colorFromComponents(ColorComponents components);
|
||||
ColorComponents colorComponentsFromColor(SharedColor color);
|
||||
|
||||
uint8_t alphaFromColor(SharedColor color);
|
||||
uint8_t redFromColor(SharedColor color);
|
||||
uint8_t greenFromColor(SharedColor color);
|
||||
uint8_t blueFromColor(SharedColor color);
|
||||
uint8_t alphaFromColor(SharedColor color) noexcept;
|
||||
uint8_t redFromColor(SharedColor color) noexcept;
|
||||
uint8_t greenFromColor(SharedColor color) noexcept;
|
||||
uint8_t blueFromColor(SharedColor color) noexcept;
|
||||
SharedColor colorFromRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
|
||||
|
||||
SharedColor clearColor();
|
||||
|
||||
@@ -15,19 +15,19 @@
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
Transform Transform::Identity() {
|
||||
/* static */ Transform Transform::Identity() noexcept {
|
||||
return {};
|
||||
}
|
||||
|
||||
Transform Transform::VerticalInversion() {
|
||||
/* static */ Transform Transform::VerticalInversion() noexcept {
|
||||
return Transform::Scale(1, -1, 1);
|
||||
}
|
||||
|
||||
Transform Transform::HorizontalInversion() {
|
||||
/* static */ Transform Transform::HorizontalInversion() noexcept {
|
||||
return Transform::Scale(-1, 1, 1);
|
||||
}
|
||||
|
||||
Transform Transform::Perspective(Float perspective) {
|
||||
/* static */ Transform Transform::Perspective(Float perspective) noexcept {
|
||||
auto transform = Transform{};
|
||||
auto Zero = ValueUnit(0, UnitType::Point);
|
||||
transform.operations.push_back(TransformOperation{
|
||||
@@ -39,7 +39,7 @@ Transform Transform::Perspective(Float perspective) {
|
||||
return transform;
|
||||
}
|
||||
|
||||
Transform Transform::Scale(Float x, Float y, Float z) {
|
||||
/* static */ Transform Transform::Scale(Float x, Float y, Float z) noexcept {
|
||||
auto transform = Transform{};
|
||||
Float xprime = isZero(x) ? 0 : x;
|
||||
Float yprime = isZero(y) ? 0 : y;
|
||||
@@ -57,7 +57,8 @@ Transform Transform::Scale(Float x, Float y, Float z) {
|
||||
return transform;
|
||||
}
|
||||
|
||||
Transform Transform::Translate(Float x, Float y, Float z) {
|
||||
/* static */ Transform
|
||||
Transform::Translate(Float x, Float y, Float z) noexcept {
|
||||
auto transform = Transform{};
|
||||
Float xprime = isZero(x) ? 0 : x;
|
||||
Float yprime = isZero(y) ? 0 : y;
|
||||
@@ -75,7 +76,7 @@ Transform Transform::Translate(Float x, Float y, Float z) {
|
||||
return transform;
|
||||
}
|
||||
|
||||
Transform Transform::Skew(Float x, Float y) {
|
||||
/* static */ Transform Transform::Skew(Float x, Float y) noexcept {
|
||||
auto transform = Transform{};
|
||||
Float xprime = isZero(x) ? 0 : x;
|
||||
Float yprime = isZero(y) ? 0 : y;
|
||||
@@ -89,7 +90,7 @@ Transform Transform::Skew(Float x, Float y) {
|
||||
return transform;
|
||||
}
|
||||
|
||||
Transform Transform::RotateX(Float radians) {
|
||||
/* static */ Transform Transform::RotateX(Float radians) noexcept {
|
||||
auto transform = Transform{};
|
||||
if (!isZero(radians)) {
|
||||
auto Zero = ValueUnit(0, UnitType::Point);
|
||||
@@ -106,7 +107,7 @@ Transform Transform::RotateX(Float radians) {
|
||||
return transform;
|
||||
}
|
||||
|
||||
Transform Transform::RotateY(Float radians) {
|
||||
/* static */ Transform Transform::RotateY(Float radians) noexcept {
|
||||
auto transform = Transform{};
|
||||
if (!isZero(radians)) {
|
||||
auto Zero = ValueUnit(0, UnitType::Point);
|
||||
@@ -123,7 +124,7 @@ Transform Transform::RotateY(Float radians) {
|
||||
return transform;
|
||||
}
|
||||
|
||||
Transform Transform::RotateZ(Float radians) {
|
||||
/* static */ Transform Transform::RotateZ(Float radians) noexcept {
|
||||
auto transform = Transform{};
|
||||
if (!isZero(radians)) {
|
||||
auto Zero = ValueUnit(0, UnitType::Point);
|
||||
@@ -140,7 +141,7 @@ Transform Transform::RotateZ(Float radians) {
|
||||
return transform;
|
||||
}
|
||||
|
||||
Transform Transform::Rotate(Float x, Float y, Float z) {
|
||||
/* static */ Transform Transform::Rotate(Float x, Float y, Float z) noexcept {
|
||||
auto transform = Transform{};
|
||||
if (!isZero(x)) {
|
||||
transform = transform * Transform::RotateX(x);
|
||||
@@ -154,7 +155,7 @@ Transform Transform::Rotate(Float x, Float y, Float z) {
|
||||
return transform;
|
||||
}
|
||||
|
||||
Transform Transform::FromTransformOperation(
|
||||
/* static */ Transform Transform::FromTransformOperation(
|
||||
TransformOperation transformOperation,
|
||||
const Size& size,
|
||||
const Transform& transform) {
|
||||
@@ -197,7 +198,7 @@ Transform Transform::FromTransformOperation(
|
||||
return Transform::Identity();
|
||||
}
|
||||
|
||||
TransformOperation Transform::DefaultTransformOperation(
|
||||
/* static */ TransformOperation Transform::DefaultTransformOperation(
|
||||
TransformOperationType type) {
|
||||
auto Zero = ValueUnit{0, UnitType::Point};
|
||||
auto One = ValueUnit{1, UnitType::Point};
|
||||
@@ -225,7 +226,7 @@ TransformOperation Transform::DefaultTransformOperation(
|
||||
}
|
||||
}
|
||||
|
||||
Transform Transform::Interpolate(
|
||||
/* static */ Transform Transform::Interpolate(
|
||||
Float animationProgress,
|
||||
const Transform& lhs,
|
||||
const Transform& rhs,
|
||||
@@ -301,15 +302,17 @@ Transform Transform::Interpolate(
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Transform::isVerticalInversion(const Transform& transform) {
|
||||
/* static */ bool Transform::isVerticalInversion(
|
||||
const Transform& transform) noexcept {
|
||||
return floatEquality(transform.at(1, 1), static_cast<Float>(-1.0f));
|
||||
}
|
||||
|
||||
bool Transform::isHorizontalInversion(const Transform& transform) {
|
||||
/* static */ bool Transform::isHorizontalInversion(
|
||||
const Transform& transform) noexcept {
|
||||
return floatEquality(transform.at(0, 0), static_cast<Float>(-1.0f));
|
||||
}
|
||||
|
||||
bool Transform::operator==(const Transform& rhs) const {
|
||||
bool Transform::operator==(const Transform& rhs) const noexcept {
|
||||
for (auto i = 0; i < 16; i++) {
|
||||
if (matrix[i] != rhs.matrix[i]) {
|
||||
return false;
|
||||
@@ -326,7 +329,7 @@ bool Transform::operator==(const Transform& rhs) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Transform::operator!=(const Transform& rhs) const {
|
||||
bool Transform::operator!=(const Transform& rhs) const noexcept {
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
@@ -408,11 +411,11 @@ Transform Transform::operator*(const Transform& rhs) const {
|
||||
return result;
|
||||
}
|
||||
|
||||
Float& Transform::at(int i, int j) {
|
||||
Float& Transform::at(int i, int j) noexcept {
|
||||
return matrix[(i * 4) + j];
|
||||
}
|
||||
|
||||
const Float& Transform::at(int i, int j) const {
|
||||
const Float& Transform::at(int i, int j) const noexcept {
|
||||
return matrix[(i * 4) + j];
|
||||
}
|
||||
|
||||
|
||||
@@ -104,47 +104,47 @@ struct Transform {
|
||||
/*
|
||||
* Returns the identity transform (`[1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1]`).
|
||||
*/
|
||||
static Transform Identity();
|
||||
static Transform Identity() noexcept;
|
||||
|
||||
/*
|
||||
* Returns the vertival inversion transform (`[1 0 0 0; 0 -1 0 0; 0 0 1 0; 0 0
|
||||
* 0 1]`).
|
||||
*/
|
||||
static Transform VerticalInversion();
|
||||
static Transform VerticalInversion() noexcept;
|
||||
|
||||
/*
|
||||
* Returns the horizontal inversion transform (`[-1 0 0 0; 0 1 0 0; 0 0 1 0; 0
|
||||
* 0 0 1]`).
|
||||
*/
|
||||
static Transform HorizontalInversion();
|
||||
static Transform HorizontalInversion() noexcept;
|
||||
|
||||
/*
|
||||
* Returns a Perspective transform.
|
||||
*/
|
||||
static Transform Perspective(Float perspective);
|
||||
static Transform Perspective(Float perspective) noexcept;
|
||||
|
||||
/*
|
||||
* Returns a Scale transform.
|
||||
*/
|
||||
static Transform Scale(Float factorX, Float factorY, Float factorZ);
|
||||
static Transform Scale(Float factorX, Float factorY, Float factorZ) noexcept;
|
||||
|
||||
/*
|
||||
* Returns a Translate transform.
|
||||
*/
|
||||
static Transform Translate(Float x, Float y, Float z);
|
||||
static Transform Translate(Float x, Float y, Float z) noexcept;
|
||||
|
||||
/*
|
||||
* Returns a Skew transform.
|
||||
*/
|
||||
static Transform Skew(Float x, Float y);
|
||||
static Transform Skew(Float x, Float y) noexcept;
|
||||
|
||||
/*
|
||||
* Returns a transform that rotates by `angle` radians along the given axis.
|
||||
*/
|
||||
static Transform RotateX(Float radians);
|
||||
static Transform RotateY(Float radians);
|
||||
static Transform RotateZ(Float radians);
|
||||
static Transform Rotate(Float angleX, Float angleY, Float angleZ);
|
||||
static Transform RotateX(Float radians) noexcept;
|
||||
static Transform RotateY(Float radians) noexcept;
|
||||
static Transform RotateZ(Float radians) noexcept;
|
||||
static Transform Rotate(Float angleX, Float angleY, Float angleZ) noexcept;
|
||||
|
||||
/**
|
||||
* Perform an interpolation between lhs and rhs, given progress.
|
||||
@@ -163,20 +163,20 @@ struct Transform {
|
||||
const Transform& rhs,
|
||||
const Size& size);
|
||||
|
||||
static bool isVerticalInversion(const Transform& transform);
|
||||
static bool isHorizontalInversion(const Transform& transform);
|
||||
static bool isVerticalInversion(const Transform& transform) noexcept;
|
||||
static bool isHorizontalInversion(const Transform& transform) noexcept;
|
||||
|
||||
/*
|
||||
* Equality operators.
|
||||
*/
|
||||
bool operator==(const Transform& rhs) const;
|
||||
bool operator!=(const Transform& rhs) const;
|
||||
bool operator==(const Transform& rhs) const noexcept;
|
||||
bool operator!=(const Transform& rhs) const noexcept;
|
||||
|
||||
/*
|
||||
* Matrix subscript.
|
||||
*/
|
||||
Float& at(int i, int j);
|
||||
const Float& at(int i, int j) const;
|
||||
Float& at(int i, int j) noexcept;
|
||||
const Float& at(int i, int j) const noexcept;
|
||||
|
||||
/*
|
||||
* Concatenates (multiplies) transform matrices.
|
||||
|
||||
@@ -6,10 +6,10 @@ Scripts supporting local manual release testing. See also [How to Test a Release
|
||||
|
||||
For information on command arguments, run `node <command> --help`.
|
||||
|
||||
### `test-e2e-local`
|
||||
### `test-release-local`
|
||||
|
||||
Set up, build, and install a given test app configuration.
|
||||
|
||||
### `test-e2e-local-clean`
|
||||
### `test-release-local-clean`
|
||||
|
||||
Clean up all file system and cache state between tests.
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
* This script, paired with test-e2e-local.js, is the full suite of
|
||||
* This script, paired with test-release-local.js, is the full suite of
|
||||
* tooling needed for a successful local testing experience.
|
||||
* This script is an helper to clean up the environment fully
|
||||
* before running the test suite.
|
||||
Reference in New Issue
Block a user