@@ -24,6 +24,7 @@ import java.util.*
24
24
import java.util.concurrent.ConcurrentHashMap
25
25
import java.util.concurrent.CountDownLatch
26
26
27
+
27
28
/* *
28
29
* Created by triniwiz on 3/29/20
29
30
*/
@@ -419,6 +420,7 @@ class TNSCanvas : FrameLayout, FrameCallback, ActivityLifecycleCallbacks {
419
420
} else if (type.contains(" webgl" )) {
420
421
attributes[" alpha" ] = true
421
422
attributes[" depth" ] = true
423
+ attributes[" antialias" ] = true
422
424
attributes[" failIfMajorPerformanceCaveat" ] = false
423
425
attributes[" powerPreference" ] = " default"
424
426
attributes[" premultipliedAlpha" ] = true
@@ -438,52 +440,27 @@ class TNSCanvas : FrameLayout, FrameCallback, ActivityLifecycleCallbacks {
438
440
when (key) {
439
441
" alpha" -> {
440
442
contextAlpha = value as Boolean
441
- contextDepth = value
442
- contextFailIfMajorPerformanceCaveat = value
443
- contextPremultipliedAlpha = value
444
- contextPreserveDrawingBuffer = value
445
- contextStencil = value
446
- contextXrCompatible = value
447
- contextDesynchronized = value
443
+ }
444
+ " antialias" -> {
445
+ contextAntialias = value as Boolean
448
446
}
449
447
" depth" -> {
450
448
contextDepth = value as Boolean
451
- contextFailIfMajorPerformanceCaveat = value
452
- contextPremultipliedAlpha = value
453
- contextPreserveDrawingBuffer = value
454
- contextStencil = value
455
- contextXrCompatible = value
456
- contextDesynchronized = value
457
449
}
458
450
" failIfMajorPerformanceCaveat" -> {
459
451
contextFailIfMajorPerformanceCaveat = value as Boolean
460
- contextPremultipliedAlpha = value
461
- contextPreserveDrawingBuffer = value
462
- contextStencil = value
463
- contextXrCompatible = value
464
- contextDesynchronized = value
465
452
}
466
453
" premultipliedAlpha" -> {
467
454
contextPremultipliedAlpha = value as Boolean
468
- contextPreserveDrawingBuffer = value
469
- contextStencil = value
470
- contextXrCompatible = value
471
- contextDesynchronized = value
472
455
}
473
456
" preserveDrawingBuffer" -> {
474
457
contextPreserveDrawingBuffer = value as Boolean
475
- contextStencil = value
476
- contextXrCompatible = value
477
- contextDesynchronized = value
478
458
}
479
459
" stencil" -> {
480
460
contextStencil = value as Boolean
481
- contextXrCompatible = value
482
- contextDesynchronized = value
483
461
}
484
462
" xrCompatible" -> {
485
463
contextXrCompatible = value as Boolean
486
- contextDesynchronized = value
487
464
}
488
465
" desynchronized" -> contextDesynchronized = value as Boolean
489
466
" powerPreference" -> contextPowerPreference = value as String?
@@ -610,7 +587,7 @@ class TNSCanvas : FrameLayout, FrameCallback, ActivityLifecycleCallbacks {
610
587
density : Float ,
611
588
alpha : Boolean ,
612
589
fontColor : Int ,
613
- ppi : Int ,
590
+ ppi : Float ,
614
591
direction : Int
615
592
): Long
616
593
@@ -657,7 +634,7 @@ class TNSCanvas : FrameLayout, FrameCallback, ActivityLifecycleCallbacks {
657
634
internal const val ONE_MILLISECOND_NS : Long = 1000000
658
635
internal const val ONE_S_IN_NS = 1000 * ONE_MILLISECOND_NS
659
636
internal var lastCall: Long = 0
660
- private var isLibraryLoaded = false
637
+ internal var isLibraryLoaded = false
661
638
const val TAG = " CanvasView"
662
639
663
640
@JvmStatic
0 commit comments