Merge "Do not draw snapshot starting window if allocate graphic buffer fail." into udc-dev

This commit is contained in:
Wei Sheng Shih
2023-03-14 01:45:39 +00:00
committed by Android (Google) Code Review

View File

@@ -223,6 +223,11 @@ public class SnapshotDrawerUtils {
PixelFormat.RGBA_8888,
GraphicBuffer.USAGE_HW_TEXTURE | GraphicBuffer.USAGE_HW_COMPOSER
| GraphicBuffer.USAGE_SW_WRITE_RARELY);
if (background == null) {
Log.e(TAG, "Unable to draw snapshot: failed to allocate graphic buffer for "
+ mTitle);
return;
}
// TODO: Support this on HardwareBuffer
final Canvas c = background.lockCanvas();
drawBackgroundAndBars(c, frame);