wincodecs: Add support for WICBitmapNoCache in CreateBitmapFromSource() for bitmap as a source.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Vincent Povirk <vincent@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e26e3da6cd
commit
70a3e86997
|
@ -19,6 +19,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
@ -501,9 +502,18 @@ static HRESULT create_bitmap_from_source_rect(IWICBitmapSource *piBitmapSource,
|
|||
IWICPixelFormatInfo2 *formatinfo;
|
||||
WICPixelFormatNumericRepresentation format_type;
|
||||
|
||||
assert(!rect || (rect && option == WICBitmapCacheOnLoad));
|
||||
|
||||
if (!piBitmapSource || !ppIBitmap)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if (option == WICBitmapNoCache && SUCCEEDED(IWICBitmapSource_QueryInterface(piBitmapSource,
|
||||
&IID_IWICBitmap, (void **)&result)))
|
||||
{
|
||||
*ppIBitmap = result;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
hr = IWICBitmapSource_GetSize(piBitmapSource, &width, &height);
|
||||
|
||||
if (SUCCEEDED(hr) && rect)
|
||||
|
|
|
@ -456,7 +456,6 @@ static void test_createbitmapfromsource(void)
|
|||
hr = IWICImagingFactory_CreateBitmapFromSource(factory, (IWICBitmapSource *)bitmap,
|
||||
WICBitmapNoCache, &bitmap2);
|
||||
ok(hr == S_OK, "IWICImagingFactory_CreateBitmapFromSource failed hr=%x\n", hr);
|
||||
todo_wine
|
||||
ok(bitmap2 == bitmap, "Unexpected bitmap instance.\n");
|
||||
|
||||
IWICBitmap_Release(bitmap2);
|
||||
|
|
Loading…
Reference in New Issue