On Thu Nov 23 13:37:07 2023 +0000, Nikolay Sivov wrote:
That's not what I meant. Keep a single 'struct d2d_factory *factory' field and use it for everything. Then have enter/leave inline helpers called unconditionally, and check some factory type flag in there. Once we have 'struct d2d_factory *' pointer we don't need to go through public API to get multithreaded interface, and so on.
My apologies for misunderstanding previously, I thought the intent for using `d2d_factory` was just to hide the details of the factory locking mechanism from device. I think I needed a better understanding on the why.
When you say "use it for everything": did you want me to remove the existing `ID2D1Factory *factory`? And then replace all uses of it with the `d2d_factory`. So I would effectively mirror the public API, but have it use `d2d_factory` instead (declaring them in `d2d1_private.h`).
And then to create inline helpers using the `d2d_factory`, I would need to move the `d2d_factory` definition in to `d2d1_private.h`.
Let me know if I've got that right.