Vadim recently mentioned that it could be good to use Direct2D to rasterize SVGs in wxBitmapBundle.
This is an attempt to implement this in a class wxBitmapBundleImplSVGD2D. Disclaimer: I have no experience with Direct2D or any other high-performance graphic API.
I was surprised how limited SVG support in Direct2D is. For example, even the latest version does not support text element, for more information about SVG support in Direct2D see here.
This makes me wonder if using Direct2D renderer is really any better than existing NanoSVG one. I will benchmark the two and see if Direct2D is at least (much) faster but considering its purpose here, the speed may not matter much. I will also finish the program displaying SVGs with both renderers to help check how they cope with different SVGs.
My implementation limitations:
IWICBitmap, the device context and bitmap are shared among all instances of wxBitmapBundle, created upon first use of any wxBitmapBundleImplSVGD2D method and kept alive during the program lifetime. This may be an utterly wrong approach, please feel free to point it out.Known issues
I call Direct2D APIs like this
hr = wxD2D1Factory()->CreateWicBitmapRenderTarget(ms_bitmap, props, &target);
if ( FAILED(hr) ) ...
However, anytime a call fails, a D2D DEBUG ERROR exception is thrown before the if ( FAILED(...) is executed. I find this very surprising, similar code I saw actually had to ask for an exception with DX::ThrowIfFailed(). Yet, I do not want exceptions but I get them. I could wrap the code with try catch, but I think this should be handled differently. Any ideas?
https://github.com/wxWidgets/wxWidgets/pull/22028
(1 file)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
@PBfordev pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #22028.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
I have messed-up the commit history, closing and will create a new PR. Sorry.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
I have messed-up the commit history, closing and will create a new PR. Sorry.
You don't need to create a new PR to fix the commit history, just do a force push to your branch.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()