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

fix: Fix ThreadSkiaMetalContext being re-created at times #2352

Closed
wants to merge 20 commits into from

Conversation

mrousavy
Copy link
Contributor

@mrousavy mrousavy commented Apr 10, 2024

This PR changes ThreadContextHolder::ThreadSkiaMetalContext to ThreadContextHolder::getThreadSpecificSkiaContext() which is safer and fixes a bug in #2344 where I couldn't use the GPU texture.

Note: This PR is based on #2344.

@mrousavy mrousavy changed the base branch from main to feat/make-image-from-platform-buffer April 10, 2024 11:17
@mrousavy mrousavy changed the base branch from feat/make-image-from-platform-buffer to main April 10, 2024 11:18
@wcandillon
Copy link
Contributor

super nice, testing it now

id<MTLCommandQueue> commandQueue = nullptr;
sk_sp<GrDirectContext> skContext = nullptr;
};

class ThreadContextHolder {
public:
static thread_local SkiaMetalContext ThreadSkiaMetalContext;
static const std::unique_ptr<SkiaMetalContext>& getThreadSpecificSkiaContext();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't appear to fix the issue for me.
My test scenario is different as I create offscreen surfaces before testing the platform buffers (so I initialize things you might not have on your side).
Also if there is a change to be made here, should be done as a standalone change first?

@wcandillon
Copy link
Contributor

closing for now after offline discussion

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.

2 participants