mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Refactor DrawView to avoid extra allocates.
Summary: Previously, the first time we collected a draw view, we would make a clone, even though the draw view had never been mutated. This refactors draw view to avoid this extra allocate. Reviewed By: ahmedre Differential Revision: D3719056
This commit is contained in:
1 parent
cc216b5ec3
commit
b2f41e2921
3 files changed
+70
-42
No files matched your search
@@ -503,7 +503,7 @@ import com.facebook.react.views.view.ReactClippingViewGroupHelper;
|
||||
float clipRight,
|
||||
float clipBottom) {
|
||||
Assertions.assumeNotNull(mDrawView);
|
||||
if (mDrawView.reactTag == 0) {
|
||||
if (mDrawView == EMPTY_DRAW_VIEW) {
|
||||
// This is the first time we have collected this DrawView, but we have to create a new
|
||||
// DrawView anyway, as reactTag is final, and our DrawView instance is the static copy.
|
||||
mDrawView = new DrawView(getReactTag());
|
||||
|
||||
Reference in new issue
Block a user