summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengine_raster.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration ↵Qt Continuous Integration System2011-06-081-1/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into master-integration * 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (54 commits) Update internal state before emitting configurationChanged() signals. Fixed qmlshadersplugin manual test shaders on SGX family GPU:s. Fixed qmlshadersplugin on windows VC2008 toolchain. Reset input context in Symbian when another window is opened. KERN-EXEC 3 panic in QCoeFepInputContext::translateInputWidget() Close context menus during orientation change. Have -small-screen enabled in certain examples on Symbian always. Update Japanese translations. Revert some of "Make QMLViewer startup animation stop after a while" Fix for winscw QtGui.def Add private method for flushing the pixmap cache. QDeclarative: Fix QPerformanceTimer on Symbian Fix QTreeWidget autotest cases on Symbian/VGA Increase SSL readbuffer 1 -> 16 kB Fix pixel metrics for Symbian VGA devices Revert "Fix QNetworkConfigurationManager usage outside main thread first" Avoid buffer overrun in QMacPixmapData resizing Fix glyph metrics with QStaticText/Freetype/raster and light/no hinting Fix tst_QGraphicsItem::sorting() test case for Symbian Fix QHeaderView test case for VGA Symbian devices. ...
| * Merge branch '4.7' into qt-4.8-from-4.7Liang Qi2011-06-061-1/+9
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qpaintengine_raster.cpp src/gui/text/qfontengine_ft.cpp src/s60installs/bwins/QtGuiu.def
| | * Missing glyphs transforming QStaticText on X11/raster with subpixel AAEskil Abrahamsen Blomfeldt2011-05-301-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Static text took an untested and broken code path for the combo of subpixel AA, X11, raster engine and transformation. This would cause missing glyphs. The reason was that QStaticText took an unused code path which turned out not to work. The workaround is to use gray AA on transformed text, like we already do for the GL engine. In Qt 4.8, the static text code path has been rewritten to use the Freetype cache instead of the image glyph cache, so the bug will be fixed more properly there. Reviewed-by: Samuel
| | * Update licenseheader text in source filesJyri Tahtela2011-05-131-17/+17
| | | | | | | | | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* | | Merge remote branch 'qt/4.8' into fire-masterPaul Olav Tvete2011-06-061-17/+17
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/wayland/qwaylandclipboard.cpp src/plugins/platforms/wayland/qwaylandclipboard.h src/plugins/platforms/wayland/qwaylanddisplay.cpp src/s60installs/eabi/QtOpenGLu.def
| * | Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-131-17/+17
| | | | | | | | | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* | | Fix Windows buildJiang Jiang2011-06-031-2/+2
| | |
* | | Refactor glyph pretransform checkJiang Jiang2011-06-031-34/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move paintEngineSupportsTransformations logic from QPainter to paint engine subclasses. Simplify and consolidate checks for cached drawing (pretransformed) and path drawing (untransformed) in raster paint engine. Fix unnecessary transform when paint engines actually take the path drawing track. Fix scaling and rotation transform in raster engine for Mac. Task-number: QTBUG-19086 Change-Id: I1c0c1800a5173d3db765b9fccfd0e7a3628e3815 Reviewed-on: http://codereview.qt.nokia.com/298 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> (cherry picked from commit 43c0e08ba2e3487840b4063b2099bc17cdd4dce2)
* | | Still use midpoint rendering of aliased ellipsesaavit2011-05-311-0/+160
| | | | | | | | | | | | | | | | | | | | | 37c329a removed this, but it is required to get correct fills, particularly for small radii Reviewed-by: gunnar
* | | Keep line consistency with text baselineJiang Jiang2011-05-301-1/+2
| | | | | | | | | | | | | | | | | | Also revert previous underline patch. Reviewed-by: Eskil
* | | Revert the revert of subpixel positions interpretation for textJiang Jiang2011-05-231-3/+2
| | | | | | | | | | | | | | | | | | | | | So that text rendering with raster engine on Mac can be the same as with native engine. Reviewed-by: Eskil
* | | Compilation fix of f8e8583aavit2011-05-191-2/+3
| | |
* | | Revert "Fix how subpixel positions are intepreted in an aliased grid."aavit2011-05-191-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 69fc9e594e6d5da87bff42707973683f84b67c93. Conflicts: src/gui/painting/qpaintengine_raster.cpp src/gui/painting/qrasterizer.cpp
* | | Fall back to using paths for large fonts in drawStaticText()Eskil Abrahamsen Blomfeldt2011-05-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QStaticText had an implicit risk which meant you had to make sure the text size did not grow unreasonably large. This was intended to avoid hiding the performance impact of using QStaticText for such a purpose, but it's too inconvenient. Thus, the same fall back as in drawTextItem() has been introduced. This will also fix a bug recently introduced when we started using the FT cache to draw static text in the raster engine, since this will fail for large fonts. Task-number: QTBUG-19084, QTBUG-19370 Reviewed-by: Jiang Jiang
* | | New algorithm for drawing thin linesLars Knoll2011-05-121-1442/+78
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a new QCosmeticStroker class for drawing thin lines. The class can handle both aliased and antialiased lines. The code replaces all the midpoint line drawing algorithms in the raster paintengine and gives correct subpixel positioning for lines. It gives around 30% to 50% speedup against the midpoint algorithm. If we missed that fast path, the speedup is around between a factor of 6 to 8 for lines and aliased paths and 100 and 400 for antialiased paths. Reviewed-by: Kim
* | Added support for six-parameter radial gradients.Samuel Rødal2011-04-131-1/+2
| | | | | | | | | | | | | | | | The extended radial gradients conform to the radial gradient specification in HTML 5 canvas. Task-number: QTBUG-14075 Reviewed-by: Andreas Kling
* | Improved gradient table generation performance for two-stop gradients.Samuel Rødal2011-04-131-0/+78
| | | | | | | | | | | | | | | | Two stops is a fairly common case so we gain quite a bit by special casing it. Improves performance by 10 % in parcycle benchmark, and by 90 % in a synthetic benchmark. Reviewed-by: Andreas Kling
* | Make sure we don't use subpixel positions in full hinting modeJiang Jiang2011-04-011-6/+1
| | | | | | | | | | | | | | | | Some of the text can start from subpixel positions (start from 100.5 for instance), we need to make sure they stick to pixel grid in this case. Reviewed-by: Eskil
* | Fix remaining regressions in QWSJiang Jiang2011-03-251-2/+5
| | | | | | | | Reviewed-by: TrustMe
* | Fixed remaining issues in subpixel positioning with FreeTypeJiang Jiang2011-03-241-125/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Merge QStaticText and QGlyphs drawing code of raster engine into glyph drawing code for normal QTextItem, it simplify the caching system (we don't use QImageTextureGlyphCache for raster anymore, just glyph set cache in FreeType engine is enough), and fix some regressions in QStaticText and QGlyphs drawing. 2. Fix subpixel positioning support for OpenGL texture glyph cache. Including a transform handling regression introduced by the initial patch. 3. Disable subpixel positioning for bitmap fonts (mono format). After this change, we only have two code paths for glyph rendering with FreeType: raster will always use the simple code path (with QFontEngine_FT cache) while GL will always use QTextureGlyphCache. Reviewed-by: Eskil
* | Implement subpixel positioning with FreeTypeJiang Jiang2011-03-221-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontEngineFT are used in raster/OpenGL paint engine and QGLWidget, also in Symbian, etc. We want to make sure it works well in raster and QGLWidget first. Regardless subpixel antialiasing (LCD filtering) is enabled or not (though it does look better when subpixel antialiasing is on). We also need to support transformations. The tricky part here is that, under X11, we have a different code path for QFontEngineFT and other font engines in raster engine, which uses QFontEngineFT's own glyph cache system. While in other platforms (Windows and Mac) and QGLWidget, we will use the generic QTextureGlyphCache. The generic QTextureGlyphCache already has support for subpixel positions, this solution is ported to QFontEngineFT for its QGlyphSet: the key for QGlyphSet hash table has been extended from glyph_t to <glyph_t, QFixed subPixelPosition> pair. The real work to enable subpixel positioning with FreeType is in fact really simple, we just set the horizontal translation to the subpixel position * 64 (FreeType uses a coordinate system of 1/64 of a pixel resolution internally) immediately before loading the glyph. A slight tweek to bitmap width is applied when we are getting the bitmap ourselves instead of using FT_Render_Glyph to accommodate the subpixel translation, which will only be used in non-LCD filtering cases (grayscale antialiasing). From what we have observed, FreeType can generate different bitmaps for at least 12 different subpixel positions (each with a slight difference). To limit the memory consumption, we restrict the number of subpixel positions to be 4 (hardcoded), which should be good enough for most low resolution displays. Subpixel positioning (and fractional glyph advances) will only be enabled when the hintingPreference for the font being used is PreferNoHinting or PreferVerticalHinting. We will use fontconfig hintstyle setting by default when no hintingPreference is set for the font. Task-number: QTBUG-12279 Reviewed-by: Eskil
* | Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-02-231-0/+7
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/gui/kernel/qcocoaview_mac.mm src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtGuiu.def src/testlib/qtestcase.cpp
| * Prevent infinite loop in raster engine on zero dash pattern length.Samuel Rødal2011-02-221-0/+7
| | | | | | | | | | Task-number: QTBUG-17053 Reviewed-by: Kim
* | Fix silly warnings about initialising in the wrong orderThiago Macieira2011-02-211-4/+4
| |
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-3/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | | | | | Reviewed-by: Trust Me
| * Doc: Fixing typoSergio Ahumada2011-01-071-2/+2
| |
* | Merge branch 'qt-graphics-team-text-master'Eskil Abrahamsen Blomfeldt2011-01-101-1/+3
|\ \
| * | Optimize texture glyph cacheEskil Abrahamsen Blomfeldt2010-12-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid calling the bounding box function for the same non-printable characters in every call, we cache them as empty in the coords table and bail out before painting them. This patch also fixes some possible reads of uninitialized memory (reference to return value) and reference to a default constructed object consisting of uninitialized pods. Reviewed-by: Samuel
* | | Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-12-211-22/+15
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | master-integration * 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (33 commits) Add inter-process binary shader cache for MeeGo Track average wait times under our maximum spin time threshold Store and track spin times in nanosecond resolution Optimize adaptive spinning mutex code Improve QMutex contention performance on Linux Improve QMutex contention performance on Mac OS X Disable spinning under lock contention on single CPU machines Remove unnecessary testAndSetAcquire from QMutex::lockInternal() Move contender count maintenance to QMutexPrivate test contention when using 2 mutexes Ensure that every thread does contend in the contention tests Add baseline test data to measure test overhead Test contention performance for long (10ms) critical sections Add a benchmark for contended and uncontended QMutex performance Removed QMutexPrivate::self() declaration Add QElapsedTimer::nsecsElapsed() const Delay creation of the process manager Make the QRasterPaintEngineState copy constructor cheaper. Micro-optimization for QSpanData::setup() define FSCTL_SET_REPARSE_POINT in test header ...
| * | | Make the QRasterPaintEngineState copy constructor cheaper.Andreas Kling2010-12-201-21/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use initializer syntax to avoid default-constructing a throwaway QBrush and QPen. Reviewed-by: Samuel Rødal
| * | | Micro-optimization for QSpanData::setup()Andreas Kling2010-12-201-1/+2
| |/ / | | | | | | | | | | | | | | | Don't call QColor::rgba() in a macro arg that gets evaluated multiple times. Reviewed-by: Samuel Rødal
* | | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-12-201-10/+23
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | Conflicts: demos/declarative/minehunt/minehunt.pro src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp src/plugins/phonon/mmf/mmf.pro src/s60installs/s60installs.pro tests/auto/qapplication/test/test.pro tests/auto/qgraphicsview/tst_qgraphicsview.cpp
| * Improve performance of clipping to a scaled QRectFLars Knoll2010-12-151-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | Clipping to a scaled QRectF was so far hitting the slow code path in the raster paintengine that generates clip spans for every line. This is not needed as we also clip translated QRectF's to integer rects. This patch does the same for scaled rectangles and ensures the clipping really happens at the closest pixel boundary. Reviewed-by: Samuel
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-11-121-2/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure doc/src/snippets/code/doc_src_qmake-manual.qdoc mkspecs/features/symbian/application_icon.prf mkspecs/features/symbian/default_post.prf mkspecs/features/symbian/symbian_building.prf qmake/generators/symbian/initprojectdeploy_symbian.cpp src/multimedia/audio/audio.pri src/network/access/qnetworkaccessmanager.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl_p.h src/plugins/bearer/corewlan/qcorewlanengine.mm src/plugins/phonon/mmf/mmf.pro tests/auto/qscriptvalue/tst_qscriptvalue.cpp tests/auto/qscriptvalue/tst_qscriptvalue.h tools/qdoc3/doc/qdoc-manual.qdocconf
| * Fixed text rendering bug in raster engine when opacity != 1.0.Samuel Rødal2010-11-081-1/+3
| | | | | | | | | | | | | | | | | | If opacity is updated independently from the pen properties sometimes the raster engine's fast_text flag would not be updated correctly, causing it to use a rendering path which doesn't support alpha. Reviewed-by: Robin Burchell Reviewed-by: Andreas Kling
| * Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-10-301-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: 32bit => 16bit conversion has 4byte-aligned output. Fix gcc bug in qReallocAligned Prevented threading related crash in OpenGL module. Fix possible crash in QStaticText and QDeclarativeTextLayout Fix QTBUG-14132 oracle (xe) stored procedures with bind variables get errors
| | * Fix possible crash in QStaticText and QDeclarativeTextLayoutEskil Abrahamsen Blomfeldt2010-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QStaticTextItem held an uncounted reference to QFontEngine. The pointer would dangle in some cases where there was no font object referencing the engine and the cache was cleaned out (e.g. when a new application font is added.) Properly count the reference, and also add reference counting to userData to make it harder to shoot yourself in the foot, since the QStaticTextItem class is now being used in different places, Task-number: QTBUG-14446 Reviewed-by: Martin Jones
* | | Optimize and clean up QClipData::fixup()Andreas Kling2010-11-041-18/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | WebKit was hitting this function pretty hard in SVG space invaders demo: http://croczilla.com/bits_and_pieces/svg/samples/invaders/invaders.svg This patch cuts time spent in QClipData::fixup() from 6% to 2%. Reviewed-by: Samuel Rødal
* | | Make use of the fast image paths for CompositionMode_Source as well.Samuel Rødal2010-11-011-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | Blending / blitting of images without an alpha-channel gives the same result with CompositionMode_Source and CompositionMode_SourceOver. Task-number: QTBUG-14901 Reviewed-by: Kim
* | | Merge branch 4.7 into qt-master-from-4.7Qt Continuous Integration System2010-10-311-0/+3
|\ \ \ | |/ /
| * | Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Olivier Goffart2010-10-301-0/+3
| |\ \ | | |/ | |/| | | | | | | Conflicts: tests/auto/qpainter/tst_qpainter.cpp
| | * Fix Windows compilation.Samuel Rødal2010-10-271-0/+1
| | | | | | | | | | | | | | | | | | | | | Don't take for granted that these are included... Task-number: QTBUG-14614 Reviewed-by: Bradley T. Hughes
| | * Fixed race condition in raster paint engine.Samuel Rødal2010-10-271-0/+2
| | | | | | | | | | | | | | | | | | | | | We need to protect the gradient cache accesses with a mutex. Task-number: QTBUG-14614 Reviewed-by: Bradley T. Hughes
* | | Merge remote branch 'qt/master' into lighthouse-masterPaul Olav Tvete2010-10-261-1/+1
|\ \ \ | | | | | | | | | | | | | | | | Conflicts: src/opengl/qwindowsurface_gl.cpp
| * \ \ Merge branch 4.7 into qt-master-from-4.7Qt Continuous Integration System2010-10-251-1/+1
| |\ \ \ | | |/ /
| | * | Fixed many spelling errors.Rohan McGovern2010-10-251-1/+1
| | | |
* | | | Merge remote branch 'qt/master' into lighthouse-masterPaul Olav Tvete2010-10-221-6/+4
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication_win.cpp src/gui/kernel/qwidget.cpp src/gui/text/qfontengine_ft.cpp
| * | | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-10-151-4/+2
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qpaintengine_raster.cpp tests/auto/declarative/qdeclarativetext/data/alignments_cb.png tests/auto/declarative/qdeclarativetext/data/alignments_cc.png tests/auto/declarative/qdeclarativetext/data/alignments_ct.png
| | * | Remove unnecessary calls to GetHorizBounds() + boundingBox()Alessandro Portale2010-10-121-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontEngineS60::boundingBox_const(): The metrics that CFont::getCharacterData() returns is equivalent to what TOpenFontCharMetrics::GetHorizBounds() returns. So, remove the use of TRect glyphBounds, and TOpenFontCharMetrics::GetHorizBounds(). Implementation of TOpenFontCharMetrics::GetHorizBounds(): http://developer.symbian.org/oss/API_REF/Public_API/file/837f303aceeb/epoc32/include/openfont.h#l1352 QRasterPaintEngine::drawGlyphsS60(): The metrics that QFontEngineS60::getCharacterData() returns are equivalent to what QFontEngineS60::boundingBox() returns. So, remove the use of glyph_metrics_t metrics, and QFontEngineS60::boundingBox(). These changes increase the Fps in qt\tests\manual\textrendering\textperformance "Latin" from 16.2 to 16.5 Fps on an XM5800. And they do that by removing code :) Task-number: QTBUG-14378 Reviewed-by: Jason Barron