vstgui icon indicating copy to clipboard operation
vstgui copied to clipboard

Add support for large bitmaps with GPU rendering on Direct2D backend

Open raygit83 opened this issue 2 years ago • 4 comments

Current Direct2D / DirectComposition backend implementation has a pixel limit of 16384x16384. Bitmaps which exceed this limit in one or more dimensions won't be drawn at all. This is an issue in views / controls inheriting from IMultiBitmapContol (e.g. CAnimKnob). We discussed adding an optional two dimensional arrangement of the sub-bitmap in order to work around that.

See here for further details: https://forums.steinberg.net/t/issues-with-large-bitmaps-on-windows-using-vstgui-4-10/790601

raygit83 avatar Jul 27 '22 11:07 raygit83

Hey @raygit83, I've made a prototype to fix this issue. Please see the multi-frame-bitmap branch and tell me if this would work for you this way, or if something is missing. Thanks.

scheffle avatar Aug 10 '22 12:08 scheffle

Hey @scheffle, great work. Thanks for the quick update. I think the implementation for CMovieBitmap is missing and perhaps some other views or controls we're not using currently (?).

Two remarks, though:

  1. From a design perspective I think the code paths for the CBitmap case should be deprecated at some point because right now a lot of redundant implementation resides in the view/control code, while the rest is encapsulated in CMultiFrameBitmap. The latter provides all the functionality that CBitmap did up to that point, so CBitmap becomes a special case of CMultiFrameBitmap. This could be enforced by changing the API (ctor's, setBackground() and so forth) to expect a CMultiFrameBitmap instead of CBitmap.
  2. We're using a view's backOffset for various things in our code. I wonder why setBackOffset() has been removed at some point. Would it be feasible to add setBackOffset() for all view's that use a background bitmap and honor backOffset in the draw code?

Thanks again!

raygit83 avatar Aug 11 '22 07:08 raygit83

Hi @raygit83, for the backOffset stuff, can you please create a new issue? It makes it easier to track this different thing. And you are right, the current state is not the final one, I just wanted to hear if this is an approach you can work with. The plan is to get rid of IMutliBitmapControl and use the new bitmap class instead.

scheffle avatar Aug 12 '22 07:08 scheffle

@scheffle alright, awesome. I'll look out for the final integration of CMultiFrameBitmap and file a new issue regarding the backOffset. Thanks again!

raygit83 avatar Aug 12 '22 09:08 raygit83

This is now part of VSTGUI 4.12

scheffle avatar Dec 11 '22 13:12 scheffle