am d303dd3d: Merge "Prevent NPE in TextureView.getBitmap()" into jb-dev
* commit 'd303dd3da2af272d0beaac956a12e145b8386f45': Prevent NPE in TextureView.getBitmap()
This commit is contained in:
@@ -561,7 +561,17 @@ public class TextureView extends View {
|
|||||||
applyUpdate();
|
applyUpdate();
|
||||||
applyTransformMatrix();
|
applyTransformMatrix();
|
||||||
|
|
||||||
mLayer.copyInto(bitmap);
|
// This case can happen if the app invokes setSurfaceTexture() before
|
||||||
|
// we are able to create the hardware layer. We can safely initialize
|
||||||
|
// the layer here thanks to the validate() call at the beginning of
|
||||||
|
// this method
|
||||||
|
if (mLayer == null && mUpdateSurface) {
|
||||||
|
getHardwareLayer();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mLayer != null) {
|
||||||
|
mLayer.copyInto(bitmap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user