[PR #500] [MERGED] buffer: add opaque fast-path in setCellWithAlphaBlending #1357

Closed
opened 2026-03-14 09:32:31 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/500
Author: @simonklee
Created: 1/8/2026
Status: Merged
Merged: 1/13/2026
Merged by: @kommander

Base: mainHead: buffer-opaque-fast-path


📝 Commits (2)

  • 88b749e buffer: add opaque fast-path in setCellWithAlphaBlending
  • 67a3afc Merge branch 'main' into buffer-opaque-fast-path

📊 Changes

1 file changed (+22 additions, -4 deletions)

View changed files

📝 packages/core/src/zig/buffer.zig (+22 -4)

📄 Description

Most rendered cells are fully opaque, yet the blending path unconditionally calls get() + blendCells() for every cell.

This adds an opaque check to skip blending in the common case.

For the raw variant, the only caller is the graphemeAware=false branch in drawFrameBuffer, so grapheme chars should never appear. I made this contract explicit by replacing the grapheme fallback with debug asserts, avoiding per-cell overhead in release builds.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/500 **Author:** [@simonklee](https://github.com/simonklee) **Created:** 1/8/2026 **Status:** ✅ Merged **Merged:** 1/13/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `buffer-opaque-fast-path` --- ### 📝 Commits (2) - [`88b749e`](https://github.com/anomalyco/opentui/commit/88b749e31f3c97fd423a8fe672a129df9ec0e025) buffer: add opaque fast-path in setCellWithAlphaBlending - [`67a3afc`](https://github.com/anomalyco/opentui/commit/67a3afcf3dcc789fbb7b81b9362c84bdaf777a85) Merge branch 'main' into buffer-opaque-fast-path ### 📊 Changes **1 file changed** (+22 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/zig/buffer.zig` (+22 -4) </details> ### 📄 Description Most rendered cells are fully opaque, yet the blending path unconditionally calls get() + blendCells() for every cell. This adds an opaque check to skip blending in the common case. For the raw variant, the only caller is the graphemeAware=false branch in drawFrameBuffer, so grapheme chars should never appear. I made this contract explicit by replacing the grapheme fallback with debug asserts, avoiding per-cell overhead in release builds. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 09:32:31 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#1357
No description provided.