qMemEquals is the same as ucstrncmp and checking that the comparison
was 0, so implement it like that. Meanwhile, it already had code for
doing 32-bit comparisons in the absence of higher SIMD optimizations,
which we can now make use of.
Change-Id: If26b446856e3b756efabc98b471fcdc344a8e732
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The benchmarks showed that the basic SSE2-based building block
improves performance by about 50% with data extracted from a Qt
Creator run. None of the other alternatives provide clear better
results -- the best was 3.8% and with only one compiler.
Change-Id: I77314785afecfacaf21c41fd79c97cadf357f895
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Decoding from UTF-8 is easy: if the high bit is set, we fall back to
the byte-by-byte decoding. Encoding to UTF-8 requires a little bit
more work: to detect anything between 0x0080 and 0xffff, we have
several options but none as easy as above. Multiple alternatives are
in the benchmark code.
In both loops, we do two things once we run into a non-ASCII
character: first, we continue the loop for the remainder of ASCII
characters in the buffer (which we can tell by checking the bits set
in the mask), then we find the last non-ASCII character in that
16-character group, so we don't reenter the SSE code too soon.
For the UTF-8 encoding, I have chosen the alternative that results in
the best performance. It's closely tied to the alternative running the
PMIN instruction, but that requires SSE 4.1. It's not worth the
complexity. And quite counter-intuitively, the dedicated string
instruction from SSE 4.2 performs most poorly of all solutions. This
begs re-visiting the performance of the toLatin1 encoder.
The best of 10 benchmark runs of this code were measured on my
SandyBridge CPU @ 2.66 GHz (turbo @ 3.3 GHz), both as CPU cycles and
as CPU ticks:
Compared to: ICU Qt 4.7 non-SSE Qt 5.3
Data set fromUtf8 toUtf8 fromUtf8 toUtf8 fromUtf8 toUtf8
ASCII only 7.50x 6.22x 6.94x 7.60x 4.45x 4.90x
2-char UTF-8 1.17x 1.33x 1.64x 1.56x 1.01x 1.02x
3-char UTF-8 1.08x 1.18x 1.48x 1.33x 0.97x 0.92x
4-char UTF-8 1.05x 1.19x 1.20x 1.21x 0.97x 0.97x
Creator data 3.62x 2.16x 2.60x 1.25x 1.78x 1.23x
As shown by the numbers, the SSE-based code is slightly worse than the
non-SSE code for dense non-ASCII strings. However, as evident in the
Qt Creator data, most strings manipulated by applications are either
pure ASCII or mostly so, so there's a net gain.
Done-with: H. Peter Anvin <hpa@linux.intel.com>
Change-Id: Ia74fbdfdcd7b088f6cba5048c03a153c01f5dbc1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
If the image is already in the right format, converting it to RGBA8888
will be just a refcount increment; but calling bits() will then cause
an unnecessary detach.
Change-Id: I3b06139cd86b74a9082bd0b401a9a14bd4992a10
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
An API oversight caused the image upload methods to take a "void *",
which is not necessary at all. The underlying texture uploading calls
(i.e. the gl(Compressed)Tex(Sub)Image<N>D family) all take a "const void *".
The methods taking a "void *" get deprecated.
Change-Id: Idfda58d4d7d0af1f335e5cbad7d700f4ccad652c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Initialize wizStyle and other variables, silencing a purify warning
about uninitialized memory read; use std::fill to initialize the
button array.
Change-Id: I29ad90a29d406be62179fd33688f05bb5f6b7368
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Make QWindowsDirect2DPaintEngine a subclass of QPaintEngineEx instead of
QPaintEngine like the other paint engines inside Qt. This should both be
faster and better supported, as the code paths handling QPaintEngineEx in
QPainter are tested more.
Additionally the visual output is closer to the raster engine, as all
primitives are drawn using the same mechanism, resulting in fewer
off-by-one-pixel errors.
This change also makes designer work mostly correctly, apart from some
remaining clipping bugs.
Change-Id: I53d36c08e73883ff35e389d57f9d30b482fc6721
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Since we will later have frameless NSWindow child QWindows, it makes
sense to be able to keep and reuse the instantiated NSWindows in cases
like QDockWidgets. If we keep these 2 different classes, it becomes
impossible to morph one into the other.
Task-number: QTBUG-33082
Change-Id: I351c628b887101b1cfd67689afbf689f119554de
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Since we dropped all platform-related shapers during the
QPA refactoring, thus making HarfBuzz the only shaper on all
platforms, we can not deal with AAT-capable fonts anymore.
HarBuzz-NG now supports it's own shaper backend infrastructure,
so the decision was to enable HB's CoreText shaper backend on Mac
and simply make HB-NG the default shaper there.
Task-number: QTBUG-36056
Change-Id: If22e24fd5cc00c25952934332a2f4123f38135a4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Prerequisite for making the SDK version (API level) available through
QtAndroidExtras and to other modules.
Change-Id: Iffd7540c1a85f60d6b6a3e658faa69e095d87afa
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
On Embedded Linux with libudev support hotplugging was already working,
except that the mouse cursor was not shown and hidden. This is now
corrected so that the cursor disappears when all mice become disconnected
and reappears if a mouse gets plugged in later on.
[ChangeLog][QtGui] Mouse hotplugging is now fully supported in eglfs
when running on Embedded Linux systems with libudev support enabled.
Task-number: QTBUG-36374
Change-Id: Iec7c1557ba6085e3958dd357460cc032896fb174
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
The geometry is used to set the dirty region of the screen, so it must be
translated in screen coordinates.
Change-Id: Ic559a0a0d0e840cb2aa27ae1b02dcc140b29556f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Remove the native bitmap and paint directly on the surface instead.
Change-Id: Ie7010d97aa934a170c079de549903fc3391df4d9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
ANativeWindow_fromSurface already acquires the surface, no need to
call ANativeWindow_acquire.
Remove unused variables.
Change-Id: I563573072687927256aef76fab20f645f35778a2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
DLLDESTDIR is set in config.pri already, hence no need to set it twice
Change-Id: I84a5ecd0a3db41ff3920a295644e3d169deed264
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Otherwise d3dcompiler will not be installed using -prefix in configure
Change-Id: I3054969cc5d8b7c2378b12bbaef3dc4ca0194711
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
When drawing to and from the less common formats most of the cpu time
is spend in conversion. The conversion method is rather slow due to
using variable shifts and masks that the compiler does not have a chance
to optimize.
This patch changes the conversion methods to being templates fed by
constexpr methods. This allows the compiler to fully optimize the methods
yielding 2x->5x speedups.
The reliance on constexpr however means the optimized methods are only
used under C++11.
Change-Id: I2ec77c4c1c03f12ee463a694a2b59db0f0b52db1
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
This is really an implementation detail
and shouldn't be accessible in any way.
Change-Id: Icd9f2ea6f9a1d5ebd613ce65eebe2823301f87ea
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This makes the font merging possible and solves an issue
with the default font properties inheritance when used
in conjunction with QTextFormatCollection.
Change-Id: If8b543c011122dde9f086f5d696df3b042f7b90c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
introduced by b0b22e8d49 .
Change-Id: Ia57331ce9373a414f2bc56962412f20ef83bd7ca
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This adds an additional command line argument, -qdevel, for tooling
support. Since Windows Phone deployment APIs don't return the PID, this
writes the PID to a lock file that can be read by deployment tools.
Since arguments may be passed from one of several entry points, the
special argument checks are now done in Run() instead of onActivated().
Change-Id: Ib3af157ccf687769d43d60adef9a0ab480e835b7
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
This variable works like CLEAN_DEPS, but applies to the distclean target.
Change-Id: Ia30e8932b9acd6529298728dd5d0e038b0208d66
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This fixes the event dispatcher lookup on timer callbacks, which was
incorrectly using only the gui event dispatcher to look up timers.
Change-Id: Ia01a07f6505afd0adfc0641e9c60199f258138a1
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
This simplifies the code a lot and avoids silly mistakes where a
specific integer type is missing (such as char16_t).
Change-Id: Id91dfd1919e783e0a9af7bfa093ca560a01b22d1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
No need to redefine everywhere, since they're required to be supported.
Change-Id: I2bdbbd0b0c44871e3bd0edcf0289fc58dd50ff31
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This is already implemented in qatomic_x86.h, qatomic_ia64.h,
qatomic_mips.h, qatomic_armv6.h, and qatomic_cxx11.h. For
qatomic_msvc.h, we've just fixed it.
For qatomic_gcc.h, we know that the compiler supports it, so just add
it. According to the GCC manual, it might print a warning on some
platforms, so we only enable that on 64-bit builds.
For qatomic_unix.h, the support was missing (along with support for
unsigned 32-bit), so this commits adds it.
For qatomic_armv5.h, the platform does not always support 64-bit
atomics, but ARMv5 cannot compile in 64-bit mode anyway.
Change-Id: Ia8b3b5c641f11e5df05937fe7442be0a223174ef
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QAtomicInteger<T> is to QBasicAtomicInteger<T> what QAtomicInt was to
QBasicAtomicInt: just a little more syntactic sugar. The Basic classes
do not always have a constructor, since they depend on compiler
support. The constructor is always present in the non-Basic class, at
the expense of making it non-POD for C++98 code.
This commit also repurposes most of QAtomicInt's documentation for
QAtomicInteger. It adds only the Q_ATOMIC_INTnn_IS_SUPPORTED macro
that explains whether the given type is supported on this platform.
Change-Id: I58886d6fa49fea4de24015c40dae29c9fa534e00
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
MSVC provides the necessary functions / intrinsics for 16- and 64-bit
operations. It has some support for 8-bit too, but the most important
functions seem to be missing...
Change-Id: I177b4eb2a2cf14d716b78c94f9d6a9b11aea1b84
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
In almost all platforms, sizeof(qregisterint) == sizeof(void*) ==
sizeof(qptrdiff). It's different for architectures that have a pointer
with a size different from the machine word. This allows us to declare
variables of the most optimal size, even if the pointers are too wide or
too narrow.
The only currently-known architectures to match that case are the ILP32
builds on x86-64 (a.k.a "x32") and IA-64 (option -milp32, only available
on HP-UXi), which have 64-bit registers but 32-bit pointers.
Change-Id: I0f126b70ea9ea326bd3143797287e4b98210d36d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
We're using AAssetDir_getNextFileName() to verify that the
directory exists and has content, and this moves the
current file pointer to the second file in the dir, so
we need to reset the pointer before iterating to populate
the entry list.
[ChangeLog][Android] Fixed QDir::entryList() for assets
scheme to no longer skip the first file in the directory.
Task-number: QTBUG-36528
Change-Id: I9938c669658330b0e11d6fbe3df8c6566fd79f5f
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Xcode project templates will by default create source files that
ends with .m (obj-c). If you try to include Qt from such files, you
will get a bunch of compile errors, since the compiler will not
understand C++ concepts, such as namespaces.
To ease mixing native iOS and OS X apps with Qt, we print a warning
to the console, so that the error messages are easier to understand
and fix, by renaming the offending file to .mm.
Change-Id: I192f460f9ca53145b7193dec1cfe7c095ae149a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Might be useful to expose to QWindow in 5.3, but for now it's private
so it can be used by platform plugins.
Change-Id: Iad96d7e249a7b85695668f8d7e8918164ec67442
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
px16 and py16 might be <0 in the first iteration of the loop. In order
to avoid accessing an invalid index the values have to be corrected
before px and py are accessed.
Change-Id: I790faeacc2b77ae8af52bf5e69a2d801c9fe973d
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Re-use a private helper API from QWindowsFontDatabase.
This also helped in consolidating the behavior between these two.
Change-Id: I93ba0a486a2c11fdefd328af090497dde5b0fbdb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
A convenient way to obtain the block format ranges that should be
applied to the block text.
Change-Id: I220429b7c9c592c4880357c0d7b1b21f6c1c11f3
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
In UTF-16, SMP code point is encoded with a pair of surrogates,
thus making SMP code point twice wider than BMP code point.
Change-Id: Ifb0e78cff50cca7231d07097a730188bd98c54cb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>