Skip to content

feat(export)!: replace on-screen bitmap capture with headless PNG exporter - #132

Open
akshay2211 wants to merge 1 commit into
mainfrom
feat/headless-bitmap
Open

feat(export)!: replace on-screen bitmap capture with headless PNG exporter#132
akshay2211 wants to merge 1 commit into
mainfrom
feat/headless-bitmap

Conversation

@akshay2211

Copy link
Copy Markdown
Owner

Remove the legacy screen-capture PNG route and promote the headless raster exporter as the sole PNG path.

Removed (BREAKING):

  • DrawBoxController.saveBitmap()
  • Event.PngSaved / Intent.SaveBitmap
  • capturePending/captureLayer machinery + State.invokeBitmap in DrawBox

Added / promoted:

  • DrawBoxController.exportPng(scale, background, textMeasurer) -> Event.PngExported(bytes)
  • PngExporter + per-platform PngEncoder (renders state.elements off-screen via the SDK's real renderElement, then encodes to PNG bytes)

Sample app: onDownloadPng now calls exportPng(...) and ImageSaver.savePng takes ByteArray (writes the already-encoded bytes directly, no re-encode).

Docs: migration guide section, CHANGELOG, README, and the api-reference / faq / features / architecture pages updated. Warrants a 3.0.0 release.

(cherry picked from commit 04999a7)

Summary

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking, additive to the frozen 2.x surface)
  • Incubating API (opt-in via annotation)
  • Breaking change (would land in a future major)
  • Docs / build / CI only

Affected targets

  • Android
  • iOS
  • JVM Desktop
  • Web (WASM)
  • Web (Kotlin/JS)

Public API impact

  • No public API change
  • Additive only (new symbols, no signature changes)
  • Modifies a 2.x frozen surface — link to RFC or discussion:

Testing

  • Unit tests added / updated
  • Snapshot tests updated (Roborazzi baselines regenerated if applicable)
  • Manually verified on:

Checks

  • ./gradlew :DrawBox:spotlessCheck passes
  • ./gradlew :DrawBox:jvmTest passes
  • ./gradlew :DrawBox:dokkaGenerateHtml passes
  • CHANGELOG entry added under the correct release heading (if user-facing)
  • Migration notes added (if the JSON scene format or a frozen surface moved)

Screenshots / recording

Linked issues

@akshay2211 akshay2211 self-assigned this Jul 27, 2026
@akshay2211 akshay2211 added the enhancement New feature or request label Jul 27, 2026
…orter

Remove the legacy screen-capture PNG route and promote the headless
raster exporter as the sole PNG path.

Removed (BREAKING):
- DrawBoxController.saveBitmap()
- Event.PngSaved / Intent.SaveBitmap
- capturePending/captureLayer machinery + State.invokeBitmap in DrawBox

Added / promoted:
- DrawBoxController.exportPng(scale, background, textMeasurer) -> Event.PngExported(bytes)
- PngExporter + per-platform PngEncoder (renders state.elements off-screen
  via the SDK's real renderElement, then encodes to PNG bytes)

Sample app: onDownloadPng now calls exportPng(...) and ImageSaver.savePng
takes ByteArray (writes the already-encoded bytes directly, no re-encode).

Docs: migration guide section, CHANGELOG, README, and the api-reference /
faq / features / architecture pages updated. Warrants a 3.0.0 release.

(cherry picked from commit 04999a7)
@akshay2211
akshay2211 force-pushed the feat/headless-bitmap branch from d2f0134 to a063cd6 Compare July 29, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant