diff options
author | Shane Kearns <shane.kearns@sosco.com> | 2009-11-10 10:35:10 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@sosco.com> | 2009-11-10 10:35:10 (GMT) |
commit | 294ca3b59dc02e1c89e2cac8007a74c61a2828fe (patch) | |
tree | 77aaa7a83107953f9e5591d09917ecb0b5400268 /src/gui/painting | |
parent | f42dd78db71c29d288b4a76a2fcfe720335afe1a (diff) | |
parent | 451e7fcad72366cf40bcb00931b86aafba1b983f (diff) | |
download | Qt-294ca3b59dc02e1c89e2cac8007a74c61a2828fe.zip Qt-294ca3b59dc02e1c89e2cac8007a74c61a2828fe.tar.gz Qt-294ca3b59dc02e1c89e2cac8007a74c61a2828fe.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qbrush.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qcolormap_qws.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qmatrix.cpp | 18 | ||||
-rw-r--r-- | src/gui/painting/qmatrix.h | 3 | ||||
-rw-r--r-- | src/gui/painting/qpaintdevice.h | 3 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_mac.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 4 | ||||
-rw-r--r-- | src/gui/painting/qpaintengineex.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qregion.cpp | 20 | ||||
-rw-r--r-- | src/gui/painting/qregion.h | 3 | ||||
-rw-r--r-- | src/gui/painting/qtransform.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qwindowsurface_raster.cpp | 6 |
12 files changed, 47 insertions, 20 deletions
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index ecbb290..9a8e09b 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -970,7 +970,7 @@ bool QBrush::operator==(const QBrush &b) const QDebug operator<<(QDebug dbg, const QBrush &b) { #ifndef Q_BROKEN_DEBUG_STREAM - char *BRUSH_STYLES[] = { + const char *BRUSH_STYLES[] = { "NoBrush", "SolidPattern", "Dense1Pattern", diff --git a/src/gui/painting/qcolormap_qws.cpp b/src/gui/painting/qcolormap_qws.cpp index ce4cd09..bc97b08 100644 --- a/src/gui/painting/qcolormap_qws.cpp +++ b/src/gui/painting/qcolormap_qws.cpp @@ -170,7 +170,7 @@ const QColor QColormap::colorAt(uint pixel) const (pixel & green_mask) >> green_shift, (pixel & blue_mask)); } - Q_ASSERT_X(int(pixel) < qt_screen->numCols(), "QColormap::colorAt", "pixel out of bounds of palette"); + Q_ASSERT_X(int(pixel) < qt_screen->colorCount(), "QColormap::colorAt", "pixel out of bounds of palette"); return QColor(qt_screen->clut()[pixel]); } diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp index 88b2b7a..17b7241 100644 --- a/src/gui/painting/qmatrix.cpp +++ b/src/gui/painting/qmatrix.cpp @@ -85,7 +85,7 @@ QT_BEGIN_NAMESPACE which returns true if the matrix is non-singular (i.e. AB = BA = I). The inverted() function returns an inverted copy of \e this matrix if it is invertible (otherwise it returns the identity - matrix). In addition, QMatrix provides the det() function + matrix). In addition, QMatrix provides the determinant() function returning the matrix's determinant. Finally, the QMatrix class supports matrix multiplication, and @@ -959,9 +959,19 @@ QMatrix &QMatrix::rotate(qreal a) */ /*! + \obsolete \fn qreal QMatrix::det() const Returns the matrix's determinant. + + \sa determinant() +*/ + +/*! + \since 4.6 + \fn qreal QMatrix::determinant() const + + Returns the matrix's determinant. */ /*! @@ -985,8 +995,8 @@ QMatrix &QMatrix::rotate(qreal a) QMatrix QMatrix::inverted(bool *invertible) const { - qreal determinant = det(); - if (determinant == 0.0) { + qreal dtr = determinant(); + if (dtr == 0.0) { if (invertible) *invertible = false; // singular matrix return QMatrix(true); @@ -994,7 +1004,7 @@ QMatrix QMatrix::inverted(bool *invertible) const else { // invertible matrix if (invertible) *invertible = true; - qreal dinv = 1.0/determinant; + qreal dinv = 1.0/dtr; return QMatrix((_m22*dinv), (-_m12*dinv), (-_m21*dinv), (_m11*dinv), ((_m21*_dy - _m22*_dx)*dinv), diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h index 8887f0e..152b3c9 100644 --- a/src/gui/painting/qmatrix.h +++ b/src/gui/painting/qmatrix.h @@ -101,7 +101,8 @@ public: QMatrix &rotate(qreal a); bool isInvertible() const { return !qFuzzyIsNull(_m11*_m22 - _m12*_m21); } - qreal det() const { return _m11*_m22 - _m12*_m21; } + qreal determinant() const { return _m11*_m22 - _m12*_m21; } + QT_DEPRECATED qreal det() const { return _m11*_m22 - _m12*_m21; } QMatrix inverted(bool *invertible = 0) const; diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h index c8e86b8..9148e4b 100644 --- a/src/gui/painting/qpaintdevice.h +++ b/src/gui/painting/qpaintdevice.h @@ -96,7 +96,8 @@ public: int logicalDpiY() const { return metric(PdmDpiY); } int physicalDpiX() const { return metric(PdmPhysicalDpiX); } int physicalDpiY() const { return metric(PdmPhysicalDpiY); } - int numColors() const { return metric(PdmNumColors); } + QT_DEPRECATED int numColors() const { return metric(PdmNumColors); } + int colorCount() const { return metric(PdmNumColors); } int depth() const { return metric(PdmDepth); } protected: diff --git a/src/gui/painting/qpaintengine_mac.cpp b/src/gui/painting/qpaintengine_mac.cpp index e686373..c1b887c 100644 --- a/src/gui/painting/qpaintengine_mac.cpp +++ b/src/gui/painting/qpaintengine_mac.cpp @@ -1023,7 +1023,7 @@ CGImageRef qt_mac_createCGImageFromQImage(const QImage &img, const QImage **imag #endif QCFType<CGDataProviderRef> dataProvider = CGDataProviderCreateWithData(image, static_cast<const QImage *>(image)->bits(), - image->numBytes(), + image->byteCount(), drawImageReleaseData); if (imagePtr) *imagePtr = image; diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index e3c4fe5..22bb9d2 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1362,7 +1362,7 @@ void QRasterPaintEngine::clip(const QRegion ®ion, Qt::ClipOperation op) Q_D(QRasterPaintEngine); - if (region.numRects() == 1) { + if (region.rectCount() == 1) { clip(region.boundingRect(), op); return; } @@ -4537,7 +4537,7 @@ void QClipData::setClipRect(const QRect &rect) */ void QClipData::setClipRegion(const QRegion ®ion) { - if (region.numRects() == 1) { + if (region.rectCount() == 1) { setClipRect(region.rects().at(0)); return; } diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 62b16ab..225e593 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -602,7 +602,7 @@ void QPaintEngineEx::clip(const QRect &r, Qt::ClipOperation op) void QPaintEngineEx::clip(const QRegion ®ion, Qt::ClipOperation op) { - if (region.numRects() == 1) + if (region.rectCount() == 1) clip(region.boundingRect(), op); QVector<QRect> rects = region.rects(); diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index b48b024..9d1d965 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -690,7 +690,7 @@ bool QRegion::intersects(const QRegion ®ion) const if (!rect_intersects(boundingRect(), region.boundingRect())) return false; - if (numRects() == 1 && region.numRects() == 1) + if (rectCount() == 1 && region.rectCount() == 1) return true; const QVector<QRect> myRects = rects(); @@ -717,7 +717,7 @@ bool QRegion::intersects(const QRect &rect) const const QRect r = rect.normalized(); if (!rect_intersects(boundingRect(), r)) return false; - if (numRects() == 1) + if (rectCount() == 1) return true; const QVector<QRect> myRects = rects(); @@ -739,6 +739,7 @@ QRegion QRegion::intersect(const QRect &r) const #endif /*! + \obsolete \fn int QRegion::numRects() const \since 4.4 @@ -746,6 +747,13 @@ QRegion QRegion::intersect(const QRect &r) const */ /*! + \fn int QRegion::rectCount() const + \since 4.6 + + Returns the number of rectangles that will be returned in rects(). +*/ + +/*! \fn bool QRegion::isEmpty() const Returns true if the region is empty; otherwise returns false. An @@ -1027,7 +1035,7 @@ void addSegmentsToPath(Segment *segment, QPainterPath &path) Q_AUTOTEST_EXPORT QPainterPath qt_regionToPath(const QRegion ®ion) { QPainterPath result; - if (region.numRects() == 1) { + if (region.rectCount() == 1) { result.addRect(region.boundingRect()); return result; } @@ -4317,6 +4325,12 @@ int QRegion::numRects() const return (d->qt_rgn ? d->qt_rgn->numRects : 0); } +int QRegion::rectCount() const +{ + return (d->qt_rgn ? d->qt_rgn->numRects : 0); +} + + bool QRegion::operator==(const QRegion &r) const { if (!d->qt_rgn) diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h index 7e459ed..2a1be86 100644 --- a/src/gui/painting/qregion.h +++ b/src/gui/painting/qregion.h @@ -116,7 +116,8 @@ public: QRect boundingRect() const; QVector<QRect> rects() const; void setRects(const QRect *rect, int num); - int numRects() const; + QT_DEPRECATED int numRects() const; + int rectCount() const; const QRegion operator|(const QRegion &r) const; const QRegion operator+(const QRegion &r) const; diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 622ceda..27a1503 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -1421,7 +1421,7 @@ QRegion QTransform::map(const QRegion &r) const return copy; } - if (t == TxScale && r.numRects() == 1) + if (t == TxScale && r.rectCount() == 1) return QRegion(mapRect(r.boundingRect())); QPainterPath p = map(qt_regionToPath(r)); diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index d412040..5060f95 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -140,7 +140,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi // Not ready for painting yet, bail out. This can happen in // QWidget::create_sys() - if (!d->image || rgn.numRects() == 0) + if (!d->image || rgn.rectCount() == 0) return; #ifdef Q_WS_WIN @@ -203,7 +203,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi wrgn.translate(-wOffset); QRect wbr = wrgn.boundingRect(); - if (wrgn.numRects() != 1) { + if (wrgn.rectCount() != 1) { int num; XRectangle *rects = (XRectangle *)qt_getClipRects(wrgn, num); XSetClipRectangles(X11->display, d_ptr->gc, 0, 0, rects, num, YXBanded); @@ -242,7 +242,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi } } - if (wrgn.numRects() != 1) + if (wrgn.rectCount() != 1) XSetClipMask(X11->display, d_ptr->gc, XNone); #endif // FALCON |