Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    9494    GLfloat bottom;
    9595
    96     operator QRectF() {return QRectF(left, top, right-left, bottom-top);}
     96    operator QRectF() const {return QRectF(left, top, right-left, bottom-top);}
    9797};
    9898
     
    101101public:
    102102    QGL2PEXVertexArray() :
     103        vertexArray(0), vertexArrayStops(0),
    103104        maxX(-2e10), maxY(-2e10), minX(2e10), minY(2e10),
    104         boundingRectDirty(true) {}
     105        boundingRectDirty(true)
     106    { }
     107   
     108    inline void addRect(const QRectF &rect)
     109    {
     110        qreal top = rect.top();
     111        qreal left = rect.left();
     112        qreal bottom = rect.bottom();
     113        qreal right = rect.right();
     114   
     115        vertexArray << QGLPoint(left, top)
     116                    << QGLPoint(right, top)
     117                    << QGLPoint(right, bottom)
     118                    << QGLPoint(right, bottom)
     119                    << QGLPoint(left, bottom)
     120                    << QGLPoint(left, top);       
     121    }
    105122
    106     void addRect(const QRectF &rect);
     123    inline void addQuad(const QRectF &rect)
     124    {
     125        qreal top = rect.top();
     126        qreal left = rect.left();
     127        qreal bottom = rect.bottom();
     128        qreal right = rect.right();
     129
     130        vertexArray << QGLPoint(left, top)
     131                    << QGLPoint(right, top)
     132                    << QGLPoint(left, bottom)
     133                    << QGLPoint(right, bottom);
     134
     135    }
     136
     137    inline void addVertex(const GLfloat x, const GLfloat y)
     138    {
     139        vertexArray.add(QGLPoint(x, y));
     140    }
     141
    107142    void addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline = true);
    108143    void clear();
Note: See TracChangeset for help on using the changeset viewer.