Commit Graph

17546 Commits

Author SHA1 Message Date
Jerome Pasion
93d35c07d0 Doc: Updated CSS used by the offline documentation.
-new layout for landing page
-updates to title sizes and changes to footer
-fixes to general paragraph issues

-index.qdoc changed in qtdoc repository

Task-number: QTBUG-36411
Change-Id: Icb4fb0374e474137686f4cb67c64dc0249fef2c4
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-02-20 11:06:40 +01:00
Jerome Pasion
e99c374944 Doc: Removed Contents listing for Qt Examples and Tutorials page.
-Qt Examples and Tutorials page does not need the table of contents.

Task-number: QTBUG-36838
Change-Id: Id51ebc7cba7831a24cd9d8e8e6bde7f96bece326
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2014-02-20 11:06:14 +01:00
Shawn Rutledge
37b8bb5473 QFileDialog: restore state from QSettings after creating widgets
After 37ca2224ec it's necessary to
read the saved QSettings again after creating widgets, in order to
deal with the settings which only affect widgets (such as saved
bookmarks).  It's also necessary to read them if widgets are not used
though, because some of the settings affect native dialog options.

Task-number: QTBUG-36888
Change-Id: I8cf53db864b173c50a876a1d5ce29c1e073fcaa6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-20 08:24:34 +01:00
Andy Shaw
9babaac16d Only do a repolish() of the widget if it was already polished
By ensuring that the widget is already polished before doing a repolish it
means that if you reset the stylesheet then it unsets any changes that
the stylesheet had applied to the widget.

Task-number: QTBUG-18958

Change-Id: Ie0aeda0dac9f2211b7feca138c115cf2b48aac80
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-20 08:14:04 +01:00
Andy Shaw
72fbcc8bbf Ensure we switch back to the real paint engine when not emulating
When the emulation paint engine was no longer needed then it would still
end up using it because the flags would prevent it from being switched
back. This ensures that it has the right engine when something triggers
it to be switched.

Change-Id: I7571923d16cbebd9fdd34560631b561c07a724f7
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-20 08:13:57 +01:00
Sergio Ahumada
170df5addb Remove qSort usages from gui tests
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: Idf0fc471f8ab7b30a097d8faf93c93d5ebbb03ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-20 08:10:19 +01:00
Sergio Ahumada
a01b7dad50 Remove qSort usages from tests
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I4c48db80533802e37771d3967fa10bfb7000cb9a
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-20 08:10:06 +01:00
Sergio Ahumada
ac127a8c09 Blackberry: Fix QFileSystemEngine::tempPath()
Fall back to /var/tmp instead of /tmp if neither TMPDIR nor TEMP are set.

/tmp is not a true filesystem on BB10 but rather a symbolic link to /dev/shmem

For more info see
http://www.qnx.com/developers/docs/6.3.0SP3/neutrino/user_guide/fsystems.html#RAM

Change-Id: Ie690ed74ffd81b52ef4623458c3ff88629aee00a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-20 08:09:49 +01:00
Giuseppe D'Angelo
121e712935 QHash: use prime numbers when rebucketing
QHash uses an array representing the difference between 2^i and
the next prime; when growing, it calculates 2^x + array[x] (with
`x' representing the "hash table size in bits").

For some reason lost in history the differences are actually wrong
and the calculation above leads to using composite numbers.

Hence: use the right sequence and always produce primes. The right
sequence is actually A092131 from OEIS: http://oeis.org/A092131

Note that the sequence starts at A(1), but we need A(0) too.
Also we truncate the sequence to when growing too much, just like
the old code did, and use powers of two in that case instead.

Task-number: QTBUG-36866
Change-Id: Id2e3fc9cb567c0fdca305dee38f480e17639ca04
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-02-19 23:53:01 +01:00
Peter Hartmann
1de244ea65 network: add support for the SPDY protocol
Currently the only supported SPDY version is 3.0.

The feature needs to be enabled explicitly via
QNetworkRequest::SpdyAllowedAttribute. Whether SPDY actually was used
can be determined via QNetworkRequest::SpdyWasUsedAttribute from a
QNetworkReply once it has been started (i.e. after the encrypted()
signal has been received). Whether SPDY can be used will be
determined during the SSL handshake through the TLS NPN extension
(see separate commit).

The following things from SPDY have not been enabled currently:
* server push is not implemented, it has never been seen in the wild;
  in that case we just reject a stream pushed by the server, which is
  legit.
* settings are not persisted across SPDY sessions. In practice this
  means that the server sends a small message upon session start
  telling us e.g. the number of concurrent connections.
* SSL client certificates are not supported.

Task-number: QTBUG-18714

[ChangeLog][QtNetwork] Added support for the SPDY protocol (version
3.0).

Change-Id: I81bbe0495c24ed84e9cf8af3a9dbd63ca1e93d0d
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-02-19 21:44:15 +01:00
Samuel Gaist
42789d04a3 Use QMAKE_TARGET_BUNDLE_PREFIX to build bundle identifier
Currently the bundle identifier is build using com.yourcompany +
QMAKE_BUNDLE. This patch adds the handling of
QMAKE_TARGET_BUNDLE_PREFIX to build the bundle prefix.

Task-number: QTBUG-19006

Change-Id: I014279da6dbef393b0df36f6d4995e40ab105316
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-02-19 21:44:15 +01:00
Tor Arne Vestbø
d0784ae43b Prevent top/left clipping of anti-aliased glyphs in CoreText font engine
Padding the bounding rect was not enough, as we failed to shift the glyph
accordingly so that it would end up in the center of the bounding rect.

We also didn't take subpixel-positioning into account, which may shift the
position of the glyph too far to the right to be within the image size that
we reserve.

There are still cases where the glyphs seem clipped compared to the same
text rendered with CoreText, but that's because we end up shaping the
text slightly differently, resulting in different subpixel positions
than what CoreText chooses.

Change-Id: Icb88c829f86457b16bdecbc4c24b3f1c23448261
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-19 19:36:34 +01:00
Tor Arne Vestbø
e380a48af7 Unify alpha map padding in CoreText font engine
Instead of padding the image size manually, we rely on alphaMapBoundingBox
to give use the right glyph metrics.

For clarity, a few function arguments were renamed in the affected code.

Change-Id: I84c31e613a1048ea839a390af70342e5388ed0cb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-19 19:36:29 +01:00
Tor Arne Vestbø
4de3c5db23 Unify glyph format between QFontEngine and QFontEngineGlyphCache
Instead of the glyph cache having its own cache type that always mapped
one to one to a font engine glyph format, causing confusion and needless
conversions, the glyph caches now use QFontEngine's glyph format enum.

This also removes the iffy use of an int for the glyphFormat in the font
engines.

Change-Id: I529bad5c179e004f63e152f7dcc311d298c3db98
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-19 19:36:25 +01:00
Oswald Buddenhagen
30fd22b957 Merge remote-tracking branch 'origin/dev' into stable
Change-Id: Ice524edcc51373509f0023ae7f7c2963f4602f88
2014-02-19 10:06:25 +01:00
Nikolai Kosjar
08cbbde617 QtConcurrent: Extend workaround GCC bug 58800 in median calculation
GNU/Linux distributions like Fedora update the __GLIBCXX__ date (e.g.
because of applied extra patches on top) and thus make the current
workaround useless. As long as no official gcc/libstdc++ version is
released, we can increment the "upper bound" date to cover such cases.

See also comment #1 at QTCREATORBUG-11129.

Change-Id: I1fdf6f312664163f6a99a8eddf490646ff25a87d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-02-19 06:45:00 +01:00
Eskil Abrahamsen Blomfeldt
3a84d92f57 Make unicode ranges in font take precedence over codepage
Change 4b2c73b476 triggered a
regression on Android, because the DroidSansFallback.ttf font
has codepage ranges that list Arabic as a supported codepage
despite the fact that the font has no glyphs for Arabic.

If a font has valid unicode ranges which does not specify
support for e.g. Arabic, then the code page ranges for the
same script should be ignored.

[ChangeLog][Android][Fonts] Fixed support for Arabic text.

Task-number: QTBUG-36789
Change-Id: I7c5a0e303fd9ed2733275814fe752ae0fb54a207
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-02-19 06:42:17 +01:00
Thiago Macieira
d7b0581c1c Make sure that the compiler is strict in QtCore
ICC defaults to "fast math" mode, which allows it to do non-compliant
operations that may or may not result in unexpected values. Generally, it's
ok, but apparently the code in qlocale_tools.cpp is too complex, so we're not
taking chances.

I can't rule out an issue in the code, though.

Task-number: QTBUG-36795
Change-Id: Ica5cb77fb3a65d22ae8ad22e13b4ba78f1b5dadf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-18 17:18:42 +01:00
Frederik Gladhorn
6aa09bbce5 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/plugins/platforms/android/qandroidplatformtheme.h

Change-Id: I541bd3069df3ab54c7942d5f4a9e155e3b6566a0
2014-02-18 14:19:36 +01:00
Eike Ziller
0702418c81 Mac: Fix file dialog filters when filter doesn't start with '*'
Task-number: QTBUG-17326

Change-Id: I3e6ed40fdb0e04367bb031b2c674424a4b74af2f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-02-18 11:59:55 +01:00
Sergio Ahumada
8102b75ee8 Remove qSort usages from widgets tests
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: Ica7639d16f52b4ffcd2c00cc806fed1378a7948b
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-02-18 11:59:55 +01:00
hjk
21fbca97a8 Fix typo in model/view docs.
Task-number: QTWEBSITE-560

Change-Id: I2b7a6f28ac41bacbfd2603feb8b786c31d3769e3
Reviewed-by: Tero Kojo <tero.kojo@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2014-02-18 10:10:09 +01:00
Thorbjørn Martsum
f4044e853c QHeaderView - do simple section move/rotate in moveSection
It is in nearly all cases much faster (in our benchmark it is
about a factor 8) - and it also makes the code more readable.

Change-Id: I075e1d1a96756e5e9a2bf53b5479094f7d87883d
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-02-18 09:54:59 +01:00
Sarunas Valaskevicius
13040043b2 Emit updateBlock signal in QTextDocumentLayout
updateBlock is part of the interface of QAbstractTextDocumentLayout
however QTextDocumentLayout implementation is not invoking it.

This commit adds similar behavior to QTextDocumentLayout as the
QPlainTextDocumentLayout (QtWidgets) has by implementing the missing
functionality.

[ChangeLog][QtGui][QTextDocumentLayout]
Emit updateBlock signal in QTextDocumentLayout.

Task-number: QTBUG-36743
Change-Id: I7f812d4d5d7c2148393ee672fb0db6c0b2e73783
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2014-02-18 00:28:16 +01:00
Leena Miettinen
d5b0f1763f Doc: add CLI options for QGuiApplication
Task-number: QTBUG-36579

Change-Id: Ib9376ecfe98f8d5e26c4f9be783a022faa9d3046
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-17 22:20:12 +01:00
Jani Heikkinen
072f9cf888 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-02-17 20:43:28 +01:00
Sergio Ahumada
817c4be91f Remove qSort usages from network tests
QtAlgorithms is getting deprecated,
see http://www.mail-archive.com/development@qt-project.org/msg01603.html

Change-Id: I31a701d8e17673edcb9bb7c32e6e6a87812a7fbc
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-02-17 19:31:01 +01:00
Alessandro Portale
ce46593e25 Android: Build fix for "-no-widgets"
This fixes compilation of Qt for Android when configured with
"-no-widgets". One good use-case for that configure switch is
that QtSvg loses the dependency to QtWidgets.

Change-Id: I8a645d9fee6ce0467ff0b5d1d62531b7c6272aab
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-02-17 18:46:15 +01:00
Thiago Macieira
83b1eaad44 Make a URL with absent authority be different from one with an empty one
This partially reverts 5764f5e6ea and
fixes the problem differently.

After this commit, "file:///foo" is still equal to "file:/foo", but
"foo:///foo" becomes different from "foo:/foo", as it should be.

Task-number: QTBUG-36151
Change-Id: Ia38638b0f30a7dcf110aa89aa427254c007fc107
Reviewed-by: David Faure <david.faure@kdab.com>
2014-02-17 18:13:42 +01:00
Allan Sandfeld Jensen
2e20d82de4 Optimize generic bilinear interpolation using SSE2
The drawing code currently only optimizes the bilinear interpolation
under specific conditions that allows the optimizations used there.

The patch adds a SSE2 version of the fallback 4 pixel interpolation.

Change-Id: I4e8a2ba6cb44647105a9b24e38b3ab755a435050
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-02-17 16:48:54 +01:00
Martin Gräßlin
824f080468 Allow QPlatformSystemTrayIcon to create the QPlatformMenu
In case the QPlatformTheme does not provide a QPlatformMenu the
QPlatformSystemTrayIcon is not able to forward the menu because the
QPlatformMenu pointer passed to updateMenu is always null. Providing a
QPlatformMenu in the QPlatformTheme implementation should not be a
requirement for having the menu in the system tray icon. There are
cases where no QPlatformMenu should be created by the theme, e.g. if
the X11 implementation of QSystemTrayIcon gets provided by the xcb
plugin.

The change adds a virtual method to QPlatformSystemTrayIcon to create
a QPlatformMenu. This method is called from the QPA implementation of
QSystemTrayIcon if the QMenu's platformMenu is not present. Thus the
system tray icon is able to provide a custom implementation of the
menu. This gets installed through a new internal method in QMenu to set
the platform menu. It creates the required connections and sync the
state to the QMenu to the newly created QPlatformMenu.

Last but not least QPlatformMenu is extended by a method to create a
QPlatformMenuItem. The default implementation delegates to the platform
theme. This allows to provide the menu item implementation for the
system tray icon without providing the QPlatformMenuItem through the
platform theme.

Change-Id: I17234bd8bcf8c05f8bd786feff0cf8f860430e82
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-02-17 16:47:05 +01:00
Tor Arne Vestbø
6aef733a7a Fix glyph cache type logic after 97c187da3c
The setting of the default format of Raster_A8 was mistakenly
moved down to below the override of Raster_RGBMask.

Change-Id: I52ee19180471c6f5c8d6824ee35f8d39632c9d94
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-02-17 16:44:39 +01:00
Konstantin Ritt
8e57ad1a27 Respect the QTextBlock's character formats in itemization
This fixes regression introduced in f864bdaf59
(in resolveAdditionalFormats(), formatIndex(si) returned an invalid
block format index due to non-empty specialData->resolvedFormats)

Task-number: QTBUG-36759

Change-Id: I4da13d2edaf1987bcd85b2ef326e9d22345eb8f3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-17 16:43:58 +01:00
Giuseppe D'Angelo
ba56beaea4 Docs: properly tag QtAlgorithms functions as deprecated
Turns out that \obsolete means "Qt3Support", while the correct tag
is \deprecated.

Change-Id: Id9896893f3078a0d516bd8751bce0b2df441509d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-02-17 15:37:42 +01:00
Frederik Gladhorn
dbafabb019 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/global/qglobal.h

Change-Id: I03d8b6e07135056baaa1d97c3c63fbe8b25583d9
2014-02-17 11:39:16 +01:00
Shawn Rutledge
70f4bf1a48 QPlatformDialogHelper: change ButtonRole flags to ensure 32-bit size
0x80000000 is too big for a signed 32-bit int, so the compiler ends
up choosing a 64-bit number.  Then it will not be the same size as
the parallel enum QDialogButtonBox::ButtonRole, which does not have
these extra flags.  By making EOL be the same as InvalidRole and
changing Reverse to 0x40000000, we don't need to use 0x80000000 at
all, so again the compiler can choose a 32-bit representation
for both if appropriate.  EOL is used as a terminator in the
static const int buttonRoleLayouts table and therefore as a terminator
in arrays returned from QPlatformDialogHelper::buttonLayout().
It's internal API so it's OK to change in a minor release, but
QtQuick.Dialogs is also looking for the EOL now, so we should avoid
changing it again if possible.  This is mainly for efficiency and
for avoiding surprise data type conversions when casting from one
enum to the other.

Change-Id: Ia7b7ce43c8f929d09dd999769e9b7114f695e9a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-02-17 11:24:40 +01:00
Frederik Gladhorn
8958611fa7 doc: fix grammar
Change-Id: Ic2e5fd40e3d3bd7b42d5fd6492286770ffe244f3
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-02-17 11:17:03 +01:00
Sergio Ahumada
f5f00e69a0 tst_qfont: Fix small typo
Change-Id: I7e007202b0cc80a1808831ebcf46ae7ec0866828
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-02-17 10:40:33 +01:00
Fabian Bumberger
00b96399e6 [QNX] Don't deactivate windows focus
When the focus changes, screen sends a focus deactivated change for the focus window.
Depending on the order, this might deactivate the window focus completely. This
for example leads to problems with QComboBox.

Change-Id: Ia57f061a765c1f971d86d941b17f573ce9221ae1
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2014-02-16 20:21:59 +01:00
Fabian Bumberger
0827f0bd66 Refactor the handling of the navigator swipe down event
The navigator swipe down event is not mapped to a platform panel event any more.
Instead the NavigatorEventHandler is exposed through the QPlatformNativeInterface.

Change-Id: I6d29bba011849da5210f6f4d595e3c2e0c021449
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2014-02-16 20:21:43 +01:00
Richard J. Moore
ddbbf2b4a7 Increase the number of concurrent DNS lookups.
Modern websites use around 15 hosts on average so the limit of 5 DNS
looks meant that most non-trivial sites have to wait for at least one
unneeded round trip.

Task-number: QTBUG-30866
Change-Id: I584dd46c247e0413b2ed88dd66f111cff08ff987
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-16 19:14:59 +01:00
Lars Knoll
6de515aea2 Remove a not required whitespace when writing JSON in compact format
Task-number: QTBUG-36682

Change-Id: I0c1c0de850504c8dff20a5ae724cc868d9f983f8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-16 16:56:10 +01:00
hjk
9de2853a94 Remove automated generation of dwarf index
The index is only helpful if the version of GDB to
create it uses the same version as the GDB version
that consumes it. Outside the "local development"
scenario this happens only by conincidence, still
we add ~3.6% to the debug library size and face
maintenance issues like QTBUG-34950.

We also don't see the same performance benefit anymore
with recent versions as we did when the feature was
added, so it's best to not create the index anymore.

People who need it, still can add it manually, or
by the 'gdb-add-index' tool that comes with recent
versions of GDB, or trust their distributors to
set up indexes matching their runtime environment.

Task-number: QTBUG-34950
Change-Id: Id4c79fa51fea9622b0891bd9b9b395b948ecb157
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-02-16 15:41:30 +01:00
Mandeep Sandhu
62f01d581b QDnsLookup: Add support for custom DNS server
Implemented the use of the new QDnsLookup property "nameserver".

On the Linux platform, we can specify both IPv4 and IPv6 addresses
for the nameserver.

On Windows since we are using DnsQuery_W(), which does not have a
way of accepting IPv6 addresses, passing IPv6 nameserver address
is not supported.

On OSX/BSD platforms, specifying IPv6 addresses for nameserver
require access to the __res_state_ext structure which is in a
private header of libresolv (this header is different for BSDs and
OSX). If this feature has to be enabled in the future, we have to
figure out a way to access this struct by either accessing the
private header or by specifying one of our own. Currently, I'm
disabling it till such a solution is arrived at.

Nameserver support on different platforms:

  Platform   |      IPv4     |     IPv6
-------------+---------------+---------------
  Linux/X11  |   supported   |  supported
-------------+---------------+---------------
  Windows    |   supported   |  not supported
-------------+---------------+---------------
  OSX        |   supported   |  not supported
-------------+---------------+---------------
  WinRT      | not supported |  not supported
-------------+---------------+---------------
  Others     |   supported   |  not supported
             |  (not tested) |
-------------+---------------+---------------

Task-number: QTBUG-30166
Change-Id: Iedbddf15b9a62738ce4c2cfa0fce051514d64766
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-16 11:46:20 +01:00
Jørgen Lind
44ee7984fc QOpenGLTextureBlitter: fix source rect when origin is top left
This fixes the issue that the blitter required sometimes the
texture wrapping to be repeat

Change-Id: I86150d008422facf9040873b0983b0e44be9ad24
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-16 11:06:40 +01:00
Jørgen Lind
937a4f5443 QOpenGLTextureBlitter: Remove Origin location for the Target rect
The Origin for Target rect was deemed a confusing concept. The current
implementation would translate the target rect to the coordinate system
specified. However, the order and "direction" of the vertices would
always be the same. So drawing a texture in for one target rect defined in
one coordinate system would paint the texture the same way as it would
when a texture was drawn for a target rect drawn in the "opposite"
coordinate system. The point with this was that if you wanted to "flip"
the texture you would specify that with the source coordinate system.

However, this approach breaks on different levels, such as QRect has functions
which expects a top left coordinate system (ie. top() and bottom()).

In the end Qt uses a top left coordinate system, hence QWindow specifies
a top left coordinate system, and hence the api becomes easier if it is
not possible to define the coordinate system of the target viewport.

Change-Id: I7dd59b3718380876e87a4bff88381d7a1c7d58c1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-16 11:06:19 +01:00
Jørgen Lind
6fbef080a0 QOpenGLTextureBlitter: add some autotests
Change-Id: I07a4847a19908c1a6d7fb02649b306dfa0148f49
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-02-16 11:06:00 +01:00
Thiago Macieira
579526cfec Make the printing of complex Unicode in a QString prettier
This also has the advantage of not requiring the use of the locale
codec. Quite an advantage if you're debugging the locale codec. But it's
mostly so that we don't get question marks that hide the difference we
were trying to locate.

[ChangeLog][QtTest] QtTest now prints an escaped version of QStrings
that failed to compare with QCOMPARE. That is, instead of converting
non-printable characters to question marks, QtTest will print the
Unicode representation of the character in question.

Change-Id: I44c1ef3246b188c913dacd3ca4df02581356ea41
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-02-16 06:54:18 +01:00
Thiago Macieira
19c7098251 Add the rest of the non-volatile members of std::atomic to QBasicAtomic
[ChangeLog][QtCore][Atomic support]Added more operations to the atomic
classes, including operator T(), operator=(T), operator++,
operator--. For the QAtomicInteger, bit-manipulation operations are
also provided, both in operator and in fetchAndXxxYyyyyy modes.

Change-Id: I39c07be74e15e0a48f9e931f4342b182004dee1a
Reviewed-by: David Faure <david.faure@kdab.com>
2014-02-16 05:12:47 +01:00
Thiago Macieira
634f82f1f1 Add a testAndSet overload to the atomics that returns the current value
This is extremely useful, since the most common action after a failed
compare-and-swap is to loop around, trying again with the current
value as found in memory.

Code currently written as:
    do {
        Type value = atomic.load();
        ...
    } while (!atomic.testAndSetRelaxed(value, desired));

Becomes:
    Type value = atomic.load();
    do {
        ...
    } while (!atomic.testAndSetRelaxed(value, desired, value));

In most CPU architectures, the value that was found in memory is known
to the compare-and-swap code, so this is more efficient than the
previous code. In architectures where the value is not known, the new
code is no worse than before.

The implementation sometimes modified an existing function, sometimes
it added a new one, depending on whether more registers were needed in
the assembly (like ARMv6-7), the code became more complex (ARMv5), the
optimizer failed (C++11), or it was just plain equivalent (MIPS).

Change-Id: I7d6d200ea9746ec8978a0c1e1969dbc3580b9285
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-16 05:12:26 +01:00