Implement RemoveClippedSubviews for Nodes

Summary:
RN has an optimization in which a ScrollView (or similar ViewGroups)
can ask to remove clipped subviews from the View hierarchy. This patch
implements this optimization for Nodes, but instead of adding and removing the
Views, it attaches and detaches Views instead.

Note that this patch does not handle overflow: visible. This is addressed in a
stacked patch on top of this patch (to simplify the review process).

Reviewed By: astreet

Differential Revision: D3235050
This commit is contained in:
Ahmed El-Helw
2016-05-13 17:49:34 -07:00
parent 96cb8165c8
commit 5f162ca119
5 changed files with 185 additions and 12 deletions

View File

@@ -13,9 +13,11 @@ import android.graphics.Canvas;
/* package */ final class DrawView extends AbstractClippingDrawCommand {
/* package */ static final DrawView INSTANCE = new DrawView(0, 0, 0, 0);
/* package */ final int reactTag;
/* package */ boolean isViewGroupClipped;
public DrawView(float clipLeft, float clipTop, float clipRight, float clipBottom) {
public DrawView(int reactTag, float clipLeft, float clipTop, float clipRight, float clipBottom) {
this.reactTag = reactTag;
setClipBounds(clipLeft, clipTop, clipRight, clipBottom);
}