Skip to content

Fix simulator skin scrollbar repaint - #5352

Merged
liannacasper merged 1 commit into
masterfrom
fix/javase-skin-scrollbar-repaint
Jul 9, 2026
Merged

Fix simulator skin scrollbar repaint#5352
liannacasper merged 1 commit into
masterfrom
fix/javase-skin-scrollbar-repaint

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Summary

Fixes a JavaSE simulator skin scrollbar repaint gap that could leave Swing displaying stale Codename One pixels after the simulator scrollbar changed the canvas offset.

The scrollbar adjustment path updated canvas.x/y and only requested a Swing repaint. That could redraw the existing retained buffer at a new offset without asking Codename One to repaint the current form, leaving the visible pixels out of sync with click routing until another CN1 repaint, such as scrolling, occurred.

This PR requests a current-form repaint after the simulator scrollbar offset changes and adds a JavaSE regression test proving the CN1 repaint is requested.

Validation

  • mvn -pl javase -Plocal-dev-javase -DskipITs -DskipTests=false -Dtest=JavaSEPortSkinScrollbarTest,JavaSEPortWindowBoundsTest,DesktopChromeUITest test

@shai-almog

shai-almog commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 12 screenshots: 12 matched.
✅ JavaSE simulator integration screenshots matched stored baselines.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@shai-almog

shai-almog commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 144 screenshots: 144 matched.

Native Android coverage

  • 📊 Line coverage: 10.07% (10251/101802 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.91% (50401/565682), branch 4.42% (2275/51496), complexity 4.45% (2426/54469), method 6.76% (1909/28260), class 10.87% (437/4020)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 10.07% (10251/101802 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.91% (50401/565682), branch 4.42% (2275/51496), complexity 4.45% (2426/54469), method 6.76% (1909/28260), class 10.87% (437/4020)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 181ms / native 156ms = 1.1x speedup
SIMD float-mul (64K x300) java 111ms / native 66ms = 1.6x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 243.000 ms
Base64 CN1 decode 246.000 ms
Base64 native encode 950.000 ms
Base64 encode ratio (CN1/native) 0.256x (74.4% faster)
Base64 native decode 963.000 ms
Base64 decode ratio (CN1/native) 0.255x (74.5% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog

shai-almog commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 135 screenshots: 135 matched.
✅ JavaScript-port screenshot tests passed.

@shai-almog

shai-almog commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 142 screenshots: 142 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 148 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 82ms / native 11ms = 7.4x speedup
SIMD float-mul (64K x300) java 50ms / native 2ms = 25.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 283.000 ms
Base64 CN1 decode 186.000 ms
Base64 native encode 566.000 ms
Base64 encode ratio (CN1/native) 0.500x (50.0% faster)
Base64 native decode 190.000 ms
Base64 decode ratio (CN1/native) 0.979x (2.1% faster)
Base64 SIMD encode 52.000 ms
Base64 encode ratio (SIMD/CN1) 0.184x (81.6% faster)
Base64 SIMD decode 44.000 ms
Base64 decode ratio (SIMD/CN1) 0.237x (76.3% faster)
Base64 encode ratio (SIMD/native) 0.092x (90.8% faster)
Base64 decode ratio (SIMD/native) 0.232x (76.8% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 16.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.063x (93.8% faster)
Image applyMask (SIMD off) 51.000 ms
Image applyMask (SIMD on) 32.000 ms
Image applyMask ratio (SIMD on/off) 0.627x (37.3% faster)
Image modifyAlpha (SIMD off) 54.000 ms
Image modifyAlpha (SIMD on) 31.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.574x (42.6% faster)
Image modifyAlpha removeColor (SIMD off) 50.000 ms
Image modifyAlpha removeColor (SIMD on) 33.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.660x (34.0% faster)

@shai-almog

shai-almog commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 143 screenshots: 143 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 248 seconds

Build and Run Timing

Metric Duration
Simulator Boot 63000 ms
Simulator Boot (Run) 1000 ms
App Install 14000 ms
App Launch 2000 ms
Test Execution 391000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 59ms / native 4ms = 14.7x speedup
SIMD float-mul (64K x300) java 93ms / native 3ms = 31.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 425.000 ms
Base64 CN1 decode 215.000 ms
Base64 native encode 884.000 ms
Base64 encode ratio (CN1/native) 0.481x (51.9% faster)
Base64 native decode 728.000 ms
Base64 decode ratio (CN1/native) 0.295x (70.5% faster)
Base64 SIMD encode 161.000 ms
Base64 encode ratio (SIMD/CN1) 0.379x (62.1% faster)
Base64 SIMD decode 53.000 ms
Base64 decode ratio (SIMD/CN1) 0.247x (75.3% faster)
Base64 encode ratio (SIMD/native) 0.182x (81.8% faster)
Base64 decode ratio (SIMD/native) 0.073x (92.7% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 27.000 ms
Image createMask (SIMD on) 21.000 ms
Image createMask ratio (SIMD on/off) 0.778x (22.2% faster)
Image applyMask (SIMD off) 273.000 ms
Image applyMask (SIMD on) 264.000 ms
Image applyMask ratio (SIMD on/off) 0.967x (3.3% faster)
Image modifyAlpha (SIMD off) 242.000 ms
Image modifyAlpha (SIMD on) 292.000 ms
Image modifyAlpha ratio (SIMD on/off) 1.207x (20.7% slower)
Image modifyAlpha removeColor (SIMD off) 141.000 ms
Image modifyAlpha removeColor (SIMD on) 309.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 2.191x (119.1% slower)

@shai-almog

shai-almog commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 139 screenshots: 139 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 216 screenshots: 216 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

@shai-almog

shai-almog commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

Compared 137 screenshots: 137 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 228 seconds

Build and Run Timing

Metric Duration
Simulator Boot 65000 ms
Simulator Boot (Run) 1000 ms
App Install 12000 ms
App Launch 4000 ms
Test Execution 363000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 68ms / native 3ms = 22.6x speedup
SIMD float-mul (64K x300) java 66ms / native 3ms = 22.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 282.000 ms
Base64 CN1 decode 198.000 ms
Base64 native encode 359.000 ms
Base64 encode ratio (CN1/native) 0.786x (21.4% faster)
Base64 native decode 240.000 ms
Base64 decode ratio (CN1/native) 0.825x (17.5% faster)
Base64 SIMD encode 55.000 ms
Base64 encode ratio (SIMD/CN1) 0.195x (80.5% faster)
Base64 SIMD decode 47.000 ms
Base64 decode ratio (SIMD/CN1) 0.237x (76.3% faster)
Base64 encode ratio (SIMD/native) 0.153x (84.7% faster)
Base64 decode ratio (SIMD/native) 0.196x (80.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 18.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.111x (88.9% faster)
Image applyMask (SIMD off) 52.000 ms
Image applyMask (SIMD on) 29.000 ms
Image applyMask ratio (SIMD on/off) 0.558x (44.2% faster)
Image modifyAlpha (SIMD off) 62.000 ms
Image modifyAlpha (SIMD on) 43.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.694x (30.6% faster)
Image modifyAlpha removeColor (SIMD off) 56.000 ms
Image modifyAlpha removeColor (SIMD on) 32.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.571x (42.9% faster)

@liannacasper
liannacasper merged commit 2187eea into master Jul 9, 2026
31 checks passed
@liannacasper
liannacasper deleted the fix/javase-skin-scrollbar-repaint branch July 9, 2026 06:03
shai-almog added a commit that referenced this pull request Jul 9, 2026
…paint (#5352)

Conflict resolution:
- VectorMapEngine: took master wholesale. #5350's hasRenderedVisibleTiles()/MapView.isMapReady()
  supersedes this branch's isViewportFullyRendered() -- same visible-tile-coverage idea, but the
  master probe also actively computes and REQUESTS the visible tile set, so it is deterministic
  even before the first paint. The branch-side duplicate is dropped.
- VectorMapScreenshotBaseTest: master's isMapReady() probe (incl. the NativeMap branch), keeping
  this branch's two hardening pieces on top: the 30s wait cap (starved CI simulators exceeded
  the old 9s on heavy first renders) and the CN1SS:WARN when capturing at the cap so a slow leg
  attributes itself instead of surfacing as a mystery mismatch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simulator mouse clicks are not send to to the correct button (and scrolling seems to fix it at least temporarily)

2 participants