Rebase against 842452d4e79b20c42d2b7e279063b2feabeb31de.

This commit is contained in:
Zebediah Figura 2022-02-25 16:02:18 -06:00 committed by Alistair Leslie-Hughes
parent 776c2a6800
commit 87f607719e
6 changed files with 33 additions and 205 deletions

View File

@ -1,4 +1,4 @@
From 8c7187f5501fff70df81612dfbdd084e67605189 Mon Sep 17 00:00:00 2001
From bf4cc6cfca946ff719763bb7be25fe268577f0d3 Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Mon, 21 May 2018 18:13:00 -0700
Subject: [PATCH] dwrite: Use font fallback when mapping characters
@ -7,11 +7,11 @@ Signed-off-by: Lucian Poston <lucianposton@pm.me>
---
dlls/dwrite/analyzer.c | 77 +++++++++++++++++++++++++++++---------
dlls/dwrite/layout.c | 6 +++
dlls/dwrite/tests/layout.c | 54 +++++---------------------
3 files changed, 74 insertions(+), 63 deletions(-)
dlls/dwrite/tests/layout.c | 54 ++++----------------------
3 files changed, 73 insertions(+), 64 deletions(-)
diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c
index 13ccf8e4434..c535b0cf49d 100644
index 7ffcfa8070c..aab309c2a8c 100644
--- a/dlls/dwrite/analyzer.c
+++ b/dlls/dwrite/analyzer.c
@@ -2094,6 +2094,7 @@ static HRESULT fallback_get_fallback_font(struct dwrite_fontfallback *fallback,
@ -124,7 +124,7 @@ index 13ccf8e4434..c535b0cf49d 100644
free(buff);
return hr;
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index d4aa49c6a6c..cda50c20777 100644
index ba80c3f70e8..c7845f9b675 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -725,6 +725,12 @@ static HRESULT layout_resolve_fonts(struct dwrite_textlayout *layout)
@ -141,10 +141,10 @@ index d4aa49c6a6c..cda50c20777 100644
IDWriteFont_Release(font);
if (FAILED(hr)) {
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 096fc554253..b622aeb4239 100644
index 3efedd3df95..07687c76c60 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -3368,35 +3368,23 @@ static void test_GetMetrics(void)
@@ -3366,35 +3366,23 @@ static void test_GetMetrics(void)
count = 0;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
@ -180,45 +180,48 @@ index 096fc554253..b622aeb4239 100644
ok(metrics.lineCount == 1, "got %u\n", metrics.lineCount);
IDWriteTextLayout_Release(layout);
@@ -4690,12 +4678,9 @@ static void test_MapCharacters(void)
@@ -4688,16 +4676,12 @@ static void test_MapCharacters(void)
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 1, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
- todo_wine
ok(font != NULL, "got %p\n", font);
if (font) {
-if (font) {
IDWriteFont_Release(font);
@@ -4707,16 +4692,13 @@ if (font) {
-}
+
/* same Latin text, full length */
g_source = L"abc";
mappedlength = 0;
@@ -4705,16 +4689,12 @@ if (font) {
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 3, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
- todo_wine
ok(font != NULL, "got %p\n", font);
-if (font) {
- IDWriteFont_Release(font);
IDWriteFont_Release(font);
-}
+ if (font) {
+ IDWriteFont_Release(font);
+ }
+
/* string 'a\x3058b' */
g_source = str2W;
mappedlength = 0;
@@ -4724,32 +4706,24 @@ if (font) {
@@ -4722,32 +4702,24 @@ if (font) {
font = NULL;
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 0, 3, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
@ -235,7 +238,7 @@ index 096fc554253..b622aeb4239 100644
hr = IDWriteFontFallback_MapCharacters(fallback, &analysissource, 1, 2, NULL, NULL, DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, &mappedlength, &font, &scale);
-todo_wine {
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
-}
ok(scale == 1.0f, "got %f\n", scale);
@ -248,7 +251,7 @@ index 096fc554253..b622aeb4239 100644
/* Try with explicit collection, Tahoma will be forced. */
/* 1. Latin part */
g_source = str2W;
@@ -4772,7 +4746,10 @@ if (font) {
@@ -4770,7 +4742,10 @@ if (font) {
IDWriteLocalizedStrings_Release(strings);
IDWriteFont_Release(font);
@ -260,15 +263,15 @@ index 096fc554253..b622aeb4239 100644
g_source = str2W;
mappedlength = 0;
scale = 0.0f;
@@ -4782,7 +4759,6 @@ if (font) {
ok(hr == S_OK, "got 0x%08x\n", hr);
@@ -4780,7 +4755,6 @@ if (font) {
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
ok(mappedlength == 1, "got %u\n", mappedlength);
ok(scale == 1.0f, "got %f\n", scale);
- ok(font != NULL, "got %p\n", font);
exists = FALSE;
hr = IDWriteFont_GetInformationalStrings(font, DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES, &strings, &exists);
@@ -6669,34 +6645,22 @@ static void test_GetMetrics_with_custom_fontcollection(void)
@@ -6667,34 +6641,22 @@ static void test_GetMetrics_with_custom_fontcollection(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
count = 9999;
hr = IDWriteTextLayout_GetClusterMetrics(layout, clusters, 4, &count);
@ -304,5 +307,5 @@ index 096fc554253..b622aeb4239 100644
IDWriteTextLayout_Release(layout);
--
2.34.1
2.35.1

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "2d0e84e60196693d1caa6e2d70422051b56cfe08"
echo "842452d4e79b20c42d2b7e279063b2feabeb31de"
}
# Show version information

View File

@ -1,4 +1,4 @@
From 455aefaf6f4e5b3b631722be3ad0911dbe015952 Mon Sep 17 00:00:00 2001
From 05f0a7d14311569807af62cc87780a67cb26194a Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 10 Jan 2019 16:17:33 +1100
Subject: [PATCH] user32/msgbox: Use a windows hook to trap Ctrl+C
@ -8,7 +8,7 @@ Subject: [PATCH] user32/msgbox: Use a windows hook to trap Ctrl+C
1 file changed, 20 insertions(+)
diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
index d47d9eaac22..db036b28b69 100644
index d47d9eaac22..cf00d69df69 100644
--- a/dlls/user32/msgbox.c
+++ b/dlls/user32/msgbox.c
@@ -388,6 +388,22 @@ static void MSGBOX_CopyToClipbaord( HWND hwnd )
@ -28,7 +28,7 @@ index d47d9eaac22..db036b28b69 100644
+ }
+ }
+
+ return CallNextHookEx(msghook_handle, nCode, wParam, lParam);
+ return NtUserCallNextHookEx(msghook_handle, nCode, wParam, lParam);
+}
+
/**************************************************************************
@ -53,5 +53,5 @@ index d47d9eaac22..db036b28b69 100644
case WM_COMMAND:
switch (LOWORD(wParam))
--
2.34.1
2.35.1

View File

@ -1,172 +0,0 @@
From 50eb09e2b9b0d8a9f2301353e58af510a098c682 Mon Sep 17 00:00:00 2001
From: Zebediah Figura <z.figura12@gmail.com>
Date: Sat, 22 May 2021 18:26:41 -0500
Subject: [PATCH] wined3d: Submit the data inline in
wined3d_cs_update_sub_resource() if possible.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Based on a patch by Michael Müller.
---
dlls/wined3d/cs.c | 75 +++++++++++++++++++++++++++++++++-
dlls/wined3d/wined3d_private.h | 1 +
2 files changed, 74 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 0186b1b3184..e5c554e04d3 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -2704,6 +2704,38 @@ static void wined3d_cs_update_sub_resource(struct wined3d_device_context *contex
const void *data, unsigned int row_pitch, unsigned int slice_pitch)
{
struct wined3d_cs_update_sub_resource *op;
+ size_t data_size;
+
+ if (resource->type == WINED3D_RTYPE_BUFFER)
+ {
+ data_size = box->right - box->left;
+ }
+ else
+ {
+ const struct wined3d_format *format = resource->format;
+
+ data_size = (box->back - box->front - 1) * slice_pitch
+ + ((box->bottom - box->top - 1) / format->block_height) * row_pitch
+ + ((box->right - box->left + format->block_width - 1) / format->block_width) * format->block_byte_count;
+ }
+
+ if (context->ops->check_space(context, sizeof(*op) + data_size, WINED3D_CS_QUEUE_DEFAULT))
+ {
+ op = wined3d_device_context_require_space(context, sizeof(*op) + data_size, WINED3D_CS_QUEUE_DEFAULT);
+ op->opcode = WINED3D_CS_OP_UPDATE_SUB_RESOURCE;
+ op->resource = resource;
+ op->sub_resource_idx = sub_resource_idx;
+ op->box = *box;
+ op->data.row_pitch = row_pitch;
+ op->data.slice_pitch = slice_pitch;
+ op->data.data = NULL;
+ memcpy(op + 1, data, data_size);
+
+ wined3d_resource_acquire(resource);
+
+ wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT);
+ return;
+ }
wined3d_resource_wait_idle(resource);
@@ -2719,8 +2751,7 @@ static void wined3d_cs_update_sub_resource(struct wined3d_device_context *contex
wined3d_device_context_acquire_resource(context, resource);
wined3d_device_context_submit(context, WINED3D_CS_QUEUE_MAP);
- /* The data pointer may go away, so we need to wait until it is read.
- * Copying the data may be faster if it's small. */
+ /* The data pointer may go away, so we need to wait until it is read. */
wined3d_device_context_finish(context, WINED3D_CS_QUEUE_MAP);
}
@@ -2940,6 +2971,12 @@ static void wined3d_cs_exec_execute_command_list(struct wined3d_cs *cs, const vo
}
}
+static BOOL wined3d_cs_st_check_space(struct wined3d_device_context *context,
+ size_t size, enum wined3d_cs_queue_id queue_id)
+{
+ return TRUE;
+}
+
static void *wined3d_cs_st_require_space(struct wined3d_device_context *context,
size_t size, enum wined3d_cs_queue_id queue_id)
{
@@ -2997,6 +3034,7 @@ static void wined3d_cs_st_finish(struct wined3d_device_context *context, enum wi
static const struct wined3d_device_context_ops wined3d_cs_st_ops =
{
+ wined3d_cs_st_check_space,
wined3d_cs_st_require_space,
wined3d_cs_st_submit,
wined3d_cs_st_finish,
@@ -3039,6 +3077,19 @@ static void wined3d_cs_mt_submit(struct wined3d_device_context *context, enum wi
wined3d_cs_queue_submit(&cs->queue[queue_id], cs);
}
+static BOOL wined3d_cs_queue_check_space(struct wined3d_cs_queue *queue, size_t size)
+{
+ size_t queue_size = ARRAY_SIZE(queue->data);
+ size_t header_size, packet_size, remaining;
+
+ header_size = FIELD_OFFSET(struct wined3d_cs_packet, data[0]);
+ size = (size + header_size - 1) & ~(header_size - 1);
+ packet_size = FIELD_OFFSET(struct wined3d_cs_packet, data[size]);
+
+ remaining = queue_size - queue->head;
+ return (remaining >= packet_size);
+}
+
static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size_t size, struct wined3d_cs *cs)
{
size_t queue_size = ARRAY_SIZE(queue->data);
@@ -3101,6 +3152,17 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size
return packet->data;
}
+static BOOL wined3d_cs_mt_check_space(struct wined3d_device_context *context,
+ size_t size, enum wined3d_cs_queue_id queue_id)
+{
+ struct wined3d_cs *cs = wined3d_cs_from_context(context);
+
+ if (cs->thread_id == GetCurrentThreadId())
+ return wined3d_cs_st_check_space(context, size, queue_id);
+
+ return wined3d_cs_queue_check_space(&cs->queue[queue_id], size);
+}
+
static void *wined3d_cs_mt_require_space(struct wined3d_device_context *context,
size_t size, enum wined3d_cs_queue_id queue_id)
{
@@ -3125,6 +3187,7 @@ static void wined3d_cs_mt_finish(struct wined3d_device_context *context, enum wi
static const struct wined3d_device_context_ops wined3d_cs_mt_ops =
{
+ wined3d_cs_mt_check_space,
wined3d_cs_mt_require_space,
wined3d_cs_mt_submit,
wined3d_cs_mt_finish,
@@ -3360,6 +3423,13 @@ static struct wined3d_deferred_context *wined3d_deferred_context_from_context(st
return CONTAINING_RECORD(context, struct wined3d_deferred_context, c);
}
+static BOOL wined3d_deferred_context_check_space(struct wined3d_device_context *context,
+ size_t size, enum wined3d_cs_queue_id queue_id)
+{
+ /* This is only called from wined3d_cs_update_sub_resource(). */
+ assert(0);
+}
+
static void *wined3d_deferred_context_require_space(struct wined3d_device_context *context,
size_t size, enum wined3d_cs_queue_id queue_id)
{
@@ -3577,6 +3647,7 @@ static void wined3d_deferred_context_execute_command_list(struct wined3d_device_
static const struct wined3d_device_context_ops wined3d_deferred_context_ops =
{
+ wined3d_deferred_context_check_space,
wined3d_deferred_context_require_space,
wined3d_deferred_context_submit,
wined3d_deferred_context_finish,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index e7a3e42d8bb..59cb5fe75cb 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -4682,6 +4682,7 @@ struct wined3d_cs_queue
struct wined3d_device_context_ops
{
+ BOOL (*check_space)(struct wined3d_device_context *context, size_t size, enum wined3d_cs_queue_id queue_id);
void *(*require_space)(struct wined3d_device_context *context, size_t size, enum wined3d_cs_queue_id queue_id);
void (*submit)(struct wined3d_device_context *context, enum wined3d_cs_queue_id queue_id);
void (*finish)(struct wined3d_device_context *context, enum wined3d_cs_queue_id queue_id);
--
2.30.2

View File

@ -1,3 +0,0 @@
# Disabling this for now. Needs to be changed again to match the approach taken
# for deferred contexts; we'll rebase it once that's been finally fixed upstream.
Disabled: true

View File

@ -1 +1 @@
2d0e84e60196693d1caa6e2d70422051b56cfe08
842452d4e79b20c42d2b7e279063b2feabeb31de