mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Don't pass LayoutDirection from Cxx to IntBufferBatchMountItem<Replace this line with a title. Use 1 line only, 67 chars or less>
Summary: I thought we'd need LayoutDirection on the platform at some point, but it turns out we never use it, and don't seem to need it since components just query via `I18nUtil` one time, and it's expected that apps restart if language changes and we need to switch between LTR and RTL. So, it seems like we'll not have any need for this on the platform at any point. And we can save a byte per layout instruction now. Huzzah! Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D26660908 fbshipit-source-id: 54c7d132f5fa260a93fc7f09f7cf63059d52ed1f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4e243ca7a3
commit
f8261bbe51
@@ -105,7 +105,7 @@ static inline int getIntBufferSizeForType(CppMountItem::Type mountItemType) {
|
||||
} else if (mountItemType == CppMountItem::Type::UpdatePadding) {
|
||||
return 5; // tag, top, left, bottom, right
|
||||
} else if (mountItemType == CppMountItem::Type::UpdateLayout) {
|
||||
return 7; // tag, x, y, w, h, layoutDirection, DisplayType
|
||||
return 6; // tag, x, y, w, h, DisplayType
|
||||
} else if (mountItemType == CppMountItem::Type::UpdateEventEmitter) {
|
||||
return 1; // tag
|
||||
} else {
|
||||
@@ -958,8 +958,6 @@ void Binding::schedulerDidFinishTransaction(
|
||||
int y = round(scale(frame.origin.y, pointScaleFactor));
|
||||
int w = round(scale(frame.size.width, pointScaleFactor));
|
||||
int h = round(scale(frame.size.height, pointScaleFactor));
|
||||
int layoutDirection =
|
||||
toInt(mountItem.newChildShadowView.layoutMetrics.layoutDirection);
|
||||
int displayType =
|
||||
toInt(mountItem.newChildShadowView.layoutMetrics.displayType);
|
||||
|
||||
@@ -968,10 +966,9 @@ void Binding::schedulerDidFinishTransaction(
|
||||
temp[2] = y;
|
||||
temp[3] = w;
|
||||
temp[4] = h;
|
||||
temp[5] = layoutDirection;
|
||||
temp[6] = displayType;
|
||||
env->SetIntArrayRegion(intBufferArray, intBufferPosition, 7, temp);
|
||||
intBufferPosition += 7;
|
||||
temp[5] = displayType;
|
||||
env->SetIntArrayRegion(intBufferArray, intBufferPosition, 6, temp);
|
||||
intBufferPosition += 6;
|
||||
}
|
||||
}
|
||||
if (cppUpdateEventEmitterMountItems.size() > 0) {
|
||||
|
||||
+1
-4
@@ -161,8 +161,6 @@ public class IntBufferBatchMountItem implements MountItem {
|
||||
int y = mIntBuffer[i++];
|
||||
int width = mIntBuffer[i++];
|
||||
int height = mIntBuffer[i++];
|
||||
// The final buffer, layoutDirection, seems unused?
|
||||
i++;
|
||||
int displayType = mIntBuffer[i++];
|
||||
surfaceMountingManager.updateLayout(reactTag, x, y, width, height, displayType);
|
||||
|
||||
@@ -232,8 +230,7 @@ public class IntBufferBatchMountItem implements MountItem {
|
||||
} else if (type == INSTRUCTION_UPDATE_LAYOUT) {
|
||||
s.append(
|
||||
String.format(
|
||||
"UPDATE LAYOUT [%d]: x:%d y:%d w:%d h:%d layoutDirection:%d displayType:%d\n",
|
||||
mIntBuffer[i++],
|
||||
"UPDATE LAYOUT [%d]: x:%d y:%d w:%d h:%d displayType:%d\n",
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
mIntBuffer[i++],
|
||||
|
||||
Reference in New Issue
Block a user