Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qpaintengineex_p.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include <QtGui/qpaintengine.h>
    57 
    58 #include "qpaintengine_p.h"
    59 #include "qstroker_p.h"
    60 #include "qpainter_p.h"
    61 #include "qvectorpath_p.h"
     57#include <QtGui/qdrawutil.h>
     58
     59#include <private/qpaintengine_p.h>
     60#include <private/qstroker_p.h>
     61#include <private/qpainter_p.h>
     62#include <private/qvectorpath_p.h>
    6263
    6364
     
    7172class QPaintEngineExPrivate;
    7273struct StrokeHandler;
    73 
    7474
    7575struct QIntRect {
     
    134134};
    135135
    136 
    137 
    138136#ifndef QT_NO_DEBUG_STREAM
    139137QDebug Q_GUI_EXPORT &operator<<(QDebug &, const QVectorPath &path);
    140138#endif
    141 
    142 class Q_GUI_EXPORT QPaintEngineExPrivate : public QPaintEnginePrivate
    143 {
    144 public:
    145     QPaintEngineExPrivate();
    146     ~QPaintEngineExPrivate();
    147 
    148     QStroker stroker;
    149     QDashStroker dasher;
    150     StrokeHandler *strokeHandler;
    151     QStrokerOps *activeStroker;
    152     QPen strokerPen;
    153 };
    154139
    155140class QPixmapFilter;
     
    159144    Q_DECLARE_PRIVATE(QPaintEngineEx)
    160145public:
    161     inline QPaintEngineEx()
    162         : QPaintEngine(*new QPaintEngineExPrivate, AllFeatures) { extended = true; }
     146    QPaintEngineEx();
    163147
    164148    virtual QPainterState *createState(QPainterState *orig) const;
     
    185169    virtual void fillRect(const QRectF &rect, const QColor &color);
    186170
     171    virtual void drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode);
     172
    187173    virtual void drawRects(const QRect *rects, int rectCount);
    188174    virtual void drawRects(const QRectF *rects, int rectCount);
     
    211197    virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
    212198
     199    virtual void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QFlags<QDrawPixmaps::DrawingHint> hints);
     200
    213201    virtual void updateState(const QPaintEngineState &state);
    214202
     
    217205    inline const QPainterState *state() const { return static_cast<const QPainterState *>(QPaintEngine::state); }
    218206
    219     virtual QPixmapFilter *createPixmapFilter(int /*type*/) const { return 0; }
     207    virtual void sync() {}
     208
     209    virtual void beginNativePainting() {}
     210    virtual void endNativePainting() {}
     211
     212    // Return a pixmap filter of "type" that can render the parameters
     213    // in "prototype".  The returned filter is owned by the engine and
     214    // will be destroyed when the engine is destroyed.  The "prototype"
     215    // allows the engine to pick different filters based on the parameters
     216    // that will be requested, and not just the "type".
     217    virtual QPixmapFilter *pixmapFilter(int /*type*/, const QPixmapFilter * /*prototype*/) { return 0; }
     218
     219    // These flags are needed in the implementation of paint buffers.
     220    enum Flags
     221    {
     222        DoNotEmulate = 0x01,        // If set, QPainter will not wrap this engine in an emulation engine.
     223        IsEmulationEngine = 0x02    // If set, this object is a QEmulationEngine.
     224    };
     225    virtual uint flags() const {return 0;}
    220226
    221227protected:
     
    223229};
    224230
     231class Q_GUI_EXPORT QPaintEngineExPrivate : public QPaintEnginePrivate
     232{
     233    Q_DECLARE_PUBLIC(QPaintEngineEx)
     234public:
     235    QPaintEngineExPrivate();
     236    ~QPaintEngineExPrivate();
     237
     238    void replayClipOperations();
     239    bool hasClipOperations() const;
     240
     241    QStroker stroker;
     242    QDashStroker dasher;
     243    StrokeHandler *strokeHandler;
     244    QStrokerOps *activeStroker;
     245    QPen strokerPen;
     246
     247    QRect exDeviceRect;
     248};
    225249
    226250inline uint QVectorPath::polygonFlags(QPaintEngine::PolygonDrawMode mode) {
    227251    switch (mode) {
    228252    case QPaintEngine::ConvexMode: return ConvexPolygonHint | ImplicitClose;
    229     case QPaintEngine::OddEvenMode: return NonCurvedShapeHint | OddEvenFill | ImplicitClose;
    230     case QPaintEngine::WindingMode: return NonCurvedShapeHint | WindingFill | ImplicitClose;
    231     case QPaintEngine::PolylineMode: return NonCurvedShapeHint;
     253    case QPaintEngine::OddEvenMode: return PolygonHint | OddEvenFill | ImplicitClose;
     254    case QPaintEngine::WindingMode: return PolygonHint | WindingFill | ImplicitClose;
     255    case QPaintEngine::PolylineMode: return PolygonHint;
    232256    default: return 0;
    233257    }
Note: See TracChangeset for help on using the changeset viewer.