-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP Use ImageSource instead of BitmapId everywhere #2628
base: main
Are you sure you want to change the base?
Conversation
|
||
private readonly ConcurrentHashSet<int> _createdImages = []; | ||
private readonly ConcurrentHashSet<string> _createdBitmapPathImages = []; | ||
private bool _disposed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now working with two caches here. This is temporary.
VectorCache = new VectorCache(this, capacity); | ||
} | ||
|
||
public ISymbolCache SymbolCache { get; } | ||
public IVectorCache VectorCache { get; } | ||
public ITileCache TileCache { get; } | ||
public ILabelCache LabelCache { get; } | ||
public IBitmapRegistry BitmapRegistry { get; } | ||
public IRenderBitmapRegistry BitmapRegistry { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splitting things up in this phase.
This commit add a BitmapPathInitializer which calls a fire and forget method in the render loop which initializes if needed and and if so calls a callback to allow graphics refrehs. https://github.com/Mapsui/Mapsui/pull/2628/commits In the current solution the bitmapath atlas solution is horribly slow. The should be rewritten to use just urls. |
Rewrite Sprites
Replace BitmapPath with BitmapId
Rename BitmapPath to ImageSource
…ature/bitmapregistry
Replace BitmapInfo with IDrawableImage
Let ImageFetcher return byte arrays
…to feature/rename-symbolcache
Reorganize a few extension method
…o feature/rename-symbolcache
… into feature/rename-symbolcache
Rename SymbolCache to DrawableImageCache
…ource Add ImageButtonWidget.ImageSource
In previous PRs it was made possible to load image streams through a url. The underlying idea of working with such a url is that this url itself could serve as the key for the cache, not needing a bitmapId. The first implementation of bitmapPath did not work like that yet. BitmapPath's were also assigned a bitmapId. So in the case of bitmapPath's this was an extra layer on top of the bitmapPath. This PR attempts to remove that. I introduced a BitmapPathRegistry that should function like that. Eventually this may replace the BitmapRegistry entirely.
This is just te beginnen of a rewrite of the mechanism to cache bitmapPath. I split off a new BitmapPathRegistry which should only store bitmapPath items. So in todays version we have two mechanisms which does not make this better right away.