-
Notifications
You must be signed in to change notification settings - Fork 476
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
Conversation
`number` is always double, which does not have the same integer precision as uint64_t/bigint/uintptr_t.
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(); |
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.
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?
closing for now after offline discussion |
This PR changes
ThreadContextHolder::ThreadSkiaMetalContext
toThreadContextHolder::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.