diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-02-14 13:57:35 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-06 12:21:14 +0100 |
commit | cd652500af18671e0d64b30d51c79a0c45b973a3 (patch) | |
tree | 42be73d316d9bfa81569e73993e31cacf978be33 /src/gui/painting/qregion.cpp | |
parent | 2df1a6c4c9c7bed8dceb23a6b53014fb42014ded (diff) |
Add optimize_full qmake config option
This patch adds a new config option to qmake to enable full optimization
where it makes sense. This currently is supported on all gcc like
compilers by exchanging -O2 for -O3.
In qtbase it is used to enable full optimizations on qtcore and qtgui
and in a later patch can be used to replace similar existing logic in
QtWebKit's WTF and JavaScriptCore modules.
This fixes a performance regression from gcc 4.7 to 4.8 in the software
renderer.
An aliasing error in qregion.cpp which was exposed by more aggresive
optimization has been solved as well.
Change-Id: Ic2c6c41b79cb3846212b40e7bcc11ff492beb27f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/gui/painting/qregion.cpp')
-rw-r--r-- | src/gui/painting/qregion.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index f58cd1c428..beeac6bd43 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -3528,7 +3528,7 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) QPoint *pts; /* output buffer */ EdgeTableEntry *pPrevAET; /* ptr to previous AET */ EdgeTable ET; /* header node for ET */ - EdgeTableEntry AET; /* header node for AET */ + EdgeTableEntry *AET; /* header node for AET */ EdgeTableEntry *pETEs; /* EdgeTableEntries pool */ ScanLineListBlock SLLBlock; /* header for scanlinelist */ int fixWAET = false; @@ -3567,8 +3567,9 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) region->vectorize(); + AET = new EdgeTableEntry; pts = FirstPtBlock.pts; - CreateETandAET(Count, Pts, &ET, &AET, pETEs, &SLLBlock); + CreateETandAET(Count, Pts, &ET, AET, pETEs, &SLLBlock); pSLL = ET.scanlines.next; curPtBlock = &FirstPtBlock; @@ -3579,6 +3580,7 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) #ifndef QT_NO_DEBUG qWarning("QRegion: creating region from big polygon failed...!"); #endif + delete AET; delete region; return 0; } @@ -3596,11 +3598,11 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) * get to the next edge. */ if (pSLL && y == pSLL->scanline) { - loadAET(&AET, pSLL->edgelist); + loadAET(AET, pSLL->edgelist); pSLL = pSLL->next; } - pPrevAET = &AET; - pAET = AET.next; + pPrevAET = AET; + pAET = AET->next; /* * for each active edge @@ -3626,7 +3628,7 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) } EVALUATEEDGEEVENODD(pAET, pPrevAET, y) } - InsertionSort(&AET); + InsertionSort(AET); } } else { /* @@ -3638,12 +3640,12 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) * get to the next edge. */ if (pSLL && y == pSLL->scanline) { - loadAET(&AET, pSLL->edgelist); - computeWAET(&AET); + loadAET(AET, pSLL->edgelist); + computeWAET(AET); pSLL = pSLL->next; } - pPrevAET = &AET; - pAET = AET.next; + pPrevAET = AET; + pAET = AET->next; pWETE = pAET; /* @@ -3681,8 +3683,8 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) * recompute the winding active edge table if * we just resorted or have exited an edge. */ - if (InsertionSort(&AET) || fixWAET) { - computeWAET(&AET); + if (InsertionSort(AET) || fixWAET) { + computeWAET(AET); fixWAET = false; } } @@ -3706,6 +3708,7 @@ static QRegionPrivate *PolygonRegion(const QPoint *Pts, int Count, int rule) free(curPtBlock); curPtBlock = tmpPtBlock; } + delete AET; free(pETEs); return region; } |