QImage::invertPixels may produce invalid data after inversions of
images with premultiplied alpha, because the inverted colors will be
larger than the alpha.
This patch converts any image with a premultiplied alpha channel to
ARGB32 before inverting the pixels, and then back to the original
format after the inversion.
Support is added for correct inversion of RGBA8888 and RGB30 formats.
Task-number: QTBUG-39901
Change-Id: Ief24c55f495e67ef2ad6429b5b418d02963a64dd
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Use sizes relative to the test window size; move windows relative
to the top left point of the available screen geometry.
The test now passes on Windows using a 4K monitor.
Task-number: QTBUG-38858
Change-Id: Ia8d992f2a9bfa1cb1deacaf918ed0cfff7616959
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This patch adds support for binding RGB30 images as textures, and as
internal format of framebuffer objects. Together with the
QOpenGLPaintDevice
this provides support for rendering to and from RGB30 in full precision.
[ChangeLog][QtGui][QOpenGLFramebufferObject] Support 10-bit per color
channels formats as the internal framebuffer format, making it possible
to render in that precision.
Change-Id: I06de2d12dfe1c1adc466d574fdffbc77f88f4f16
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This function has been inlined in commit 4f50be8d,
but wasn't removed.
Change-Id: I1a4eb7399ab2dd87a9fb15c4c886004d777487a8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Several tests require test data to be deployed with the
application. The easiest way to achieve this on Android
is to add them to a qrc file and use the QFINDTESTDATA macro
to look up the files. This fixes several test failures
in the gui/text subdirectory for Android.
Change-Id: If944bb1fc93434a1b2d6487da829d21bd6b84e87
Reviewed-by: BogDan Vatra <bogdan@kde.org>
I've also updated the qfont test so it passes on Android now. Note that
there are no suitable cursive/fantasy fonts on Android, so the regular
default "Roboto" (or "Droid Sans" on older devices) will be picked here
instead.
[ChangeLog][Android] Fixed font selection to prefer "Droid Serif" when
Serif style hint is set on QFont.
Change-Id: I294eebcc4d79410e435bdddce552acc6044753b2
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Remove old message handler hack as we have a new and better api to
ignore warning messages.
Change-Id: Id967b2672fe3e3638db9977500118a19c2afb730
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
When the platform plugin gives us specific fallbacks for a
specific script, we need to respect this, and load the correct
font family regardless of which writing systems it supports.
This is especially important since the common script is adapted
to match surrounding, proper scripts, so characters such as
digits next to e.g. Hebrew text will be marked as Hebrew. On
stock Android, there is a single Hebrew font, and this would
previously be put in all fallback slots for Hebrew regardless of
what fallback fonts were dictated by the platform plugin. Since
this font does not support the digits, they would show up as boxes.
[ChangeLog][Android] Fixed common characters like digits and
punctuation showing as boxes when positioned next to non-latin
scripts.
Task-number: QTBUG-39377
Change-Id: I1555e208a8ddc587c0bbdbfff1600cafdd9442e9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
At some point since Qt 4.8, the nbsp character has acquired
the whitespace attribute, causing it to be treated exactly
like an ordinary space. To account for this, we add an extra
check in the layout code to avoid breaking on non-breaking
spaces even if they have the whiteSpace flag set.
This is a temporary fix for the regression. The line breaking
algorithm needs to be refactored and support Unicode tr14
properly, which it currently doesn't.
[ChangeLog][Text] Fixed lines breaking on non-breaking spaces.
Task-number: QTBUG-39832
Change-Id: Ibd7e1a11ce4b82c611ecda1542c8638a67bf3cae
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This is trickier than the GLX and EGL implementations due to the
way pixel formats, windows and contexts work. Apart from some
restrictions, it should be fully functional nonetheless.
Add also some proper documentation.
Change-Id: Ia6e3eb1ab2701e439b8621b9092c2b0934ff2151
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Currently QOpenGLTextureCache::bindTexture always convert any uploaded
image to RGBA8888 before uploading. This is quite inefficient when
OpenGL natively supports uploading formats in the original format.
This patch adds support for uploading a few native QImage formats. This
also get the performance of QOpenGLTextureCache::bindTexture on par with
QGLContext::bindTexture.
The texture brush used by QOpenGLPaintEngine is also converted to QImage,
since bindTexture will convert it to QImage anyway, and going over QPixmap
may cause an unnecessary conversion.
[ChangeLog][QtGui][QOpenGLTextureCache] Support uploading common QImage
formats directly to OpenGL when supported.
Change-Id: I828a763126441a98e4547c32ef52dddf7c129a32
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Adds basic support for 10-bit per color channel formats to QImage
and the XCB plugin. This will make it possible to paint to and from
these formats, but only at 8-bit per color channel accuracy.
This also fixes Qt5 applications on X11 with native 30bit depth.
[ChangeLog][QtGui][QImage] Added support for 10-bit per color channel image formats.
Task-number: QTBUG-25998
Change-Id: I93ccd3c74bfbb0bd94b352476e5fe58a94119e1f
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Support CF_DIBV5 for these images so that transparency is preserved.
Task-number: QTBUG-11463
Change-Id: I51881ae8bfbd05b92abd309766f4da9a7ea26c2d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
There is no guarantee that the OES extension is present and the standard
functions are not required to be dynamically resolvable on ES.
By performing the ARB-style lookup for the suffixless function names we
can also support ES3 compatible contexts on desktop GL.
This also fixes the problem of picking up the APPLE extension functions
instead of ARB when both are available. vaoFuncsType was set to ARB correctly
but the helper has to take the preference of ARB into account too.
Task-number: QTBUG-38168
Change-Id: If7402320e8f96891017674f3c43bc57c4b5d29f3
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
This allows QQuickSystemPalette to listen to palette changes without
installing an expensive event filter on the application object.
Change-Id: I8b693e047d993c444e393d7a714a5709692c3560
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Conflicts:
mkspecs/qnx-x86-qcc/qplatformdefs.h
src/corelib/global/qglobal.h
src/network/socket/qnativesocketengine_winrt.cpp
src/plugins/platforms/android/androidjniaccessibility.cpp
src/plugins/platforms/windows/qwindowswindow.cpp
Manually adjusted:
mkspecs/qnx-armle-v7-qcc/qplatformdefs.h
to include 9ce697f2d5
Thanks goes to Sergio for the qnx mkspecs adjustments.
Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
Use SetWindowPlacement() to set the normal position when applicable
as is done in Qt 4.
Task-number: QTBUG-39544
Change-Id: Ia158b968ea15361d9937619f07b56eb8a0312a13
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
This allows QQuickApplication to listen to layout direction changes
without installing an expensive event filter on the application object.
Change-Id: I2d7d8906acecbc092657c4bd918bbdc9aad9744c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
The local files in availableSizes() were not resolved.
Introduce member variables for the file names, resolve them
in the constructor and add initTestCase() to verify.
Task-number: QTBUG-39287
Change-Id: If841e904700fe76b6c9265124ccba7764911fdc9
Reviewed-by: aavit <eirik.aavitsland@digia.com>
QImage::fill(uint) was incorrectly performing ARGB->RGBA conversion when
called on RGBA8888 formated images.
This patch moves the color conversion to QImage::fill(QColor) where it
belongs so that fill(uint) can behave consistent with documentation and
how it treats other formats.
The fill(uint) method had no automated tests, and this patch adds one.
[ChangeLog][QtGui][QImage] QImage::fill(uint) now fills the given pixel
value unconverted when used on RGBA8888 image, making it consistent with
the documentation and treatment of all other image formats.
Change-Id: I00a9d810c61d350dbdd7c4b9ad09e5ce11896b6d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
This simple patch was an unfortunate victim of the Gitorious to
Gerrit transition. (https://qt.gitorious.org/qt/qt/merge_requests/1179)
As noted in the Gitorious review, a small bug in readHeader is also fixed: ||
instead of &&.
Done-with: Pali Rohár
Task-number: QTBUG-12684
Change-Id: I1fe16359b9b68c10e518904c6a5c58b00fb7379b
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
The sanity check added in d16508a285
didn't actually catch the case where the invalid data is large
enough to contain the offset table and table directory. Added sanity
checks to all the code that accesses the font data now, so this
should fix crashes with partial data as well as invalid data.
Task-number: QTBUG-37190
Change-Id: Ie43f10d8cf0b09007783b9b1c4d91bfed8c6b0f0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
beginModalSessionForWindow will center the window and ignore
the set geometry. So to workaround this it checks the new value
against the old one and moves it back if need be.
Change-Id: I38bc74c04138992f2e0570fca666414025aeeba8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
It had no effect because of an explicit check for NoBrush.
However the default in QBitmap is (unfortunately) QBrush(color0), rather
than NoBrush, so the brush must be updated when calling setBrush(NoBrush).
I suppose the real issue is that lastBrush is default-constructed in
QRasterPaintEngine, rather than starting with the brush from QPainter,
which is QBrush(color0) for the case of the bitmap. But no reason to
special case NoBrush here anyway.
Task-Number: QTBUG-38781
Change-Id: I9996ac12bf628920cfaf0de9c886f637a336028b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
This allows to easily create a matrix that performs the transformation
used by OpenGL fixed function to go from normalized device coordinates
to window coordinates.
This comes in useful if you need to perform the NDC->window coordinate
conversion inside a shader.
Change-Id: I183b3545bfb3eb1e8b13fc3172911b46926fcbb7
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
The currently used clipboard chain API has various problems with non-
responsive applications and requires checks for hung/debugged applications when
sending on notifications.
The new clipboard format listener API available from Windows Vista onwards
requires less code and does not have these problems, however the change
notifications now arrive asynchronously.
Change the tst_qclipboard to be able to deal with asynchronous change
notifications.
Task-number: QTBUG-38670
Task-number: QTBUG-33492
Change-Id: I3c49e346a34310431c20f3051d12eaabf330a3ad
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
When passing invalid data to QRawFont, we need to fail gracefully
and mark the font as invalid, instead of crashing. This crashed
because of different missing sanity checks in the Windows
and FontConfig font databases.
[ChangeLog][Text] Fixed crash when trying to load a font from
invalid data.
Task-number: QTBUG-37190
Change-Id: I62c81217ec7d873350b575c9d4ae8e6f0a939540
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
[ChangeLog][QtGui][QGuiApplication] Add support for -icon command line
argument on X11, add -qwindowicon on all platforms.
Change-Id: Iacc602466699bf634d8b34aab7ed73c83fd9844f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
In the justification code, we unconditionally subtracted one
from the line_length, but then compared the result to 0 afterwards,
so we did not support when the line_length is 0 initially, which
can happen if it only consists of spaces (in which case
trailingSpaces will be non-zero and line_length will be zero.)
The fix is to bail out for both strings of length 1 and length 0.
[ChangeLog][Text] Fixed an assert when justifying a QTextLine
which only contains spaces.
Task-number: QTBUG-38520
Change-Id: Ib04993f47eb2f9f7fc49c4a5400f18f9682a72f2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The plain text edit's smart repaint logic in
QPlainTextDocumentLayout::documentChanged assumes that during a change inside
just one block, the block is in the state before the edit and a call to
layoutBlock() is going to bring it up-to-date. Then only a comparison of the
bounding rect - before and after - is going to allow for smart repaints.
The assumption of the layout being in the same state as before the edit got
broken by commit cc57a2e90f, which introduced
code to use a QTextCursor within a slot connected to QTextDocument's
contentsChange signal. The usage of the QTextCursor there ends up updating the
layout of the block ahead of time, breaking the assumption and therefore the
optimization, in the sense that during changes in the preedit that cause a
change of height / line count, the old bounding rect in
QPlainTextDocumentLayout::documentChanged and the new bounding rect will be the
same. This causes a repaint of only the edited block, missing repaints of the
following blocks, even though the line count effectively changed.
So what's causing QTextCursor to mess with the layout is the attempt of
updating the vertical movement x property. This patch inhibits the update,
marking it as dirty for initialization later. This means that slots connected
to this low-level signal cannot rely on the cursor's visual x position, but
that doesn't seem useful anyway and isn't required for commit
cc57a2e90f.
Task-number: QTBUG-38536
Change-Id: I5fae12d646a4b2d2cc22b9f2d021e5dc8cfdda94
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
For now only xcb on GLX is supported. Other platforms will follow later.
Add also some missing documentation for the platform OpenGL context factory
functions.
[ChangeLog] QOpenGLContext is now able to adopt existing native contexts.
Task-number: QTBUG-37552
Change-Id: I5dd959f102df178f646b2df5989203b5dc6de376
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Its purpose in life will be to describe pixel formats
[ChangeLog][QtGui] Added QPixelFormat class
Change-Id: I74d8f974606520efb3935110ff3d6ddb5ea805a8
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>