Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
September 2018
- 70 participants
- 1549 messages
[PATCH 2/3] ddraw: Only do asynchronous clears when the application asked for them.
by Henri Verbeet
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/ddraw/surface.c | 12 ++++++++++--
dlls/wined3d/cs.c | 2 ++
include/wine/wined3d.h | 1 +
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index fc120e390eb..d201d9d4146 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -1458,24 +1458,32 @@ static HRESULT ddraw_surface_blt(struct ddraw_surface *dst_surface, const RECT *
if (flags & DDBLT_COLORFILL)
{
+ wined3d_flags = WINED3DCLEAR_TARGET;
+ if (!(flags & DDBLT_ASYNC))
+ wined3d_flags |= WINED3DCLEAR_SYNCHRONOUS;
+
if (!wined3d_colour_from_ddraw_colour(&dst_surface->surface_desc.u4.ddpfPixelFormat,
dst_surface->palette, fill_colour, &colour))
return DDERR_INVALIDPARAMS;
return wined3d_device_clear_rendertarget_view(wined3d_device,
ddraw_surface_get_rendertarget_view(dst_surface),
- dst_rect, WINED3DCLEAR_TARGET, &colour, 0.0f, 0);
+ dst_rect, wined3d_flags, &colour, 0.0f, 0);
}
if (flags & DDBLT_DEPTHFILL)
{
+ wined3d_flags = WINED3DCLEAR_ZBUFFER;
+ if (!(flags & DDBLT_ASYNC))
+ wined3d_flags |= WINED3DCLEAR_SYNCHRONOUS;
+
if (!wined3d_colour_from_ddraw_colour(&dst_surface->surface_desc.u4.ddpfPixelFormat,
dst_surface->palette, fill_colour, &colour))
return DDERR_INVALIDPARAMS;
return wined3d_device_clear_rendertarget_view(wined3d_device,
ddraw_surface_get_rendertarget_view(dst_surface),
- dst_rect, WINED3DCLEAR_ZBUFFER, NULL, colour.r, 0);
+ dst_rect, wined3d_flags, NULL, colour.r, 0);
}
wined3d_flags = flags & ~DDBLT_ASYNC;
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index ecfce418123..ff4d562f106 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -671,6 +671,8 @@ void wined3d_cs_emit_clear_rendertarget_view(struct wined3d_cs *cs, struct wined
wined3d_resource_acquire(view->resource);
cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
+ if (flags & WINED3DCLEAR_SYNCHRONOUS)
+ cs->ops->finish(cs, WINED3D_CS_QUEUE_DEFAULT);
}
static void acquire_shader_resources(const struct wined3d_state *state, unsigned int shader_mask)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index dc613fff2b2..e2e6a72c846 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1015,6 +1015,7 @@ enum wined3d_shader_type
#define WINED3DCLEAR_TARGET 0x00000001
#define WINED3DCLEAR_ZBUFFER 0x00000002
#define WINED3DCLEAR_STENCIL 0x00000004
+#define WINED3DCLEAR_SYNCHRONOUS 0x80000000
/* Stream source flags */
#define WINED3DSTREAMSOURCE_INDEXEDDATA (1u << 30)
--
2.11.0
Sept. 27, 2018
[PATCH 1/3] wined3d: Do not create DCs for all textures on WINED3D_NO3D adapters.
by Henri Verbeet
WINED3DFMT_D16_UNORM for example doesn't have a corresponding ddi_format.
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/resource.c | 3 ++-
dlls/wined3d/swapchain.c | 4 ++++
dlls/wined3d/texture.c | 4 ++--
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
index 6cb1ac47b4e..9df0a0923b2 100644
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c
@@ -39,7 +39,8 @@ static void resource_check_usage(DWORD usage)
| WINED3DUSAGE_SCRATCH
| WINED3DUSAGE_PRIVATE
| WINED3DUSAGE_LEGACY_CUBEMAP
- | WINED3DUSAGE_TEXTURE;
+ | WINED3DUSAGE_TEXTURE
+ | ~WINED3DUSAGE_MASK;
/* WINED3DUSAGE_WRITEONLY is supposed to result in write-combined mappings
* being returned. OpenGL doesn't give us explicit control over that, but
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 8200bdd5e0a..b068cf164cd 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -834,6 +834,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
texture_desc.multisample_type = swapchain->desc.multisample_type;
texture_desc.multisample_quality = swapchain->desc.multisample_quality;
texture_desc.usage = 0;
+ if (device->wined3d->flags & WINED3D_NO3D)
+ texture_desc.usage |= WINED3DUSAGE_OWNDC;
texture_desc.access = WINED3D_RESOURCE_ACCESS_GPU;
texture_desc.width = swapchain->desc.backbuffer_width;
texture_desc.height = swapchain->desc.backbuffer_height;
@@ -915,6 +917,8 @@ static HRESULT swapchain_init(struct wined3d_swapchain *swapchain, struct wined3
}
texture_desc.usage = swapchain->desc.backbuffer_usage;
+ if (device->wined3d->flags & WINED3D_NO3D)
+ texture_desc.usage |= WINED3DUSAGE_OWNDC;
for (i = 0; i < swapchain->desc.backbuffer_count; ++i)
{
TRACE("Creating back buffer %u.\n", i);
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index c0bdddcaa09..9589e493552 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -2896,7 +2896,7 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
TRACE("Created sub-resource %u (level %u, layer %u).\n",
i, i % texture->level_count, i / texture->level_count);
- if ((desc->usage & WINED3DUSAGE_OWNDC) || (device->wined3d->flags & WINED3D_NO3D))
+ if (desc->usage & WINED3DUSAGE_OWNDC)
{
struct wined3d_texture_idx texture_idx = {texture, i};
@@ -3515,7 +3515,7 @@ HRESULT CDECL wined3d_texture_release_dc(struct wined3d_texture *texture, unsign
return WINED3DERR_INVALIDCALL;
}
- if (!(texture->resource.usage & WINED3DUSAGE_OWNDC) && !(device->wined3d->flags & WINED3D_NO3D))
+ if (!(texture->resource.usage & WINED3DUSAGE_OWNDC))
{
struct wined3d_texture_idx texture_idx = {texture, sub_resource_idx};
--
2.11.0
Sept. 27, 2018
Re: [PATCH 2/4] comctl32/pager: Support header notification conversion.
by Nikolay Sivov
On 09/24/2018 10:12 AM, Zhiyi Zhang wrote:
> +#ifdef _WIN64
> + if (para->code_unicode == HDN_GETDISPINFOW && !strcmp(winetest_platform, "windows"))
> + {
> + skip("Replace text pointer test for HDN_GETDISPINFOW crashes with 64bit cross test on 64bit Windows\n");
> + return;
> + }
> +#endif
> +
We need to figure out what's going on here. I propose to move forward
with the remaining patches, and leave this one until crashing is
understood and resolved.
Sept. 27, 2018
Re: [PATCH 1/4] comctl32/pager: Support date time picker notification conversion.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
Sept. 27, 2018
Re: [PATCH 5/6] quartz/tests/filesource: Add some tests for IBaseFilter_EnumPins().
by Zebediah Figura
On 27/09/18 03:15, Alexandre Julliard wrote:
> Zebediah Figura <z.figura12(a)gmail.com> writes:
>
>> diff --git a/dlls/quartz/tests/util.h b/dlls/quartz/tests/util.h
>> new file mode 100644
>> index 0000000..fe08c65
>> --- /dev/null
>> +++ b/dlls/quartz/tests/util.h
>> @@ -0,0 +1,4 @@
>> +static const WCHAR avifile[] = {'t','e','s','t','.','a','v','i',0};
>> +static const WCHAR mpegfile[] = {'t','e','s','t','.','m','p','g',0};
>> +
>> +WCHAR *load_resource(const WCHAR *name);
>
> It's better to avoid dependencies between test files when possible.
> load_resource() is only a few lines and can be duplicated where needed.
>
The impetus to adding a common header is not so much load_resource() as
to be able to reuse the whole testfilter/testpin infrastructure. It's
useful to be able to connect stock filters to custom filters to test
things like how media types are negotiated, how allocators are
negotiated, how data flows, how EOS/flush/segment notifications are
generated and passed on. Completely avoiding that interdependency would
necessitate duplication of at least 800 lines of code, once per filter
(of which there are at least 9 in quartz), which seems to me less than
desirable, and I figured that as long as code sharing would be desirable
than we might as well share some other utility functions.
I guess one alternative is not to give each source filter its own unit
test, though I'd really rather not do this: it makes more organizational
sense this way, and filters often need subtle differences in how their
test functions are written. test_enum_pins() is a good example: the file
source filter exposes one pin only after IFileSourceFilter_Load() is
called, but the ACM wrapper exposes two pins always, and the AVI
splitter exposes the sink pin always and any number of source pins only
after its input is connected...
I'm still open to using strmbase instead, if this is workable. I
proposed this several months ago to no reply [1], and while I can see
why it's architecturally distasteful, it would eliminate most of the
code sharing or duplication otherwise necessary (plus several hundred
lines of code from filtergraph.c itself).
[1] https://www.winehq.org/pipermail/wine-devel/2018-May/126573.html
Sept. 27, 2018
Re: [PATCH v3 4/6] shell32/autocomplete: Re-arrange some fields for better packing
by Gabriel Ivăncescu
On Thu, Sep 27, 2018 at 5:04 PM, Alexandre Julliard <julliard(a)winehq.org> wrote:
>
> If it's necessary to make things easier to understand, yes. That doesn't
> seem to be the case here.
>
> The important resource here is not a few bytes of memory or a couple of
> CPU cycles, it's developer's time. Making unnecessary changes has a cost
> in brain cycles, when reviewing the patch, when searching through the
> history, and when trying to understand why things are done a certain
> way. Please keep that in mind.
>
> --
> Alexandre Julliard
> julliard(a)winehq.org
Yes in those situations, but I think this patch is pretty harmless as
it is, it doesn't make it harder to understand, just moving around 1
member and using bitfield for flags. The new field would have to be
added anyway. I guess the original rejected form with BOOLEAN instead
of BOOL would have been less changes.
But anyway please consider it, so that the rest of the patches in this
series can also be committed, then I can send the IACList::Expand
patch series and finally finish the original series this is all based
from for now... and move on to the redesign of the enumeration (to
finish two of the TODO at the top of the file)
Sept. 27, 2018
[v2 PATCH] crypt32: Add CRYPT_STRING_BINARY mode for CryptBinaryToStringW().
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/crypt32/base64.c | 27 ++++++++++++++++++++++++---
dlls/crypt32/tests/base64.c | 5 +----
2 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/dlls/crypt32/base64.c b/dlls/crypt32/base64.c
index ac288b7c5e..d158c1aceb 100644
--- a/dlls/crypt32/base64.c
+++ b/dlls/crypt32/base64.c
@@ -88,8 +88,7 @@ static BOOL EncodeBinaryToBinaryA(const BYTE *pbBinary,
memcpy(pszString, pbBinary, cbBinary);
}
else
-
- *pcchString = cbBinary;
+ *pcchString = cbBinary;
return ret;
}
@@ -294,6 +293,26 @@ BOOL WINAPI CryptBinaryToStringA(const BYTE *pbBinary,
return encoder(pbBinary, cbBinary, dwFlags, pszString, pcchString);
}
+static BOOL EncodeBinaryToBinaryW(const BYTE *in_buf, DWORD in_len, DWORD flags, WCHAR *out_buf, DWORD *out_len)
+{
+ BOOL ret = TRUE;
+
+ if (out_buf)
+ {
+ if (*out_len < in_len)
+ {
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ ret = FALSE;
+ }
+ else if (in_len)
+ memcpy(out_buf, in_buf, in_len);
+ }
+ else
+ *out_len = in_len;
+
+ return ret;
+}
+
static LONG encodeBase64W(const BYTE *in_buf, int in_len, LPCWSTR sep,
WCHAR* out_buf, DWORD *out_len)
{
@@ -472,13 +491,15 @@ BOOL WINAPI CryptBinaryToStringW(const BYTE *pbBinary,
switch (dwFlags & 0x0fffffff)
{
+ case CRYPT_STRING_BINARY:
+ encoder = EncodeBinaryToBinaryW;
+ break;
case CRYPT_STRING_BASE64:
case CRYPT_STRING_BASE64HEADER:
case CRYPT_STRING_BASE64REQUESTHEADER:
case CRYPT_STRING_BASE64X509CRLHEADER:
encoder = BinaryToBase64W;
break;
- case CRYPT_STRING_BINARY:
case CRYPT_STRING_HEX:
case CRYPT_STRING_HEXASCII:
case CRYPT_STRING_HEXADDR:
diff --git a/dlls/crypt32/tests/base64.c b/dlls/crypt32/tests/base64.c
index e6adc7ab38..4ff76272e3 100644
--- a/dlls/crypt32/tests/base64.c
+++ b/dlls/crypt32/tests/base64.c
@@ -284,17 +284,14 @@ static void test_CryptBinaryToString(void)
strLen = 0;
ret = CryptBinaryToStringW(tests[i].toEncode, tests[i].toEncodeLen, CRYPT_STRING_BINARY, NULL, &strLen);
- todo_wine {
ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError());
ok(strLen == tests[i].toEncodeLen, "Unexpected required length %u.\n", strLen);
- }
+
strLen2 = strLen;
strW = heap_alloc(strLen);
ret = CryptBinaryToStringW(tests[i].toEncode, tests[i].toEncodeLen, CRYPT_STRING_BINARY, strW, &strLen2);
- todo_wine
ok(ret, "CryptBinaryToStringW failed: %d\n", GetLastError());
ok(strLen == strLen2, "Expected length %u, got %u\n", strLen, strLen2);
- todo_wine
ok(!memcmp(strW, tests[i].toEncode, tests[i].toEncodeLen), "Unexpected value\n");
heap_free(strW);
--
2.19.0
Sept. 27, 2018
[PATCH 2/2] d2d1: Implement newer CreateBitmap() variant.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/device.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
index be31ecafc8..d1c1845171 100644
--- a/dlls/d2d1/device.c
+++ b/dlls/d2d1/device.c
@@ -1783,10 +1783,17 @@ static HRESULT STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_CreateBit
D2D1_SIZE_U size, const void *src_data, UINT32 pitch,
const D2D1_BITMAP_PROPERTIES1 *desc, ID2D1Bitmap1 **bitmap)
{
- FIXME("iface %p, size {%u, %u}, src_data %p, pitch %u, desc %p, bitmap %p stub!\n",
+ struct d2d_device_context *context = impl_from_ID2D1DeviceContext(iface);
+ struct d2d_bitmap *object;
+ HRESULT hr;
+
+ TRACE("iface %p, size {%u, %u}, src_data %p, pitch %u, desc %p, bitmap %p.\n",
iface, size.width, size.height, src_data, pitch, desc, bitmap);
- return E_NOTIMPL;
+ if (SUCCEEDED(hr = d2d_bitmap_create(context, size, src_data, pitch, desc, &object)))
+ *bitmap = &object->ID2D1Bitmap1_iface;
+
+ return hr;
}
static HRESULT STDMETHODCALLTYPE d2d_device_context_ID2D1DeviceContext_CreateBitmapFromWicBitmap(
--
2.19.0
Sept. 27, 2018
[PATCH 1/2] d2d1/tests: Add some tests for compatible target size handling.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
dlls/d2d1/tests/d2d1.c | 196 +++++++++++++++++++++++++++++++++++++----
1 file changed, 181 insertions(+), 15 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 3005b43e44..be26994b30 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -795,6 +795,8 @@ static void check_bitmap_surface_(unsigned int line, ID2D1Bitmap *bitmap, BOOL h
{
D3D10_TEXTURE2D_DESC desc;
ID3D10Texture2D *texture;
+ D2D1_SIZE_U pixel_size;
+ DWORD bind_flags;
ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get bitmap surface, hr %#x.\n", hr);
ok_(__FILE__, line)(!!surface, "Expected surface instance.\n");
@@ -805,12 +807,29 @@ static void check_bitmap_surface_(unsigned int line, ID2D1Bitmap *bitmap, BOOL h
ID3D10Texture2D_GetDesc(texture, &desc);
ok_(__FILE__, line)(desc.Usage == 0, "Unexpected usage %#x.\n", desc.Usage);
- ok_(__FILE__, line)(desc.BindFlags == (options & D2D1_BITMAP_OPTIONS_TARGET ?
- D3D10_BIND_RENDER_TARGET : D3D10_BIND_SHADER_RESOURCE),
- "Unexpected bind flags %#x, bitmap options %#x.\n", desc.BindFlags, options);
+
+ switch (options & (D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW))
+ {
+ case D2D1_BITMAP_OPTIONS_TARGET:
+ bind_flags = D3D10_BIND_RENDER_TARGET | D3D10_BIND_SHADER_RESOURCE;
+ break;
+ case D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW:
+ bind_flags = D3D10_BIND_RENDER_TARGET;
+ break;
+ default:
+ bind_flags = D3D10_BIND_SHADER_RESOURCE;
+ break;
+ }
+
+ ok_(__FILE__, line)(desc.BindFlags == bind_flags, "Unexpected bind flags %#x, bitmap options %#x.\n",
+ desc.BindFlags, options);
ok_(__FILE__, line)(desc.CPUAccessFlags == 0, "Unexpected cpu access flags %#x.\n", desc.CPUAccessFlags);
ok_(__FILE__, line)(desc.MiscFlags == 0, "Unexpected misc flags %#x.\n", desc.MiscFlags);
+ pixel_size = ID2D1Bitmap_GetPixelSize(bitmap);
+ ok_(__FILE__, line)(desc.Width == pixel_size.width && desc.Height == pixel_size.height,
+ "Mismatching texture size.\n");
+
ID3D10Texture2D_Release(texture);
IDXGISurface_Release(surface);
@@ -5234,6 +5253,129 @@ static void test_hwnd_target(void)
ID2D1Factory_Release(factory);
}
+static void test_compatible_target_size(ID2D1RenderTarget *rt)
+{
+ float dpi_x, dpi_y, rt_dpi_x, rt_dpi_y;
+ ID2D1BitmapRenderTarget *bitmap_rt;
+ ID2D1DeviceContext *context;
+ D2D1_SIZE_U pixel_size;
+ D2D1_SIZE_F size;
+ HRESULT hr;
+
+ ID2D1RenderTarget_GetDpi(rt, &rt_dpi_x, &rt_dpi_y);
+
+ pixel_size.height = pixel_size.width = 0;
+ hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, NULL, &pixel_size, NULL,
+ D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt);
+todo_wine
+ ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+ if (FAILED(hr))
+ return;
+
+ pixel_size = ID2D1BitmapRenderTarget_GetPixelSize(bitmap_rt);
+todo_wine
+ ok(pixel_size.width == 0 && pixel_size.height == 0, "Unexpected target size %u x %u.\n",
+ pixel_size.width, pixel_size.height);
+ ID2D1BitmapRenderTarget_GetDpi(bitmap_rt, &dpi_x, &dpi_y);
+ ok(dpi_x == rt_dpi_x && dpi_y == rt_dpi_y, "Unexpected target dpi %.8e x %.8e.\n", dpi_x, dpi_y);
+ ID2D1BitmapRenderTarget_Release(bitmap_rt);
+
+ pixel_size.height = pixel_size.width = 0;
+ size.height = size.width = 0.0f;
+ hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, &size, &pixel_size, NULL,
+ D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt);
+ ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+ pixel_size = ID2D1BitmapRenderTarget_GetPixelSize(bitmap_rt);
+todo_wine
+ ok(pixel_size.width == 0 && pixel_size.height == 0, "Unexpected target size %u x %u.\n",
+ pixel_size.width, pixel_size.height);
+ ID2D1BitmapRenderTarget_GetDpi(bitmap_rt, &dpi_x, &dpi_y);
+ ok(dpi_x == rt_dpi_x && dpi_y == rt_dpi_y, "Unexpected target dpi %.8e x %.8e.\n", dpi_x, dpi_y);
+ ID2D1BitmapRenderTarget_Release(bitmap_rt);
+
+ size.height = size.width = 0.0f;
+ hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, &size, NULL, NULL,
+ D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt);
+ ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+ pixel_size = ID2D1BitmapRenderTarget_GetPixelSize(bitmap_rt);
+todo_wine
+ ok(pixel_size.width == 0 && pixel_size.height == 0, "Unexpected target size %u x %u.\n",
+ pixel_size.width, pixel_size.height);
+ ID2D1BitmapRenderTarget_GetDpi(bitmap_rt, &dpi_x, &dpi_y);
+ ok(dpi_x == rt_dpi_x && dpi_y == rt_dpi_y, "Unexpected target dpi %.8e x %.8e.\n", dpi_x, dpi_y);
+ ID2D1BitmapRenderTarget_Release(bitmap_rt);
+
+ size.height = 1.0f;
+ size.width = 0.0f;
+ hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, &size, NULL, NULL,
+ D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt);
+ ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+ pixel_size = ID2D1BitmapRenderTarget_GetPixelSize(bitmap_rt);
+todo_wine
+ ok(pixel_size.width == 0, "Unexpected target width %u.\n", pixel_size.width);
+ ok(pixel_size.height == ceilf((size.height * rt_dpi_y) / 96.0f),
+ "Unexpected target height %u.\n", pixel_size.height);
+ ID2D1BitmapRenderTarget_GetDpi(bitmap_rt, &dpi_x, &dpi_y);
+ ok(dpi_x == rt_dpi_x && dpi_y == rt_dpi_y, "Unexpected target dpi %.8e x %.8e.\n", dpi_x, dpi_y);
+ ID2D1BitmapRenderTarget_Release(bitmap_rt);
+
+ size.height = 1.0f;
+ size.width = 1.0f;
+ hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, &size, NULL, NULL,
+ D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt);
+ ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+ pixel_size = ID2D1BitmapRenderTarget_GetPixelSize(bitmap_rt);
+ ok(pixel_size.width == ceilf((size.width * rt_dpi_x / 96.0f))
+ && pixel_size.height == ceilf((size.height * rt_dpi_y) / 96.0f),
+ "Unexpected target size %u x %u.\n", pixel_size.width, pixel_size.height);
+ ID2D1BitmapRenderTarget_GetDpi(bitmap_rt, &dpi_x, &dpi_y);
+ ok(dpi_x == rt_dpi_x && dpi_y == rt_dpi_y, "Unexpected target dpi %.8e x %.8e.\n", dpi_x, dpi_y);
+ ID2D1BitmapRenderTarget_Release(bitmap_rt);
+
+ size.height = size.width = 1.0f;
+ pixel_size.height = pixel_size.width = 1;
+ hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, &size, &pixel_size, NULL,
+ D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt);
+ ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+ pixel_size = ID2D1BitmapRenderTarget_GetPixelSize(bitmap_rt);
+ ok(pixel_size.width == 1 && pixel_size.height == 1, "Unexpected target size %u x %u.\n",
+ pixel_size.width, pixel_size.height);
+ ID2D1BitmapRenderTarget_GetDpi(bitmap_rt, &dpi_x, &dpi_y);
+ ok(dpi_x == 96.0f && dpi_y == 96.0f, "Unexpected target dpi %.8e x %.8e.\n", dpi_x, dpi_y);
+ ID2D1BitmapRenderTarget_Release(bitmap_rt);
+
+ pixel_size.height = pixel_size.width = 0;
+ hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, NULL, &pixel_size, NULL,
+ D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &bitmap_rt);
+ ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+
+ pixel_size = ID2D1BitmapRenderTarget_GetPixelSize(bitmap_rt);
+todo_wine
+ ok(pixel_size.width == 0 && pixel_size.height == 0, "Unexpected target size %u x %u.\n",
+ pixel_size.width, pixel_size.height);
+
+ if (SUCCEEDED(ID2D1BitmapRenderTarget_QueryInterface(bitmap_rt, &IID_ID2D1DeviceContext, (void **)&context)))
+ {
+ ID2D1Bitmap *bitmap;
+
+ pixel_size = ID2D1DeviceContext_GetPixelSize(context);
+ todo_wine
+ ok(pixel_size.width == 0 && pixel_size.height == 0, "Unexpected target size %u x %u.\n",
+ pixel_size.width, pixel_size.height);
+
+ ID2D1DeviceContext_GetTarget(context, (ID2D1Image **)&bitmap);
+ pixel_size = ID2D1Bitmap_GetPixelSize(bitmap);
+ todo_wine
+ ok(pixel_size.width == 0 && pixel_size.height == 0, "Unexpected target size %u x %u.\n",
+ pixel_size.width, pixel_size.height);
+ ID2D1Bitmap_Release(bitmap);
+
+ ID2D1DeviceContext_Release(context);
+ }
+
+ ID2D1BitmapRenderTarget_Release(bitmap_rt);
+}
+
static void test_bitmap_target(void)
{
D2D1_HWND_RENDER_TARGET_PROPERTIES hwnd_rt_desc;
@@ -5280,6 +5422,8 @@ static void test_bitmap_target(void)
hr = ID2D1Factory_CreateHwndRenderTarget(factory, &desc, &hwnd_rt_desc, &hwnd_rt);
ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
+ test_compatible_target_size((ID2D1RenderTarget *)hwnd_rt);
+
hr = ID2D1HwndRenderTarget_CreateCompatibleRenderTarget(hwnd_rt, NULL, NULL, NULL,
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &rt);
ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
@@ -5393,13 +5537,15 @@ static void test_bitmap_target(void)
desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
desc.pixelFormat.format = DXGI_FORMAT_B8G8R8A8_UNORM;
desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_PREMULTIPLIED;
- desc.dpiX = 96.0f;
+ desc.dpiX = 192.0f;
desc.dpiY = 96.0f;
desc.usage = D2D1_RENDER_TARGET_USAGE_NONE;
desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
hr = ID2D1Factory_CreateDCRenderTarget(factory, &desc, &dc_rt);
ok(SUCCEEDED(hr), "Failed to create target, hr %#x.\n", hr);
+ test_compatible_target_size((ID2D1RenderTarget *)dc_rt);
+
hr = ID2D1DCRenderTarget_CreateCompatibleRenderTarget(dc_rt, NULL, NULL, NULL,
D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &rt);
ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
@@ -6748,13 +6894,13 @@ static void test_create_device(void)
#define check_rt_bitmap_surface(r, s, o) check_rt_bitmap_surface_(__LINE__, r, s, o)
static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, BOOL has_surface, DWORD options)
{
+ ID2D1BitmapRenderTarget *compatible_rt;
D2D1_BITMAP_PROPERTIES bitmap_desc;
- ID2D1RenderTarget *compatible_rt;
IWICImagingFactory *wic_factory;
+ ID2D1Bitmap *bitmap, *bitmap2;
ID2D1DeviceContext *context;
ID2D1DCRenderTarget *dc_rt;
IWICBitmap *wic_bitmap;
- ID2D1Bitmap *bitmap;
ID2D1Image *target;
D2D1_SIZE_U size;
HRESULT hr;
@@ -6833,10 +6979,10 @@ static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, B
ID2D1DeviceContext_GetDevice(context, &device);
hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, NULL, NULL, NULL,
- D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, (ID2D1BitmapRenderTarget **)&compatible_rt);
+ D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &compatible_rt);
ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create compatible render target, hr %#x.\n", hr);
- hr = ID2D1RenderTarget_QueryInterface(compatible_rt, &IID_ID2D1DeviceContext, (void **)&context2);
+ hr = ID2D1BitmapRenderTarget_QueryInterface(compatible_rt, &IID_ID2D1DeviceContext, (void **)&context2);
ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get device context, hr %#x.\n", hr);
ID2D1DeviceContext_GetDevice(context2, &device2);
@@ -6845,20 +6991,34 @@ static void check_rt_bitmap_surface_(unsigned int line, ID2D1RenderTarget *rt, B
ID2D1Device_Release(device);
ID2D1Device_Release(device2);
- ID2D1DeviceContext_Release(context2);
-
- hr = ID2D1RenderTarget_CreateBitmap(compatible_rt, size, bitmap_data, sizeof(*bitmap_data), &bitmap_desc, &bitmap);
+ hr = ID2D1BitmapRenderTarget_CreateBitmap(compatible_rt, size, bitmap_data, sizeof(*bitmap_data), &bitmap_desc, &bitmap);
ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
-
check_bitmap_surface_(line, bitmap, has_surface, options);
- ID2D1RenderTarget_Release(compatible_rt);
+ ID2D1Bitmap_Release(bitmap);
+
+ hr = ID2D1BitmapRenderTarget_GetBitmap(compatible_rt, &bitmap);
+ ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get compatible target bitmap, hr %#x.\n", hr);
+
+ bitmap2 = NULL;
+ ID2D1DeviceContext_GetTarget(context2, (ID2D1Image **)&bitmap2);
+ todo_wine
+ ok_(__FILE__, line)(bitmap2 == bitmap, "Unexpected bitmap.\n");
+ if (bitmap2)
+ {
+ check_bitmap_surface_(line, bitmap, has_surface, D2D1_BITMAP_OPTIONS_TARGET);
+
+ ID2D1Bitmap_Release(bitmap2);
+ }
ID2D1Bitmap_Release(bitmap);
+
+ ID2D1BitmapRenderTarget_Release(compatible_rt);
+ ID2D1DeviceContext_Release(context2);
}
else
{
hr = ID2D1RenderTarget_CreateCompatibleRenderTarget(rt, NULL, NULL, NULL,
- D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, (ID2D1BitmapRenderTarget **)&compatible_rt);
+ D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE, &compatible_rt);
todo_wine
ok_(__FILE__, line)(hr == WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT, "Unexpected hr %#x.\n", hr);
}
@@ -7024,7 +7184,13 @@ if (SUCCEEDED(hr))
hr = ID2D1Factory1_CreateDCRenderTarget(factory, &rt_desc, (ID2D1DCRenderTarget **)&rt);
ok(SUCCEEDED(hr), "Failed to create target, hr %#x.\n", hr);
- check_rt_bitmap_surface(rt, FALSE, D2D1_BITMAP_OPTIONS_NONE);
+ hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&device_context);
+ ok(SUCCEEDED(hr), "Failed to get device context, hr %#x.\n", hr);
+
+ ID2D1DeviceContext_GetTarget(device_context, (ID2D1Image **)&bitmap);
+ ok(!bitmap, "Unexpected target.\n");
+
+ ID2D1DeviceContext_Release(device_context);
ID2D1RenderTarget_Release(rt);
/* HWND target */
--
2.19.0
Sept. 27, 2018
Re: [PATCH 2/2] msi: Add support for ARPNOMODIFY, APRNOREMOVE and ARPNOREPAIR.
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=42606
Your paranoid android.
=== w7u (32 bit Windows report) ===
msi:
action: Timeout
Sept. 27, 2018