[PR #10615] Initial refactor of IRenderEngine interface #28141

Open
opened 2026-01-31 09:26:35 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/10615

State: closed
Merged: No


Summary of the Pull Request

This is my proposed solution to #10610

References

PR Checklist

  • Closes #xxx
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Documentation updated. If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated.
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

I've simplified the IRenderEngine interface with the following steps:

  • Removing most rendering methods and replace them with a all-in-one method PaintFrame(IRenderData* pData).
  • Move common logic in renderer.cpp into RenderEngineBase.
  • Clean up unused derived methods that only returns S_OK.

Pros:

  • We can now simplify the logic of each renderer inside PaintFrame w/o worrying about other renderers. This opens up a lot of opportunities for optimization. For example we can now remove the entire PatternId logic in VtRenderer.
  • With less logic in renderer.cpp, the coupling between renderer.cpp & each IRenderEngine is largely loosen. When adding a new method specifically for one renderer, we don't need to add empty implementation for all of them.

Cons:

  • Some logic (_PaintBufferLineHelper) needs to be duplicated in all IRenderEngine. This may pose challenge to future authors who want to change them.

Validation Steps Performed

TODO:

  • TriggerSelection does not work
  • IME overlay in ConHost not working (but works in WT)
  • RenderEngineBase::_titleChanged
  • BgfxEngine & WDDMEngine (I don't know how to build & run these)
**Original Pull Request:** https://github.com/microsoft/terminal/pull/10615 **State:** closed **Merged:** No --- <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This is my proposed solution to #10610 <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [ ] Closes #xxx * [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments I've simplified the `IRenderEngine` interface with the following steps: * Removing most rendering methods and replace them with a all-in-one method `PaintFrame(IRenderData* pData)`. * Move common logic in `renderer.cpp` into `RenderEngineBase`. * Clean up unused derived methods that only returns `S_OK`. **Pros**: * We can now simplify the logic of each renderer inside `PaintFrame` w/o worrying about other renderers. This opens up a lot of opportunities for optimization. For example we can now remove the entire PatternId logic in `VtRenderer`. * With less logic in `renderer.cpp`, the coupling between `renderer.cpp` & each `IRenderEngine` is largely loosen. When adding a new method specifically for one renderer, we don't need to add empty implementation for all of them. **Cons**: * Some logic (`_PaintBufferLineHelper`) needs to be duplicated in all `IRenderEngine`. This may pose challenge to future authors who want to change them. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed TODO: * <del>`TriggerSelection` does not work</del> * <del>IME overlay in ConHost not working (but works in WT)</del> * <del>`RenderEngineBase::_titleChanged`</del> * `BgfxEngine` & `WDDMEngine` (I don't know how to build & run these)
claunia added the pull-request label 2026-01-31 09:26:35 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28141