Skip to content

Commit db898e4

Browse files
MHShettythestinger
authored andcommitted
Use blendMode over xfermode
(to support QR for devices with hardware acceleration enabled)
1 parent a8b7c55 commit db898e4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/src/main/java/app/grapheneos/camera/ui/QROverlay.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ package app.grapheneos.camera.ui
22

33
import android.content.Context
44
import android.content.res.Resources
5+
import android.graphics.BlendMode
56
import android.graphics.Canvas
67
import android.graphics.Color
78
import android.graphics.Paint
8-
import android.graphics.PorterDuff
9-
import android.graphics.PorterDuffXfermode
109
import android.graphics.RectF
1110
import android.util.AttributeSet
1211
import android.view.View
@@ -28,7 +27,7 @@ class QROverlay(context: Context, attrs: AttributeSet) : View(context, attrs) {
2827

2928
private val eraserPaint: Paint = Paint().apply {
3029
strokeWidth = boxPaint.strokeWidth
31-
xfermode = PorterDuffXfermode(PorterDuff.Mode.CLEAR)
30+
blendMode = BlendMode.CLEAR
3231
}
3332

3433
private val boxCornerRadius: Float =

0 commit comments

Comments
 (0)