Changeset 651 for trunk/src/gui/painting/qpainter.cpp
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/painting/qpainter.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 1330 1330 close to an impossible task because of the number of 1331 1331 permutations. As a compromise we have selected a subset of the 1332 QPainter API and backends, w ere performance is guaranteed to be as1332 QPainter API and backends, where performance is guaranteed to be as 1333 1333 good as we can sensibly get it for the given combination of 1334 1334 hardware and software. … … 1374 1374 opacity with non-smooth transformation mode 1375 1375 (\c QPainter::SmoothPixmapTransform not enabled as a render hint). 1376 1377 \o Text drawing with regular font sizes with simple1378 transformations with solid colors using no or 8-bit antialiasing.1379 1376 1380 1377 \o Rectangle fills with solid color, two-color linear gradients … … 1985 1982 \since 4.6 1986 1983 1987 Flushes the painting pipeline and prepares for the user issuing 1988 commands directly to the underlying graphics context. Must be 1989 followed by a call to endNativePainting(). 1984 Flushes the painting pipeline and prepares for the user issuing commands 1985 directly to the underlying graphics context. Must be followed by a call to 1986 endNativePainting(). 1987 1988 Note that only the states the underlying paint engine changes will be reset 1989 to their respective default states. If, for example, the OpenGL polygon 1990 mode is changed by the user inside a beginNativePaint()/endNativePainting() 1991 block, it will not be reset to the default state by endNativePainting(). 1990 1992 1991 1993 Here is an example that shows intermixing of painter commands … … 2011 2013 \since 4.6 2012 2014 2013 Restores the painter after manually issuing native painting commands. 2014 Lets the painter restore any native state that it relies on before2015 calling anyother painter commands.2015 Restores the painter after manually issuing native painting commands. Lets 2016 the painter restore any native state that it relies on before calling any 2017 other painter commands. 2016 2018 2017 2019 \sa beginNativePainting() … … 7381 7383 Q_GLOBAL_STATIC(QPaintDeviceRedirectionList, globalRedirections) 7382 7384 Q_GLOBAL_STATIC(QMutex, globalRedirectionsMutex) 7385 Q_GLOBAL_STATIC(QAtomicInt, globalRedirectionAtomic) 7383 7386 7384 7387 /*! 7385 7388 \threadsafe 7389 7390 \obsolete 7391 7392 Please use QWidget::render() instead. 7386 7393 7387 7394 Redirects all paint commands for the given paint \a device, to the … … 7394 7401 restoreRedirected() to restore the previous redirection. 7395 7402 7396 In general, you'll probably find that calling 7397 QPixmap::grabWidget() or QPixmap::grabWindow() is an easier 7398 solution. 7403 \warning Making use of redirections in the QPainter API implies 7404 that QPainter::begin() and QPaintDevice destructors need to hold 7405 a mutex for a short period. This can impact performance. Use of 7406 QWidget::render is strongly encouraged. 7399 7407 7400 7408 \sa redirected(), restoreRedirected() … … 7428 7436 *redirections += QPaintDeviceRedirection(device, rdev ? rdev : replacement, offset + roffset, 7429 7437 hadInternalWidgetRedirection ? redirections->size() - 1 : -1); 7438 globalRedirectionAtomic()->ref(); 7430 7439 } 7431 7440 7432 7441 /*! 7433 7442 \threadsafe 7443 7444 \obsolete 7445 7446 Using QWidget::render() obsoletes the use of this function. 7434 7447 7435 7448 Restores the previous redirection for the given \a device after a 7436 7449 call to setRedirected(). 7450 7451 \warning Making use of redirections in the QPainter API implies 7452 that QPainter::begin() and QPaintDevice destructors need to hold 7453 a mutex for a short period. This can impact performance. Use of 7454 QWidget::render is strongly encouraged. 7437 7455 7438 7456 \sa redirected() … … 7446 7464 for (int i = redirections->size()-1; i >= 0; --i) { 7447 7465 if (redirections->at(i) == device) { 7466 globalRedirectionAtomic()->deref(); 7448 7467 const int internalWidgetRedirectionIndex = redirections->at(i).internalWidgetRedirectionIndex; 7449 7468 redirections->removeAt(i); … … 7467 7486 \threadsafe 7468 7487 7488 \obsolete 7489 7490 Using QWidget::render() obsoletes the use of this function. 7491 7469 7492 Returns the replacement for given \a device. The optional out 7470 7493 parameter \a offset returns the offset within the replaced device. 7494 7495 \warning Making use of redirections in the QPainter API implies 7496 that QPainter::begin() and QPaintDevice destructors need to hold 7497 a mutex for a short period. This can impact performance. Use of 7498 QWidget::render is strongly encouraged. 7471 7499 7472 7500 \sa setRedirected(), restoreRedirected() … … 7481 7509 return widgetPrivate->redirected(offset); 7482 7510 } 7511 7512 if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0) 7513 return 0; 7483 7514 7484 7515 QMutexLocker locker(globalRedirectionsMutex()); … … 7499 7530 void qt_painter_removePaintDevice(QPaintDevice *dev) 7500 7531 { 7532 if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0) 7533 return; 7534 7501 7535 QMutex *mutex = 0; 7502 7536 QT_TRY {
Note:
See TracChangeset
for help on using the changeset viewer.