mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Gather command and node region information off the UI thread.
Summary: This optimizes node region searches in clipping cases, and does position calculation for drawCommands off of the UI thread. Reviewed By: ahmedre Differential Revision: D3665301
This commit is contained in:
committed by
Ahmed El-Helw
parent
ca79e6cf30
commit
192c99a4f6
@@ -16,7 +16,7 @@ import android.graphics.Canvas;
|
||||
* Instances of DrawCommand are created in background thread and passed to UI thread.
|
||||
* Once a DrawCommand is shared with UI thread, it can no longer be mutated in background thread.
|
||||
*/
|
||||
public interface DrawCommand {
|
||||
public abstract class DrawCommand {
|
||||
// used by StateBuilder, FlatViewGroup and FlatShadowNode
|
||||
/* package */ static final DrawCommand[] EMPTY_ARRAY = new DrawCommand[0];
|
||||
|
||||
@@ -26,7 +26,7 @@ public interface DrawCommand {
|
||||
* @param parent The parent to get child information from, if needed
|
||||
* @param canvas The canvas to draw into
|
||||
*/
|
||||
public void draw(FlatViewGroup parent, Canvas canvas);
|
||||
abstract void draw(FlatViewGroup parent, Canvas canvas);
|
||||
|
||||
/**
|
||||
* Performs debug bounds drawing into the given canvas.
|
||||
@@ -34,5 +34,13 @@ public interface DrawCommand {
|
||||
* @param parent The parent to get child information from, if needed
|
||||
* @param canvas The canvas to draw into
|
||||
*/
|
||||
public void debugDraw(FlatViewGroup parent, Canvas canvas);
|
||||
abstract void debugDraw(FlatViewGroup parent, Canvas canvas);
|
||||
|
||||
abstract float getLeft();
|
||||
|
||||
abstract float getTop();
|
||||
|
||||
abstract float getRight();
|
||||
|
||||
abstract float getBottom();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user