From db898e4b3315bb11b4ce1079d99d5723b84f9929 Mon Sep 17 00:00:00 2001 From: MHShetty Date: Wed, 12 Jun 2024 19:13:10 +0530 Subject: [PATCH] Use blendMode over xfermode (to support QR for devices with hardware acceleration enabled) --- app/src/main/java/app/grapheneos/camera/ui/QROverlay.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/app/grapheneos/camera/ui/QROverlay.kt b/app/src/main/java/app/grapheneos/camera/ui/QROverlay.kt index 7075dde29..7839dc1ac 100644 --- a/app/src/main/java/app/grapheneos/camera/ui/QROverlay.kt +++ b/app/src/main/java/app/grapheneos/camera/ui/QROverlay.kt @@ -2,11 +2,10 @@ package app.grapheneos.camera.ui import android.content.Context import android.content.res.Resources +import android.graphics.BlendMode import android.graphics.Canvas import android.graphics.Color import android.graphics.Paint -import android.graphics.PorterDuff -import android.graphics.PorterDuffXfermode import android.graphics.RectF import android.util.AttributeSet import android.view.View @@ -28,7 +27,7 @@ class QROverlay(context: Context, attrs: AttributeSet) : View(context, attrs) { private val eraserPaint: Paint = Paint().apply { strokeWidth = boxPaint.strokeWidth - xfermode = PorterDuffXfermode(PorterDuff.Mode.CLEAR) + blendMode = BlendMode.CLEAR } private val boxCornerRadius: Float =