mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Revert D8194925: Fix ART surface sleep issue
Differential Revision: D8194925 Original commit changeset: 5448d49d9590 fbshipit-source-id: c01e11d44424e1f6fb79866bb845ed60764c5f13
This commit is contained in:
committed by
Facebook Github Bot
parent
536c937269
commit
fecfa2a553
+11
-7
@@ -16,7 +16,7 @@ import android.graphics.PorterDuff;
|
||||
import android.graphics.SurfaceTexture;
|
||||
import android.util.Log;
|
||||
import android.view.Surface;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.TextureView;
|
||||
|
||||
import com.facebook.react.common.ReactConstants;
|
||||
import com.facebook.react.uimanager.ReactShadowNode;
|
||||
@@ -25,9 +25,8 @@ import com.facebook.react.views.art.ARTVirtualNode;
|
||||
import com.facebook.yoga.YogaValue;
|
||||
import com.facebook.yoga.YogaUnit;
|
||||
|
||||
|
||||
/* package */ class FlatARTSurfaceViewShadowNode extends FlatShadowNode
|
||||
implements AndroidView, SurfaceHolder.Callback {
|
||||
implements AndroidView, TextureView.SurfaceTextureListener {
|
||||
private boolean mPaddingChanged = false;
|
||||
private @Nullable Surface mSurface;
|
||||
|
||||
@@ -124,16 +123,21 @@ import com.facebook.yoga.YogaUnit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceCreated(SurfaceHolder holder) {
|
||||
mSurface = holder.getSurface();
|
||||
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
|
||||
mSurface = new Surface(surface);
|
||||
drawOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
|
||||
surface.release();
|
||||
mSurface = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {}
|
||||
public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {}
|
||||
|
||||
@Override
|
||||
public void onSurfaceTextureUpdated(SurfaceTexture surface) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user