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:
Joshua Gross
2021-02-25 10:06:56 -08:00
committed by Facebook GitHub Bot
parent 4e243ca7a3
commit f8261bbe51
2 changed files with 5 additions and 11 deletions
@@ -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) {
@@ -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++],