Add comments to FlatViewGroup, DrawCommandManage, ElementsList and StateBuilder.

Summary: Documentate all of the things.

Reviewed By: ahmedre

Differential Revision: D3700420
This commit is contained in:
Seth Kirby
2016-08-15 14:16:53 -07:00
committed by Ahmed El-Helw
parent 3adbf1e822
commit 8600723402
8 changed files with 656 additions and 74 deletions
@@ -57,13 +57,21 @@ import android.util.SparseIntArray;
return mRegionMaxBottom[index] < touchY;
}
// These should never be called from the UI thread, as the reason they exist is to do work off
// the UI thread.
public static void fillMaxMinArrays(NodeRegion[] regions, float[] maxBot, float[] minTop) {
/**
* Populates the max and min arrays for a given set of node regions.
*
* This should never be called from the UI thread, as the reason it exists is to do work off the
* UI thread.
*
* @param regions The regions that will eventually be mounted.
* @param maxBottom At each index i, the maximum bottom value of all regions at or below i.
* @param minTop At each index i, the minimum top value of all regions at or below i.
*/
public static void fillMaxMinArrays(NodeRegion[] regions, float[] maxBottom, float[] minTop) {
float last = 0;
for (int i = 0; i < regions.length; i++) {
last = Math.max(last, regions[i].mBottom);
maxBot[i] = last;
maxBottom[i] = last;
}
for (int i = regions.length - 1; i >= 0; i--) {
last = Math.min(last, regions[i].mTop);
@@ -71,11 +79,21 @@ import android.util.SparseIntArray;
}
}
// These should never be called from the UI thread, as the reason they exist is to do work off
// the UI thread.
/**
* Populates the max and min arrays for a given set of draw commands. Also populates a mapping of
* react tags to their index position in the command array.
*
* This should never be called from the UI thread, as the reason it exists is to do work off the
* UI thread.
*
* @param commands The draw commands that will eventually be mounted.
* @param maxBottom At each index i, the maximum bottom value of all draw commands at or below i.
* @param minTop At each index i, the minimum top value of all draw commands at or below i.
* @param drawViewIndexMap Mapping of ids to index position within the draw command array.
*/
public static void fillMaxMinArrays(
DrawCommand[] commands,
float[] maxBot,
float[] maxBottom,
float[] minTop,
SparseIntArray drawViewIndexMap) {
float last = 0;
@@ -90,7 +108,7 @@ import android.util.SparseIntArray;
} else {
last = Math.max(last, commands[i].getBottom());
}
maxBot[i] = last;
maxBottom[i] = last;
}
// Intentionally leave last as it was, since it's at the maximum bottom position we've seen so
// far, we can use it again.