Commit 70a3e869 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wincodecs: Add support for WICBitmapNoCache in CreateBitmapFromSource() for bitmap as a source.

parent e26e3da6
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment