Skip to content

fix: preserve indexed Boolean CopyBits semantics - #601

Open
benletchford wants to merge 1 commit into
masterfrom
dev/shared-palette-boolean-copybits
Open

fix: preserve indexed Boolean CopyBits semantics#601
benletchford wants to merge 1 commit into
masterfrom
dev/shared-palette-boolean-copybits

Conversation

@benletchford

Copy link
Copy Markdown
Owner

Cause

CopyBits routed Boolean source modes through RGB conversion even when the source and destination PixMaps had the same indexed depth and ColorTable. That discarded the source pixel-index bit pattern, so operations such as srcXor were no longer reversible and complementary sprite draws could leave palette artifacts.

Fix

  • Detect shared explicit indexed color spaces at 2-, 4-, and 8-bit depths.
  • Apply all eight Boolean source modes directly to source and destination pixel indices in that case.
  • Mask complemented results to the active pixel depth.
  • Keep foreground/background color conversion and palette translation for different color spaces and depths.
  • Use the same behavior in both standard CopyBits execution paths.

Tests

  • cargo fmt --check
  • cargo test copy_bits_ (33 passed)
  • cargo test trap::quickdraw::tests (628 passed)
  • cargo test --lib (2,951 passed; 3 ignored)

Closes #563

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.

Shared-palette indexed CopyBits leaves Boolean transfer artifacts

1 participant