diff options
author | Liang Qi <liang.qi@qt.io> | 2019-01-08 09:34:24 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-01-08 09:34:24 +0100 |
commit | 0e96b5fe482802935ae202e2297404845e440d71 (patch) | |
tree | 79c566f18bc605261f69d750d2935b91edba3861 /src/gui | |
parent | da43362921a62ea3163a042be20ec0f550d05cfa (diff) | |
parent | 5733dfbd90fd059e7310786faefb022b00289592 (diff) | |
download | qtbase-0e96b5fe482802935ae202e2297404845e440d71.tar.gz |
Merge remote-tracking branch 'origin/5.12' into 5.12.1
Conflicts:
src/widgets/kernel/qtooltip.cpp
Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/configure.json | 520 | ||||
-rw-r--r-- | src/gui/configure.pri | 46 | ||||
-rw-r--r-- | src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qpixmap_win.cpp | 7 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 8 | ||||
-rw-r--r-- | src/gui/painting/qrgba64_p.h | 8 | ||||
-rw-r--r-- | src/gui/painting/qtextureglyphcache.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qharfbuzzng.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextengine.cpp | 10 | ||||
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 4 |
10 files changed, 436 insertions, 173 deletions
diff --git a/src/gui/configure.json b/src/gui/configure.json index 7585e9c8d4..89934c8f1d 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -63,48 +63,127 @@ "-lbcm_host" ] }, - "direct2d": { - "label": "Direct 2D", - "export": "", + "dxguid": { + "label": "DirectX GUID", + "sources": [ + "-ldxguid" + ] + }, + "dxgi": { + "label": "DirectX GI", + "headers": "dxgi.h", + "sources": [ + "-ldxgi" + ] + }, + "dxgi1_2": { + "label": "DirectX GI 1.2", "test": { - "include": [ "d3d11_1.h", "d2d1_1.h", "d2d1_1helper.h", "dxgi1_2.h", "wrl.h", "dwrite.h" ], - "tail": "using Microsoft::WRL::ComPtr;", "main": [ - "ComPtr<ID2D1Factory1> d2dFactory;", - "D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, d2dFactory.ReleaseAndGetAddressOf());", - "ComPtr<IDXGISurface1> surface;", + "// fails with mingw-w64 5.4.0 - declaration is missing from header", + "IDXGISurface1 *surface;", "(void) surface;" ] }, + "headers": "dxgi1_2.h", + "sources": [ + "-ldxgi" + ] + }, + "d3d9": { + "label": "Direct3D 9", + "headers": "d3d9.h", + "sources": [ + "-ld3d9" + ] + }, + "d3d11": { + "label": "Direct3D 11", + "headers": "d3d11.h", + "sources": [ + "-ld3d11" + ] + }, + "d3d11_1": { + "label": "Direct3D 11.1", + "headers": "d3d11_1.h", + "sources": [ + "-ld3d11" + ] + }, + "d3dcompiler": { + "label": "Direct3D Shader Compiler Library", + "headers": "d3dcompiler.h", "sources": [ - "-ld2d1 -ldwrite -ld3d11" + "-ld3dcompiler" + ] + }, + "d2d1": { + "label": "Direct2D 1", + "headers": [ "d2d1.h", "d2d1helper.h" ], + "sources": [ + "-ld2d1" + ] + }, + "d2d1_1": { + "label": "Direct2D 1.1", + "test": { + "main": [ + "ID2D1Factory1 *d2dFactory;", + "D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &d2dFactory);" + ] + }, + "headers": [ "d2d1_1.h", "d2d1_1helper.h" ], + "sources": [ + "-ld2d1" ] }, "directfb": { "label": "DirectFB", "test": { - "include": "directfb.h", "tail": [ "#ifdef __typeof__", "# error DirectFB headers are unclean and cannot compile", "#endif" ] }, + "headers": "directfb.h", "sources": [ { "type": "pkgConfig", "args": "directfb" } ] }, - "directwrite": { + "dwrite": { "label": "DirectWrite", - "export": "", "test": { - "include": [ "dwrite.h", "d2d1.h" ], "main": [ "IDWriteFactory *factory = 0;", "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory),", " (IUnknown **)(&factory));" ] }, + "headers": "dwrite.h", + "sources": [ + "-ldwrite" + ] + }, + "dwrite_1": { + "label": "DirectWrite 1", + "headers": "dwrite_1.h", + "sources": [ + "-ldwrite" + ] + }, + "dwrite_2": { + "label": "DirectWrite 2", + "test": { + "main": [ + "IUnknown *factory = 0;", + "(void)(size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2));", + "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2),", + " &factory);" + ] + }, + "headers": "dwrite_2.h", "sources": [ "-ldwrite" ] @@ -117,15 +196,12 @@ "#include <stdint.h>", "extern \"C\" {" ], - "include": [ - "xf86drmMode.h", - "xf86drm.h" - ], "tail": [ "}" ], "main": "(void) drmModeGetCrtc(0, 0);" }, + "headers": [ "xf86drmMode.h", "xf86drm.h" ], "sources": [ { "type": "pkgConfig", "args": "libdrm" }, { "libs": "-ldrm", "condition": "!config.integrity" }, @@ -135,12 +211,12 @@ "egl": { "label": "EGL", "test": { - "include": "EGL/egl.h", "main": [ "EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0;", "eglDestroyContext(dpy, ctx);" ] }, + "headers": "EGL/egl.h", "sources": [ { "type": "pkgConfig", "args": "egl" }, { "type": "makeSpec", "spec": "EGL" } @@ -149,7 +225,6 @@ "freetype": { "label": "FreeType", "test": { - "include": "ft2build.h", "tail": [ "#include FT_FREETYPE_H", "#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20200)", @@ -160,6 +235,7 @@ "FT_Face face = 0;" ] }, + "headers": "ft2build.h", "sources": [ { "type": "pkgConfig", "args": "freetype2" }, { "type": "freetype", "libs": "-lfreetype", "condition": "!config.wasm" }, @@ -172,7 +248,6 @@ "fontconfig": { "label": "Fontconfig", "test": { - "include": "fontconfig/fontconfig.h", "tail": [ "#ifndef FC_RGBA_UNKNOWN", "# error This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define", @@ -182,6 +257,7 @@ "FcPattern *pattern = 0;" ] }, + "headers": "fontconfig/fontconfig.h", "sources": [ { "type": "pkgConfig", "args": "fontconfig" }, { "type": "freetype", "libs": "-lfontconfig" } @@ -196,12 +272,12 @@ "#include <stdint.h>", "extern \"C\" {" ], - "include": "gbm.h", "tail": [ "}" ], "main": "gbm_surface *surface = 0;" }, + "headers": "gbm.h", "sources": [ { "type": "pkgConfig", "args": "gbm" } ] @@ -209,7 +285,6 @@ "harfbuzz": { "label": "HarfBuzz", "test": { - "include": "harfbuzz/hb.h", "tail": [ "#if !HB_VERSION_ATLEAST(1, 6, 0)", "# error This version of harfbuzz is too old.", @@ -224,6 +299,7 @@ "hb_buffer_destroy(buffer);" ] }, + "headers": "harfbuzz/hb.h", "sources": [ "-lharfbuzz" ] @@ -232,9 +308,9 @@ "label": "IMF", "export": "", "test": { - "include": "imf/imf_client.h", "main": "imf_client_init();" }, + "headers": "imf/imf_client.h", "sources": [ "-linput_client" ] @@ -242,9 +318,9 @@ "lgmon": { "label": "lgmon", "test": { - "include": "lgmon.h", "main": "lgmon_supported(getpid());" }, + "headers": "lgmon.h", "sources": [ "-llgmon" ] @@ -252,9 +328,9 @@ "libinput": { "label": "libinput", "test": { - "include": "libinput.h", "main": "libinput_udev_create_context(NULL, NULL, NULL);" }, + "headers": "libinput.h", "sources": [ { "type": "pkgConfig", "args": "libinput" } ] @@ -266,7 +342,6 @@ "#include <stdlib.h>", "#include <stdint.h>" ], - "include": "device/hiddriver.h", "main": [ "HIDDriver *driver;", "uintptr_t devicecontext;", @@ -274,6 +349,7 @@ "gh_hid_enum_devices(driver, &device_id, &devicecontext);" ] }, + "headers": "device/hiddriver.h", "sources": [ { "libs": "-lhiddev -lusbhid -lusb" } ] @@ -286,7 +362,6 @@ "#include <stdio.h>", "extern \"C\" {" ], - "include": "jpeglib.h", "tail": [ "}", "", @@ -294,6 +369,7 @@ ], "main": "jpeg_create_compress(cinfo);" }, + "headers": "jpeglib.h", "sources": [ { "libs": "-llibjpeg", "condition": "config.msvc" }, "-ljpeg" @@ -302,9 +378,9 @@ "libpng": { "label": "libpng", "test": { - "include": "png.h", "main": "(void) png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0);" }, + "headers": "png.h", "sources": [ { "type": "pkgConfig", "args": "libpng" }, { "libs": "-llibpng16", "condition": "config.msvc" }, @@ -320,13 +396,13 @@ "mirclient": { "label": "Mir client libraries", "test": { - "include": [ "mir_toolkit/mir_client_library.h", "ubuntu/application/lifecycle_delegate.h", "EGL/egl.h" ], "tail": "static void surfaceCreateCallback(MirSurface*, void*) {}", "main": [ "u_application_lifecycle_delegate_new();", "mir_surface_create(0, surfaceCreateCallback, 0);" ] }, + "headers": [ "mir_toolkit/mir_client_library.h", "ubuntu/application/lifecycle_delegate.h", "EGL/egl.h" ], "sources": [ { "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api libcontent-hub >= 0.2.0" } ] @@ -334,12 +410,12 @@ "mtdev": { "label": "mtdev", "test": { - "include": "mtdev.h", "main": [ "mtdev m;", "mtdev_open(&m, 0);" ] }, + "headers": "mtdev.h", "sources": [ { "type": "pkgConfig", "args": "mtdev" } ] @@ -352,7 +428,6 @@ "# include <OpenGL/gl.h>", "#else", "# define GL_GLEXT_PROTOTYPES", - "# include <GL/gl.h>", "#endif" ], "main": [ @@ -363,6 +438,12 @@ "glEnd();" ] }, + "headers": [ + { + "condition": "!config.darwin", + "headers": "GL/gl.h" + } + ], "sources": [ { "type": "pkgConfig", "args": "gl", "condition": "!config.darwin" }, { "type": "makeSpec", "spec": "OPENGL" } @@ -376,7 +457,6 @@ "# include <OpenGLES/ES2/gl.h>", "#else", "# define GL_GLEXT_PROTOTYPES", - "# include <GLES2/gl2.h>", "#endif" ], "main": [ @@ -384,6 +464,12 @@ "glClear(GL_COLOR_BUFFER_BIT);" ] }, + "headers": [ + { + "condition": "!config.darwin", + "headers": "GLES2/gl2.h" + } + ], "sources": [ { "type": "pkgConfig", "args": "glesv2", "condition": "!config.darwin" }, { "type": "makeSpec", "spec": "OPENGL_ES2" } @@ -392,9 +478,9 @@ "openvg": { "label": "OpenVG", "test": { - "include": "VG/openvg.h", "main": "VGint i = 2; vgFlush();" }, + "headers": "VG/openvg.h", "sources": [ { "type": "pkgConfig", "args": "vg" }, { "type": "makeSpec", "spec": "OPENVG" } @@ -403,9 +489,9 @@ "tslib": { "label": "tslib", "test": { - "include": "tslib.h", "main": "ts_open(\"foo\", 0);" }, + "headers": "tslib.h", "sources": [ "-lts" ] @@ -417,10 +503,6 @@ "#include <cstddef>", "extern \"C\" {" ], - "include": [ - "mediactl/mediactl.h", - "mediactl/v4l2subdev.h" - ], "tail": [ "}" ], @@ -431,6 +513,7 @@ "v4l2_subdev_set_format(nullptr, nullptr, 0, V4L2_SUBDEV_FORMAT_ACTIVE);" ] }, + "headers": [ "mediactl/mediactl.h", "mediactl/v4l2subdev.h" ], "sources": [ { "type": "pkgConfig", "args": "libv4l2 libmediactl" }, "-lmediactl -lv4l2 -lv4l2subdev" @@ -438,7 +521,23 @@ }, "vulkan": { "label": "Vulkan", - "test": "qpa/vulkan", + "test": { + "comment": "Note: Qt does not rely on linking to a Vulkan library directly.", + "tail": [ + "// The pData parameter has changed from uint32_t* to void* at some point.", + "// Ensure the headers have the updated one to prevent compile errors later on.", + "PFN_vkCmdUpdateBuffer cmdUpdBuf;", + "void testUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData)", + "{", + " cmdUpdBuf(commandBuffer, dstBuffer, dstOffset, dataSize, pData);", + "}" + ], + "main": [ + "VkInstanceCreateInfo info;", + "testUpdateBuffer(0, 0, 0, 0, 0);" + ] + }, + "headers": "vulkan/vulkan.h", "sources": [ { "type": "pkgConfig", "args": "vulkan" }, { "type": "makeSpec", "spec": "VULKAN" } @@ -447,9 +546,9 @@ "wayland_server": { "label": "Wayland Server", "test": { - "include": "wayland-server.h", "main": "wl_display_create();" }, + "headers": "wayland-server.h", "sources": [ { "type": "pkgConfig", "args": "wayland-server" } ] @@ -457,12 +556,12 @@ "xlib": { "label": "XLib", "test": { - "include": "X11/Xlib.h", "main": [ "Display *d = XOpenDisplay(NULL);", "XCloseDisplay(d);" ] }, + "headers": "X11/Xlib.h", "sources": [ { "type": "makeSpec", "spec": "X11" } ] @@ -474,9 +573,8 @@ ] }, "xcb": { - "label": "XCB >= 1.9 (core)", + "label": "XCB >= 1.9", "test": { - "include": "xcb/xcb.h", "main": [ "int primaryScreen = 0;", "(void)xcb_connect(\"\", &primaryScreen);", @@ -484,42 +582,108 @@ "int xcbScreenError = XCB_CONN_CLOSED_INVALID_SCREEN;" ] }, + "headers": "xcb/xcb.h", "sources": [ { "type": "pkgConfig", "args": "xcb >= 1.9" }, "-lxcb" ] }, - "xcb_syslibs": { - "label": "XCB (extensions)", - "test": { - "include": [ - "xcb/xcb.h", - "xcb/xfixes.h", - "xcb/xcb_image.h", - "xcb/xcb_keysyms.h", - "xcb/xinerama.h", - "xcb/sync.h", - "xcb/randr.h", - "xcb/shm.h", - "xcb/xcb_icccm.h" - ], - "main": [ - "int primaryScreen = 0;", - "(void) xcb_connect(\"\", &primaryScreen);" - ] - }, + "xcb_icccm": { + "label": "XCB ICCCM >= 0.3.9", + "headers": "xcb/xcb_icccm.h", "sources": [ - { "type": "pkgConfig", - "args": "xcb xcb-shm xcb-sync xcb-xfixes xcb-xinerama xcb-randr xcb-image xcb-keysyms xcb-icccm xcb-shape" }, - "-lxcb -lxcb-shm -lxcb-sync -lxcb-xfixes -lxcb-xinerama -lxcb-randr -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-shape" - ] + { "type": "pkgConfig", "args": "xcb-icccm >= 0.3.9" }, + "-lxcb-icccm" + ], + "use": "xcb" + }, + "xcb_image": { + "label": "XCB Image >= 0.3.9", + "headers": "xcb/xcb_image.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-image >= 0.3.9" }, + "-lxcb-image" + ], + "use": "xcb_shm xcb" + }, + "xcb_keysyms": { + "label": "XCB Keysyms >= 0.3.9", + "headers": "xcb/xcb_keysyms.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-keysyms >= 0.3.9" }, + "-lxcb-keysyms" + ], + "use": "xcb" + }, + "xcb_renderutil": { + "label": "XCB Renderutil >= 0.3.9", + "headers": "xcb/xcb_renderutil.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-renderutil >= 0.3.9" }, + "-lxcb-render-util" + ], + "use": "xcb xcb_render" + }, + "xcb_randr": { + "label": "XCB RandR", + "headers": "xcb/randr.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-randr" }, + "-lxcb-randr" + ], + "use": "xcb" + }, + "xcb_shape": { + "label": "XCB Shape", + "headers": "xcb/shape.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-shape" }, + "-lxcb-shape" + ], + "use": "xcb" + }, + "xcb_shm": { + "label": "XCB SHM", + "headers": "xcb/shm.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-shm" }, + "-lxcb-shm" + ], + "use": "xcb" + }, + "xcb_sync": { + "label": "XCB Sync", + "headers": "xcb/sync.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-sync" }, + "-lxcb-sync" + ], + "use": "xcb" + }, + "xcb_xfixes": { + "label": "XCB Xfixes", + "headers": "xcb/xfixes.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-xfixes" }, + "-lxcb-xfixes" + ], + "use": "xcb" + }, + "xcb_xinerama": { + "label": "XCB Xinerama", + "headers": "xcb/xinerama.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-xinerama" }, + "-lxcb-xinerama" + ], + "use": "xcb" }, "xcb_xlib": { "label": "XCB Xlib", "test": { - "include": "X11/Xlib-xcb.h", "main": "(void) XGetXCBConnection((Display *)0);" }, + "headers": "X11/Xlib-xcb.h", "sources": [ { "type": "pkgConfig", "args": "x11-xcb" }, "-lX11-xcb" @@ -533,13 +697,13 @@ "// xkb.h is using a variable called 'explicit', which is a reserved keyword in C++", "#define explicit dont_use_cxx_explicit" ], - "include": "xcb/xkb.h", "tail": "#undef explicit", "main": [ "// This takes more arguments in xcb-xkb < 1.10.", "xcb_xkb_get_kbd_by_name_unchecked(NULL, 0, 0, 0, 0);" ] }, + "headers": "xcb/xkb.h", "sources": [ { "type": "pkgConfig", "args": "xcb-xkb >= 1.10" }, "-lxcb-xkb" @@ -548,42 +712,17 @@ }, "xcb_render": { "label": "XCB XRender", - "test": { - "include": "xcb/render.h", - "tail": [ - "// 'template' is used as a function argument name in xcb_renderutil.h", - "#define template template_param", - "// extern \"C\" is missing, too", - "extern \"C\" {", - "#include <xcb/xcb_renderutil.h>", - "}", - "#undef template" - ], - "main": [ - "int primaryScreen = 0;", - "xcb_generic_error_t *error = 0;", - "xcb_connection_t *connection = 0;", - "xcb_render_query_pict_formats_cookie_t formatsCookie =", - " xcb_render_query_pict_formats(connection);", - "xcb_render_query_pict_formats_reply_t *formatsReply =", - " xcb_render_query_pict_formats_reply(", - " connection, formatsCookie, &error);", - "xcb_render_util_find_standard_format(", - " formatsReply, XCB_PICT_STANDARD_ARGB_32);" - ] - }, + "headers": "xcb/render.h", "sources": [ - { "type": "pkgConfig", "args": "xcb-renderutil xcb-render" }, - "-lxcb-render-util -lxcb-render" + { "type": "pkgConfig", "args": "xcb-render" }, + "-lxcb-render" ], "use": "xcb" }, "xcb_glx": { "label": "XCB GLX", "test": { - "include": "xcb/glx.h", "main": [ - "int primaryScreen = 0;", "xcb_connection_t *connection = 0;", "xcb_generic_error_t *error = 0;", "xcb_glx_query_version_cookie_t xglx_query_cookie = xcb_glx_query_version(", @@ -591,6 +730,7 @@ "xcb_glx_query_version_reply(connection, xglx_query_cookie, &error);" ] }, + "headers": "xcb/glx.h", "sources": [ { "type": "pkgConfig", "args": "xcb-glx" }, "-lxcb-glx" @@ -600,7 +740,6 @@ "xcb_xinput": { "label": "XCB XInput", "test": { - "include": "xcb/xinput.h", "main": [ "xcb_connection_t *connection = 0;", "xcb_generic_error_t *error = 0;", @@ -609,6 +748,7 @@ "xcb_input_xi_query_version_reply(connection, xinput_query_cookie, &error);" ] }, + "headers": "xcb/xinput.h", "sources": [ { "type": "pkgConfig", "args": "xcb-xinput >= 1.12" }, "-lxcb-xinput" @@ -618,9 +758,9 @@ "xkbcommon": { "label": "xkbcommon >= 0.5.0", "test": { - "include": [ "xkbcommon/xkbcommon.h" ], "main": "xkb_context_new(XKB_CONTEXT_NO_FLAGS);" }, + "headers": [ "xkbcommon/xkbcommon.h" ], "sources": [ { "type": "pkgConfig", "args": "xkbcommon >= 0.5.0" } ] @@ -628,16 +768,24 @@ "xkbcommon_x11": { "label": "xkbcommon-x11", "test": { - "include": [ "xkbcommon/xkbcommon-x11.h" ], "main": "xkb_x11_get_core_keyboard_device_id(nullptr);" }, + "headers": [ "xkbcommon/xkbcommon-x11.h" ], "sources": [ { "type": "pkgConfig", "args": "xkbcommon-x11" } ] }, "xrender": { "label": "XRender for native painting", - "test": "x11/xrender", + "test": { + "tail": [ + "#if RENDER_MAJOR == 0 && RENDER_MINOR < 5", + "# error Required Xrender version 0.6 not found.", + "#endif" + ], + "main": "XRenderPictFormat *format = 0;" + }, + "headers": "X11/extensions/Xrender.h", "sources": [ "-lXrender" ], @@ -645,10 +793,6 @@ } }, - "testTypeAliases": { - "files": [ "directX" ] - }, - "tests": { "angle_d3d11_qdtd": { "label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT", @@ -661,28 +805,10 @@ ] } }, - "directwrite2": { - "label": "DirectWrite 2", - "type": "compile", - "test": { - "include": [ "dwrite_2.h", "d2d1.h" ], - "main": [ - "IUnknown *factory = 0;", - "(void)(size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2));", - "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2),", - " &factory);" - ] - }, - "use": "directwrite" - }, - "directx": { - "label": "DirectX SDK", - "type": "directX", - "files": [ - "d3dcompiler.h", - "d3d11.lib", - "fxc.exe" - ] + "fxc": { + "label": "Direct3D Shader Compiler", + "type": "fxc", + "log": "value" }, "drm_atomic": { "label": "DRM Atomic API", @@ -913,7 +1039,10 @@ "opengles32": { "label": "OpenGL ES 3.2", "type": "compile", - "test": "unix/opengles32", + "test": { + "include": "GLES3/gl32.h", + "main": "glFramebufferTexture(GL_TEXTURE_2D, GL_DEPTH_STENCIL_ATTACHMENT, 1, 0);" + }, "use": "opengl_es2" }, "qpa_default_platform": { @@ -921,6 +1050,41 @@ "type": "qpaDefaultPlatform", "log": "value" }, + "xcb_syslibs": { + "label": "XCB (extensions)", + "type": "compile", + "test": { + "include": [ + "xcb/xcb.h", + "xcb/xcb_image.h", + "xcb/xcb_keysyms.h", + "xcb/randr.h", + "xcb/render.h", + "xcb/shape.h", + "xcb/shm.h", + "xcb/sync.h", + "xcb/xfixes.h", + "xcb/xinerama.h", + "xcb/xcb_icccm.h", + "xcb/xcb_renderutil.h" + ], + "main": [ + "int primaryScreen = 0;", + "xcb_connection_t *c = xcb_connect(\"\", &primaryScreen);", + + "/* RENDER */", + "xcb_generic_error_t *error = nullptr;", + "xcb_render_query_pict_formats_cookie_t formatsCookie =", + " xcb_render_query_pict_formats(c);", + "xcb_render_query_pict_formats_reply_t *formatsReply =", + " xcb_render_query_pict_formats_reply(c, formatsCookie, &error);", + + "/* RENDERUTIL: xcb_renderutil.h include won't compile unless version >= 0.3.9 */", + "xcb_render_util_find_standard_format(nullptr, XCB_PICT_STANDARD_ARGB_32);" + ] + }, + "use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb" + }, "x11prefix": { "label": "X11 prefix", "type": "getPkgConfigVariable", @@ -940,10 +1104,11 @@ "angle": { "label": "ANGLE", "autoDetect": "features.opengles2 || features.opengl-dynamic", - "condition": "config.win32 && tests.directx", + "condition": "features.dxguid && tests.fxc && (features.direct3d9 || (config.winrt && features.direct3d11 && libs.d3dcompiler))", "output": [ "publicFeature", - { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" } + { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" }, + { "type": "varAssign", "name": "QMAKE_FXC_LOCATION", "value": "tests.fxc.value" } ] }, "angle_d3d11_qdtd": { @@ -967,19 +1132,59 @@ "directwrite": { "label": "DirectWrite", "emitIf": "config.win32", - "condition": "libs.directwrite", + "condition": "libs.dwrite", + "output": [ "privateFeature" ] + }, + "directwrite1": { + "label": "DirectWrite 1", + "emitIf": "config.win32", + "condition": "libs.dwrite_1", "output": [ "privateFeature" ] }, "directwrite2": { "label": "DirectWrite 2", "emitIf": "config.win32", - "condition": "features.directwrite && tests.directwrite2", + "condition": "features.directwrite1 && libs.dwrite_2", + "output": [ "privateFeature" ] + }, + "dxguid": { + "label": "DirectX GUID", + "condition": "config.win32 && libs.dxguid", + "output": [ "privateFeature" ] + }, + "direct3d9": { + "label": "Direct 3D 9", + "condition": "config.win32 && !config.winrt && libs.d3d9", + "output": [ "privateFeature" ] + }, + "dxgi": { + "label": "DirectX GI", + "condition": "config.win32 && libs.dxgi", + "output": [ "privateFeature" ] + }, + "dxgi1_2": { + "label": "DirectX GI 1.2", + "condition": "features.dxgi && libs.dxgi1_2", + "output": [ "privateFeature" ] + }, + "direct3d11": { + "label": "Direct 3D 11", + "condition": "features.dxgi && libs.d3d11", + "output": [ "privateFeature" ] + }, + "direct3d11_1": { + "label": "Direct 3D 11.1", + "condition": "features.direct3d11 && features.dxgi1_2 && libs.d3d11_1", "output": [ "privateFeature" ] }, "direct2d": { "label": "Direct 2D", - "section": "Platform plugins", - "condition": "config.win32 && !config.winrt && libs.direct2d", + "condition": "config.win32 && !config.winrt && features.direct3d11 && libs.d2d1", + "output": [ "privateFeature" ] + }, + "direct2d1_1": { + "label": "Direct 2D 1.1", + "condition": "features.direct2d && libs.d2d1_1", "output": [ "privateFeature" ] }, "evdev": { @@ -1318,7 +1523,7 @@ "enable": "input.xcb == 'system'", "disable": "input.xcb == 'qt'", "autoDetect": "!config.darwin", - "condition": "features.xcb && libs.xcb_syslibs", + "condition": "features.xcb && tests.xcb_syslibs", "output": [ "privateFeature" ] }, "x11-prefix": { @@ -1326,12 +1531,24 @@ "emitIf": "features.xcb", "output": [ { "type": "varAssign", "name": "QMAKE_X11_PREFIX", "value": "tests.x11prefix.value" } ] }, - "xcb-glx": { - "label": "XCB GLX", + "xcb-glx-plugin": { + "label": "GLX Plugin", "emitIf": "features.xcb", + "condition": "features.xcb-xlib && features.opengl && !features.opengles2", + "output": [ "privateFeature" ] + }, + "xcb-glx": { + "label": " XCB GLX", + "emitIf": "features.xcb && features.xcb-glx-plugin", "condition": "libs.xcb_glx", "output": [ "privateFeature" ] }, + "xcb-egl-plugin": { + "label": "EGL-X11 Plugin", + "emitIf": "features.xcb", + "condition": "features.egl_x11 && features.opengl", + "output": [ "privateFeature" ] + }, "xcb-native-painting": { "label": "Native painting (experimental)", "emitIf": "features.xcb", @@ -1344,12 +1561,6 @@ "condition": "features.xcb-native-painting", "output": [ "privateFeature" ] }, - "xcb-render": { - "label": "XCB render", - "emitIf": "features.xcb", - "condition": "!features.system-xcb || libs.xcb_render", - "output": [ "privateFeature" ] - }, "xkb": { "label": "XCB XKB", "emitIf": "features.xcb", @@ -1619,8 +1830,7 @@ or may depend on your system and XQuartz setup." "condition": "features.gui && config.linux && !config.android && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb && !features.mirclient", "message": "No QPA platform plugin enabled! This will produce a Qt that cannot run GUI applications. -The dependencies needed for xcb to build are listed in -src/plugins/platforms/xcb/README" +See \"Platform backends\" in the output of --help." }, { "type": "warning", @@ -1703,7 +1913,15 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla "integrityhid", "mtdev", "tslib", - "xkbcommon" + "xkbcommon", + { + "section": "X11 specific", + "entries": [ + "xlib", + "xcb-xlib", + "egl_x11" + ] + } ] }, { @@ -1731,10 +1949,18 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla ] }, { - "section": "X11", + "section": "XCB", "condition": "features.xcb", "entries": [ - "system-xcb", "egl_x11", "xkb", "xlib", "xcb-render", "xcb-glx", "xcb-xinput", "xcb-xlib", "xcb-native-painting" + "system-xcb", "xkb", "xcb-xinput", "xcb-native-painting", + { + "section": "GL integrations", + "entries": [ + "xcb-glx-plugin", + "xcb-glx", + "xcb-egl-plugin" + ] + } ] }, { diff --git a/src/gui/configure.pri b/src/gui/configure.pri index e21489ec28..1b95449a10 100644 --- a/src/gui/configure.pri +++ b/src/gui/configure.pri @@ -15,30 +15,40 @@ defineTest(qtConfLibrary_freetype) { return(true) } -# Check for Direct X SDK (include, lib, and direct shader compiler 'fxc'). +# Check for Direct X shader compiler 'fxc'. # Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the # DXSDK_DIR variable. Starting with Windows Kit 8, it is included in -# the Windows SDK. Checking for the header is not sufficient, since it -# is also present in MinGW. -defineTest(qtConfTest_directX) { - dxdir = $$getenv("DXSDK_DIR") - !isEmpty(dxdir) { - EXTRA_INCLUDEPATH += $$dxdir/include - equals(QT_ARCH, x86_64): \ - EXTRA_LIBDIR += $$dxdir/lib/x64 +# the Windows SDK. +defineTest(qtConfTest_fxc) { + !mingw { + fxc = $$qtConfFindInPath("fxc.exe") + } else { + equals(QMAKE_HOST.arch, x86_64): \ + fns = x64/fxc.exe else: \ - EXTRA_LIBDIR += $$dxdir/lib/x86 - EXTRA_PATH += $$dxdir/Utilities/bin/x86 + fns = x86/fxc.exe + dxdir = $$(DXSDK_DIR) + !isEmpty(dxdir) { + fxc = $$dxdir/Utilities/bin/$$fns + } else { + winkitbindir = $$(WindowsSdkVerBinPath) + !isEmpty(winkitbindir) { + fxc = $$winkitbindir/$$fns + } else { + winkitdir = $$(WindowsSdkDir) + !isEmpty(winkitdir): \ + fxc = $$winkitdir/bin/$$fns + } + } } - $$qtConfEvaluate("features.sse2") { - ky = $$size($${1}.files._KEYS_) - $${1}.files._KEYS_ += $$ky - # Not present on MinGW-32 - $${1}.files.$${ky} = "intrin.h" + !isEmpty(fxc):exists($$fxc) { + $${1}.value = $$clean_path($$fxc) + export($${1}.value) + $${1}.cache += value + export($${1}.cache) + return(true) } - - qtConfTest_files($${1}): return(true) return(false) } diff --git a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp index 50afe7c0ff..c4dd9fea18 100644 --- a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp +++ b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp @@ -102,7 +102,7 @@ } bool event(QEvent *e) { - if (e->type == QEvent::UpdateRequest) + if (e->type() == QEvent::UpdateRequest) render(); return QWindow::event(e); } diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp index b8d13ac092..b5f8d43041 100644 --- a/src/gui/image/qpixmap_win.cpp +++ b/src/gui/image/qpixmap_win.cpp @@ -422,8 +422,11 @@ static QImage imageFromWinHBITMAP_GetDiBits(HBITMAP bitmap, bool forceQuads, int if (info.bmiHeader.biHeight > 0) // Force top-down info.bmiHeader.biHeight = -info.bmiHeader.biHeight; info.bmiHeader.biCompression = BI_RGB; // Extract using no compression (can be BI_BITFIELD) - if (forceQuads) + size_t allocSize = info.bmiHeader.biSizeImage; + if (forceQuads) { info.bmiHeader.biBitCount = 32; + allocSize = info.bmiHeader.biWidth * qAbs(info.bmiHeader.biHeight) * 4; + } const QImage::Format imageFormat = imageFromWinHBITMAP_Format(info.bmiHeader, hbitmapFormat); if (imageFormat == QImage::Format_Invalid) { @@ -431,7 +434,7 @@ static QImage imageFromWinHBITMAP_GetDiBits(HBITMAP bitmap, bool forceQuads, int return QImage(); } - QScopedPointer<uchar> data(new uchar[info.bmiHeader.biSizeImage]); + QScopedArrayPointer<uchar> data(new uchar[allocSize]); if (!GetDIBits(displayDc, bitmap, 0, qAbs(info.bmiHeader.biHeight), data.data(), &info, DIB_RGB_COLORS)) { qErrnoWarning("%s: GetDIBits() failed to get data.", __FUNCTION__); return QImage(); diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 7caaf3a8fa..90b6d16551 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -997,6 +997,10 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt, { if (alpha == 0 || !clip.isValid()) return; + if (pt.x() > qreal(clip.right()) || pt.y() > qreal(clip.bottom())) + return; + if ((pt.x() + img.width()) < qreal(clip.left()) || (pt.y() + img.height()) < qreal(clip.top())) + return; Q_ASSERT(img.depth() >= 8); @@ -1063,6 +1067,10 @@ void QRasterPaintEnginePrivate::blitImage(const QPointF &pt, { if (!clip.isValid()) return; + if (pt.x() > qreal(clip.right()) || pt.y() > qreal(clip.bottom())) + return; + if ((pt.x() + img.width()) < qreal(clip.left()) || (pt.y() + img.height()) < qreal(clip.top())) + return; Q_ASSERT(img.depth() >= 8); diff --git a/src/gui/painting/qrgba64_p.h b/src/gui/painting/qrgba64_p.h index b7e4d4d905..ca879de27c 100644 --- a/src/gui/painting/qrgba64_p.h +++ b/src/gui/painting/qrgba64_p.h @@ -266,10 +266,10 @@ inline QRgba64 rgbBlend(QRgba64 d, QRgba64 s, uint rgbAlpha) const int mr = qRed(rgbAlpha); const int mg = qGreen(rgbAlpha); const int mb = qBlue(rgbAlpha); - blend.setRed (qt_div_255(s.red() * mr + d.red() * (255 - mr))); - blend.setGreen(qt_div_255(s.green() * mg + d.green() * (255 - mg))); - blend.setBlue (qt_div_255(s.blue() * mb + d.blue() * (255 - mb))); - blend.setAlpha(s.alpha()); + blend = qRgba64(qt_div_255(s.red() * mr + d.red() * (255 - mr)), + qt_div_255(s.green() * mg + d.green() * (255 - mg)), + qt_div_255(s.blue() * mb + d.blue() * (255 - mb)), + s.alpha()); #endif return blend; } diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 2a7e0eaa0c..99b04aaba6 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -335,7 +335,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP // TODO optimize this mask = mask.alphaChannel(); mask.invertPixels(); - mask = mask.convertToFormat(QImage::Format_Mono); + mask = mask.convertToFormat(QImage::Format_Mono, Qt::ThresholdDither); } int mw = qMin(mask.width(), c.w); diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp index 21f880e7be..2f25aea92b 100644 --- a/src/gui/text/qharfbuzzng.cpp +++ b/src/gui/text/qharfbuzzng.cpp @@ -689,6 +689,8 @@ _hb_qt_font_create(QFontEngine *fe) hb_font_set_scale(font, QFixed(x_ppem).value(), -QFixed(y_ppem).value()); hb_font_set_ppem(font, x_ppem, y_ppem); + hb_font_set_ptem(font, fe->fontDef.pointSize); + return font; } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 8de16038ad..bdb5592e9e 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -3192,6 +3192,16 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int QChar ellipsisChar(0x2026); + // We only want to use the ellipsis character if it is from the main + // font (not one of the fallbacks), since using a fallback font + // will affect the metrics of the text, potentially causing it to shift + // when it is being elided. + if (engine->type() == QFontEngine::Multi) { + QFontEngineMulti *multiEngine = static_cast<QFontEngineMulti *>(engine); + multiEngine->ensureEngineAt(0); + engine = multiEngine->engine(0); + } + glyph_t glyph = engine->glyphIndex(ellipsisChar.unicode()); QGlyphLayout glyphs; diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index be306ed224..f3f0caa379 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2598,6 +2598,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR Qt::IntersectClip); else x /= 2; // Centered + p->setFont(f); p->drawText(QPointF(iterator.x.toReal() + x, y.toReal()), visualTab); } @@ -2671,8 +2672,11 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR if (c.style() != Qt::NoBrush) p->setPen(c.color()); QChar visualSpace(si.analysis.flags == QScriptAnalysis::Space ? (ushort)0xb7 : (ushort)0xb0); + QFont oldFont = p->font(); + p->setFont(eng->font(si)); p->drawText(QPointF(iterator.x.toReal(), itemBaseLine.toReal()), visualSpace); p->setPen(pen); + p->setFont(oldFont); } } eng->drawDecorations(p); |