Skip to content
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

Open
wants to merge 95 commits into
base: main
Choose a base branch
from

Conversation

pauldendulk
Copy link
Member

@pauldendulk pauldendulk commented May 10, 2024

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.


private readonly ConcurrentHashSet<int> _createdImages = [];
private readonly ConcurrentHashSet<string> _createdBitmapPathImages = [];
private bool _disposed;
Copy link
Member Author

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; }
Copy link
Member Author

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.

@pauldendulk
Copy link
Member Author

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.

pauldendulk and others added 30 commits May 24, 2024 22:44
Replace BitmapInfo with IDrawableImage
Rename SymbolCache to DrawableImageCache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants