目前在api28中 找不到
canvas.saveLayer(0, 0, getWidth(), getHeight(), null, Canvas.MATRIX_SAVE_FLAG | Canvas.CLIP_SAVE_FLAG | Canvas.HAS_ALPHA_LAYER_SAVE_FLAG | Canvas.FULL_COLOR_LAYER_SAVE_FLAG | Canvas.CLIP_TO_LAYER_SAVE_FLAG);
因为这些标志在api26中已弃用,可直接使用canvas.sava();
或者
canvas.saveLayer(0, 0, getWidth(), getHeight(), ALL_SAVE_FLAG);