Fixed capturing hardware accelerated images

This commit is contained in:
M66B 2022-01-10 11:00:00 +01:00
parent 6480f719ab
commit 8d35d47900
1 changed files with 3 additions and 1 deletions

View File

@ -713,7 +713,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
@Override
public void onScrollCaptureImageRequest(@NonNull ScrollCaptureSession session, @NonNull CancellationSignal signal, @NonNull Rect captureArea, @NonNull Consumer<Rect> onComplete) {
Canvas canvas = session.getSurface().lockCanvas(rect);
//Canvas canvas = session.getSurface().lockCanvas(rect);
Canvas canvas = session.getSurface().lockHardwareCanvas();
Log.i("Capture draw=" + captureArea + " scroll=" + session.getScrollBounds());
try {
canvas.save();
@ -724,6 +725,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
session.getSurface().unlockCanvasAndPost(canvas);
}
Log.i("Capture drawn");
onComplete.accept(captureArea);
}