Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qpainter.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    13301330    close to an impossible task because of the number of
    13311331    permutations. As a compromise we have selected a subset of the
    1332     QPainter API and backends, were performance is guaranteed to be as
     1332    QPainter API and backends, where performance is guaranteed to be as
    13331333    good as we can sensibly get it for the given combination of
    13341334    hardware and software.
     
    13741374    opacity with non-smooth transformation mode
    13751375    (\c QPainter::SmoothPixmapTransform not enabled as a render hint).
    1376 
    1377     \o Text drawing with regular font sizes with simple
    1378     transformations with solid colors using no or 8-bit antialiasing.
    13791376
    13801377    \o Rectangle fills with solid color, two-color linear gradients
     
    19851982    \since 4.6
    19861983
    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().
    19901992
    19911993    Here is an example that shows intermixing of painter commands
     
    20112013    \since 4.6
    20122014
    2013     Restores the painter after manually issuing native painting commands.
    2014     Lets the painter restore any native state that it relies on before
    2015     calling any other 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.
    20162018
    20172019    \sa beginNativePainting()
     
    73817383Q_GLOBAL_STATIC(QPaintDeviceRedirectionList, globalRedirections)
    73827384Q_GLOBAL_STATIC(QMutex, globalRedirectionsMutex)
     7385Q_GLOBAL_STATIC(QAtomicInt, globalRedirectionAtomic)
    73837386
    73847387/*!
    73857388    \threadsafe
     7389
     7390    \obsolete
     7391
     7392    Please use QWidget::render() instead.
    73867393
    73877394    Redirects all paint commands for the given paint \a device, to the
     
    73947401    restoreRedirected() to restore the previous redirection.
    73957402
    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.
    73997407
    74007408    \sa redirected(), restoreRedirected()
     
    74287436    *redirections += QPaintDeviceRedirection(device, rdev ? rdev : replacement, offset + roffset,
    74297437                                             hadInternalWidgetRedirection ? redirections->size() - 1 : -1);
     7438    globalRedirectionAtomic()->ref();
    74307439}
    74317440
    74327441/*!
    74337442    \threadsafe
     7443
     7444    \obsolete
     7445
     7446    Using QWidget::render() obsoletes the use of this function.
    74347447
    74357448    Restores the previous redirection for the given \a device after a
    74367449    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.
    74377455
    74387456    \sa redirected()
     
    74467464    for (int i = redirections->size()-1; i >= 0; --i) {
    74477465        if (redirections->at(i) == device) {
     7466            globalRedirectionAtomic()->deref();
    74487467            const int internalWidgetRedirectionIndex = redirections->at(i).internalWidgetRedirectionIndex;
    74497468            redirections->removeAt(i);
     
    74677486    \threadsafe
    74687487
     7488    \obsolete
     7489
     7490    Using QWidget::render() obsoletes the use of this function.
     7491
    74697492    Returns the replacement for given \a device. The optional out
    74707493    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.
    74717499
    74727500    \sa setRedirected(), restoreRedirected()
     
    74817509            return widgetPrivate->redirected(offset);
    74827510    }
     7511
     7512    if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0)
     7513        return 0;
    74837514
    74847515    QMutexLocker locker(globalRedirectionsMutex());
     
    74997530void qt_painter_removePaintDevice(QPaintDevice *dev)
    75007531{
     7532    if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0)
     7533        return;
     7534
    75017535    QMutex *mutex = 0;
    75027536    QT_TRY {
Note: See TracChangeset for help on using the changeset viewer.