[2/2] windowscodecs: Implement ComponentFactory_CreateBitmapFromMemory.

Vincent Povirk madewokherd at gmail.com
Thu Dec 27 10:19:36 CST 2012


>> I'm pretty sure CreateBitmapFromMemory copies the data rather than
>> referencing existing data.
>
> How do you know that? In any case adding a test case and support for that
> behaviour should be pretty trivial once this patch is accepted.

I believe it was this stack overflow question that first tipped me
off: http://stackoverflow.com/questions/11263099/render-direct2d-into-existing-memory

There's also a comment on the documentation that suggests it does a
copy: http://msdn.microsoft.com/en-us/library/ee690291%28v=vs.85%29.aspx

Note that this was all before I did any real work with IWICBitmap.

I think I tested this when I first implemented IWICBimap, to decide
whether the ability to reference existing data would be needed at all,
but if so I no longer have that test case. It should be trivial to add
to your test.

So, this is trivial to test and would mean that the features your
patch would add are no longer needed (except possibly the ability to
supply a stride for the new bitmap - but I would test that as well, as
it seems very strange to me that WIC would copy the bits without
removing the gaps). Potentially, your whole patch might have to be
reverted in favor of copying image data in CreateBitmapFromMemory. I
think it's better to skip adding new functionality than add it and
remove it later.



More information about the wine-devel mailing list