OSDN Git Service

mostly rasterizer cleanup
authorIvailo Monev <xakepa10@laimg.moc>
Mon, 22 Aug 2016 01:26:43 +0000 (01:26 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Mon, 22 Aug 2016 01:26:43 +0000 (01:26 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/gui/painting/qgrayraster.c
src/gui/painting/qpaintengine_raster.cpp
src/gui/painting/qpathclipper.cpp
src/gui/painting/qpathclipper_p.h
src/gui/painting/qrasterdefs_p.h
src/opengl/qgraphicssystem_gl.cpp

index 9588f6a..734c7a9 100644 (file)
 
     qt_ft_jmp_buf  jump_buffer;
 
-    void*       buffer;
-    long        buffer_size;
+    char*       buffer;
+    int         buffer_size;
 
     PCell*     ycells;
     int        ycount;
 
   typedef struct TRaster_
   {
-    void*    buffer;
-    long     buffer_size;
+    char*    buffer;
+    int      buffer_size;
     int      band_size;
     PWorker  worker;
 
           cell_end  = ras.buffer_size;
           cell_end -= cell_end % sizeof( TCell );
 
-          cells_max = (PCell)( (char*)ras.buffer + cell_end );
-          ras.cells = (PCell)( (char*)ras.buffer + cell_start );
+          cells_max = (PCell)( ras.buffer + cell_end );
+          ras.cells = (PCell)( ras.buffer + cell_start );
           if ( ras.cells >= cells_max )
             goto ReduceBands;
 
 
 
   static void
-  gray_raster_reset( QT_FT_Raster  raster,
-                     char*      pool_base )
+  gray_raster_reset( QT_FT_Raster  raster )
   {
     PRaster  rast = (PRaster)raster;
 
     if ( raster )
     {
-      if ( pool_base )
-      {
-        PWorker  worker = (PWorker)pool_base;
-
-
-        rast->worker      = worker;
-        rast->buffer      = pool_base +
-                              ( ( sizeof ( TWorker ) + sizeof ( TCell ) - 1 ) &
-                                ~( sizeof ( TCell ) - 1 ) );
-        rast->buffer_size = (long)( ( pool_base + RASTER_POOL_SIZE ) -
-                                    (char*)rast->buffer ) &
-                                      ~( sizeof ( TCell ) - 1 );
-        rast->band_size   = (int)( rast->buffer_size /
-                                     ( sizeof ( TCell ) * 8 ) );
-      }
-      else
-      {
-        rast->buffer      = NULL;
-        rast->buffer_size = 0;
-        rast->worker      = NULL;
-      }
+      char pool_base[RASTER_POOL_SIZE];
+      PWorker  worker = (PWorker)pool_base;
+
+
+      rast->worker      = worker;
+      rast->buffer      = pool_base +
+                            ( ( sizeof ( TWorker ) + sizeof ( TCell ) - 1 ) &
+                              ~( sizeof ( TCell ) - 1 ) );
+      rast->buffer_size = ( ( pool_base + RASTER_POOL_SIZE ) -
+                            rast->buffer ) & ~( sizeof ( TCell ) - 1 );
+      rast->band_size   = rast->buffer_size / ( sizeof ( TCell ) * 8 );
     }
   }
 
   const QT_FT_Raster_Funcs  qt_ft_grays_raster =
   {
-    QT_FT_GLYPH_FORMAT_OUTLINE,
-
     (QT_FT_Raster_New_Func)     gray_raster_new,
     (QT_FT_Raster_Reset_Func)   gray_raster_reset,
     (QT_FT_Raster_Render_Func)  gray_raster_render,
index 3c337b3..1248c34 100644 (file)
@@ -3256,10 +3256,7 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
         return;
     }
 
-    // Initial size for raster pool has to be RASTER_POOL_SIZE, obviously
-    char rasterPoolBase[RASTER_POOL_SIZE];
-
-    qt_ft_grays_raster.raster_reset(*grayRaster, rasterPoolBase);
+    qt_ft_grays_raster.raster_reset(*grayRaster);
 
     QT_FT_BBox clip_box = { deviceRect.x(),
                             deviceRect.y(),
index b7dccb1..f8f65e3 100644 (file)
@@ -1930,13 +1930,12 @@ enum Edge
     Left, Top, Right, Bottom
 };
 
-static bool isVertical(Edge edge)
+static inline bool isVertical(Edge edge)
 {
     return edge == Left || edge == Right;
 }
 
-template <Edge edge>
-bool compare(const QPointF &p, qreal t)
+static inline bool compare(const QPointF &p, qreal t, Edge edge)
 {
     switch (edge)
     {
@@ -1951,8 +1950,7 @@ bool compare(const QPointF &p, qreal t)
     }
 }
 
-template <Edge edge>
-QPointF intersectLine(const QPointF &a, const QPointF &b, qreal t)
+static inline QPointF intersectLine(const QPointF &a, const QPointF &b, qreal t, Edge edge)
 {
     QLineF line(a, b);
     switch (edge) {
@@ -1964,7 +1962,7 @@ QPointF intersectLine(const QPointF &a, const QPointF &b, qreal t)
     }
 }
 
-void addLine(QPainterPath &path, const QLineF &line)
+static inline void addLine(QPainterPath &path, const QLineF &line)
 {
     if (path.elementCount() > 0)
         path.lineTo(line.p1());
@@ -1974,23 +1972,22 @@ void addLine(QPainterPath &path, const QLineF &line)
     path.lineTo(line.p2());
 }
 
-template <Edge edge>
-void clipLine(const QPointF &a, const QPointF &b, qreal t, QPainterPath &result)
+static inline void clipLine(const QPointF &a, const QPointF &b, qreal t, QPainterPath &result, Edge edge)
 {
-    bool outA = compare<edge>(a, t);
-    bool outB = compare<edge>(b, t);
+    bool outA = compare(a, t, edge);
+    bool outB = compare(b, t, edge);
     if (outA && outB)
         return;
 
     if (outA)
-        addLine(result, QLineF(intersectLine<edge>(a, b, t), b));
+        addLine(result, QLineF(intersectLine(a, b, t, edge), b));
     else if(outB)
-        addLine(result, QLineF(a, intersectLine<edge>(a, b, t)));
+        addLine(result, QLineF(a, intersectLine(a, b, t, edge)));
     else
         addLine(result, QLineF(a, b));
 }
 
-void addBezier(QPainterPath &path, const QBezier &bezier)
+static inline void addBezier(QPainterPath &path, const QBezier &bezier)
 {
     if (path.elementCount() > 0)
         path.lineTo(bezier.pt1());
@@ -2000,15 +1997,14 @@ void addBezier(QPainterPath &path, const QBezier &bezier)
     path.cubicTo(bezier.pt2(), bezier.pt3(), bezier.pt4());
 }
 
-template <Edge edge>
-void clipBezier(const QPointF &a, const QPointF &b, const QPointF &c, const QPointF &d, qreal t, QPainterPath &result)
+static inline void clipBezier(const QPointF &a, const QPointF &b, const QPointF &c, const QPointF &d, qreal t, QPainterPath &result, Edge edge)
 {
     QBezier bezier = QBezier::fromPoints(a, b, c, d);
 
-    bool outA = compare<edge>(a, t);
-    bool outB = compare<edge>(b, t);
-    bool outC = compare<edge>(c, t);
-    bool outD = compare<edge>(d, t);
+    bool outA = compare(a, t, edge);
+    bool outB = compare(b, t, edge);
+    bool outC = compare(c, t, edge);
+    bool outD = compare(d, t, edge);
 
     int outCount = int(outA) + int(outB) + int(outC) + int(outD);
 
@@ -2049,8 +2045,8 @@ void clipBezier(const QPointF &a, const QPointF &b, const QPointF &c, const QPoi
 
     qreal lastIntersection = 0;
     for (int i = 0; i < segmentCount; ++i) {
-        outA = compare<edge>(points[i], t);
-        outB = compare<edge>(points[i+1], t);
+        outA = compare(points[i], t, edge);
+        outB = compare(points[i+1], t, edge);
 
         if (outA != outB) {
             qreal intersection = flipped.tForY(segments[i], segments[i+1], t);
@@ -2067,29 +2063,28 @@ void clipBezier(const QPointF &a, const QPointF &b, const QPointF &c, const QPoi
 }
 
 // clips a single subpath against a single edge
-template <Edge edge>
-QPainterPath clip(const QPainterPath &path, qreal t)
+static inline QPainterPath clip(const QPainterPath &path, qreal t, Edge edge)
 {
     QPainterPath result;
     for (int i = 1; i < path.elementCount(); ++i) {
         const QPainterPath::Element &element = path.elementAt(i);
         Q_ASSERT(!element.isMoveTo());
         if (element.isLineTo()) {
-            clipLine<edge>(path.elementAt(i-1), path.elementAt(i), t, result);
+            clipLine(path.elementAt(i-1), path.elementAt(i), t, result, edge);
         } else {
-            clipBezier<edge>(path.elementAt(i-1), path.elementAt(i), path.elementAt(i+1), path.elementAt(i+2), t, result);
+            clipBezier(path.elementAt(i-1), path.elementAt(i), path.elementAt(i+1), path.elementAt(i+2), t, result, edge);
             i += 2;
         }
     }
 
     int last = path.elementCount() - 1;
     if (QPointF(path.elementAt(last)) != QPointF(path.elementAt(0)))
-        clipLine<edge>(path.elementAt(last), path.elementAt(0), t, result);
+        clipLine(path.elementAt(last), path.elementAt(0), t, result, edge);
 
     return result;
 }
 
-QPainterPath intersectPath(const QPainterPath &path, const QRectF &rect)
+static inline QPainterPath intersectPath(const QPainterPath &path, const QRectF &rect)
 {
     QList<QPainterPath> subpaths = toSubpaths(path);
 
@@ -2100,16 +2095,16 @@ QPainterPath intersectPath(const QPainterPath &path, const QRectF &rect)
         QRectF bounds = subPath.boundingRect();
         if (bounds.intersects(rect)) {
             if (bounds.left() < rect.left())
-                subPath = clip<Left>(subPath, rect.left());
+                subPath = clip(subPath, rect.left(), Left);
             if (bounds.right() > rect.right())
-                subPath = clip<Right>(subPath, rect.right());
+                subPath = clip(subPath, rect.right(), Right);
 
             bounds = subPath.boundingRect();
 
             if (bounds.top() < rect.top())
-                subPath = clip<Top>(subPath, rect.top());
+                subPath = clip(subPath, rect.top(), Top);
             if (bounds.bottom() > rect.bottom())
-                subPath = clip<Bottom>(subPath, rect.bottom());
+                subPath = clip(subPath, rect.bottom(), Bottom);
 
             if (subPath.elementCount() > 1)
                 result.addPath(subPath);
index c0daf3a..2a07755 100644 (file)
@@ -56,7 +56,6 @@
 #include <QtGui/qpainterpath.h>
 #include <QtCore/qlist.h>
 
-#include <qbezier_p.h>
 #include <qdatabuffer_p.h>
 #include <stdio.h>
 
index 90431b2..341fe80 100644 (file)
@@ -116,7 +116,6 @@ QT_FT_BEGIN_HEADER
 
   } QT_FT_Vector;
 
-
   /*************************************************************************/
   /*                                                                       */
   /* <Struct>                                                              */
@@ -143,68 +142,6 @@ QT_FT_BEGIN_HEADER
 
   } QT_FT_BBox;
 
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Enum>                                                                */
-  /*    QT_FT_Pixel_Mode                                                      */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    An enumeration type used to describe the format of pixels in a     */
-  /*    given bitmap.  Note that additional formats may be added in the    */
-  /*    future.                                                            */
-  /*                                                                       */
-  /* <Values>                                                              */
-  /*    QT_FT_PIXEL_MODE_NONE ::                                              */
-  /*      Value 0 is reserved.                                             */
-  /*                                                                       */
-  /*    QT_FT_PIXEL_MODE_MONO ::                                              */
-  /*      A monochrome bitmap, using 1 bit per pixel.  Note that pixels    */
-  /*      are stored in most-significant order (MSB), which means that     */
-  /*      the left-most pixel in a byte has value 128.                     */
-  /*                                                                       */
-  /*    QT_FT_PIXEL_MODE_GRAY ::                                              */
-  /*      An 8-bit bitmap, generally used to represent anti-aliased glyph  */
-  /*      images.  Each pixel is stored in one byte.  Note that the number */
-  /*      of value "gray" levels is stored in the `num_bytes' field of     */
-  /*      the @QT_FT_Bitmap structure (it generally is 256).                  */
-  /*                                                                       */
-  /*    QT_FT_PIXEL_MODE_GRAY2 ::                                             */
-  /*      A 2-bit/pixel bitmap, used to represent embedded anti-aliased    */
-  /*      bitmaps in font files according to the OpenType specification.   */
-  /*      We haven't found a single font using this format, however.       */
-  /*                                                                       */
-  /*    QT_FT_PIXEL_MODE_GRAY4 ::                                             */
-  /*      A 4-bit/pixel bitmap, used to represent embedded anti-aliased    */
-  /*      bitmaps in font files according to the OpenType specification.   */
-  /*      We haven't found a single font using this format, however.       */
-  /*                                                                       */
-  /*    QT_FT_PIXEL_MODE_LCD ::                                               */
-  /*      An 8-bit bitmap, used to represent RGB or BGR decimated glyph    */
-  /*      images used for display on LCD displays; the bitmap's width is   */
-  /*      three times wider than the original glyph image.  See also       */
-  /*      @QT_FT_RENDER_MODE_LCD.                                             */
-  /*                                                                       */
-  /*    QT_FT_PIXEL_MODE_LCD_V ::                                             */
-  /*      An 8-bit bitmap, used to represent RGB or BGR decimated glyph    */
-  /*      images used for display on rotated LCD displays; the bitmap's    */
-  /*      height is three times taller than the original glyph image.      */
-  /*      See also @QT_FT_RENDER_MODE_LCD_V.                                  */
-  /*                                                                       */
-  typedef enum  QT_FT_Pixel_Mode_
-  {
-    QT_FT_PIXEL_MODE_NONE = 0,
-    QT_FT_PIXEL_MODE_MONO,
-    QT_FT_PIXEL_MODE_GRAY,
-    QT_FT_PIXEL_MODE_GRAY2,
-    QT_FT_PIXEL_MODE_GRAY4,
-    QT_FT_PIXEL_MODE_LCD,
-    QT_FT_PIXEL_MODE_LCD_V,
-
-    QT_FT_PIXEL_MODE_MAX      /* do not remove */
-
-  } QT_FT_Pixel_Mode;
-
   /*************************************************************************/
   /*                                                                       */
   /* <Section>                                                             */
@@ -275,62 +212,13 @@ QT_FT_BEGIN_HEADER
   /* <Values>                                                              */
   /*    QT_FT_OUTLINE_NONE           :: Value 0 is reserved.               */
   /*                                                                       */
-  /*    QT_FT_OUTLINE_OWNER          :: If set, this flag indicates that the */
-  /*                                 outline's field arrays (i.e.          */
-  /*                                 `points', `flags' & `contours') are   */
-  /*                                 `owned' by the outline object, and    */
-  /*                                 should thus be freed when it is       */
-  /*                                 destroyed.                            */
-  /*                                                                       */
   /*   QT_FT_OUTLINE_EVEN_ODD_FILL   :: By default, outlines are filled using */
   /*                                 the non-zero winding rule.  If set to */
   /*                                 1, the outline will be filled using   */
   /*                                 the even-odd fill rule (only works    */
   /*                                 with the smooth raster).              */
-  /*                                                                       */
-  /*   QT_FT_OUTLINE_REVERSE_FILL    :: By default, outside contours of an */
-  /*                                 outline are oriented in clock-wise    */
-  /*                                 direction, as defined in the TrueType */
-  /*                                 specification.  This flag is set if   */
-  /*                                 the outline uses the opposite         */
-  /*                                 direction (typically for Type 1       */
-  /*                                 fonts).  This flag is ignored by the  */
-  /*                                 scan-converter.  However, it is very  */
-  /*                                 important for the auto-hinter.        */
-  /*                                                                       */
-  /*   QT_FT_OUTLINE_IGNORE_DROPOUTS :: By default, the scan converter will */
-  /*                                 try to detect drop-outs in an outline */
-  /*                                 and correct the glyph bitmap to       */
-  /*                                 ensure consistent shape continuity.   */
-  /*                                 If set, this flag hints the scan-line */
-  /*                                 converter to ignore such cases.       */
-  /*                                                                       */
-  /*   QT_FT_OUTLINE_HIGH_PRECISION  :: This flag indicates that the       */
-  /*                                 scan-line converter should try to     */
-  /*                                 convert this outline to bitmaps with  */
-  /*                                 the highest possible quality.  It is  */
-  /*                                 typically set for small character     */
-  /*                                 sizes.  Note that this is only a      */
-  /*                                 hint, that might be completely        */
-  /*                                 ignored by a given scan-converter.    */
-  /*                                                                       */
-  /*   QT_FT_OUTLINE_SINGLE_PASS     :: This flag is set to force a given  */
-  /*                                 scan-converter to only use a single   */
-  /*                                 pass over the outline to render a     */
-  /*                                 bitmap glyph image.  Normally, it is  */
-  /*                                 set for very large character sizes.   */
-  /*                                 It is only a hint, that might be      */
-  /*                                 completely ignored by a given         */
-  /*                                 scan-converter.                       */
-  /*                                                                       */
 #define QT_FT_OUTLINE_NONE             0x0
-#define QT_FT_OUTLINE_OWNER            0x1
 #define QT_FT_OUTLINE_EVEN_ODD_FILL    0x2
-#define QT_FT_OUTLINE_REVERSE_FILL     0x4
-#define QT_FT_OUTLINE_IGNORE_DROPOUTS  0x8
-
-#define QT_FT_OUTLINE_HIGH_PRECISION   0x100
-#define QT_FT_OUTLINE_SINGLE_PASS      0x200
 
   /* */
 
@@ -339,174 +227,6 @@ QT_FT_BEGIN_HEADER
 #define QT_FT_CURVE_TAG_ON           1
 #define QT_FT_CURVE_TAG_CUBIC        2
 
-#define  QT_FT_Curve_Tag_On       QT_FT_CURVE_TAG_ON
-#define  QT_FT_Curve_Tag_Cubic    QT_FT_CURVE_TAG_CUBIC
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <FuncType>                                                            */
-  /*    QT_FT_Outline_MoveToFunc                                           */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A function pointer type used to describe the signature of a `move  */
-  /*    to' function during outline walking/decomposition.                 */
-  /*                                                                       */
-  /*    A `move to' is emitted to start a new contour in an outline.       */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    to   :: A pointer to the target point of the `move to'.            */
-  /*                                                                       */
-  /*    user :: A typeless pointer which is passed from the caller of the  */
-  /*            decomposition function.                                    */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    Error code.  0 means success.                                      */
-  /*                                                                       */
-  typedef int
-  (*QT_FT_Outline_MoveToFunc)( QT_FT_Vector*  to,
-                            void*       user );
-
-#define QT_FT_Outline_MoveTo_Func  QT_FT_Outline_MoveToFunc
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <FuncType>                                                            */
-  /*    QT_FT_Outline_LineToFunc                                           */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A function pointer type used to describe the signature of a `line  */
-  /*    to' function during outline walking/decomposition.                 */
-  /*                                                                       */
-  /*    A `line to' is emitted to indicate a segment in the outline.       */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    to   :: A pointer to the target point of the `line to'.            */
-  /*                                                                       */
-  /*    user :: A typeless pointer which is passed from the caller of the  */
-  /*            decomposition function.                                    */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    Error code.  0 means success.                                      */
-  /*                                                                       */
-  typedef int
-  (*QT_FT_Outline_LineToFunc)( QT_FT_Vector*  to,
-                            void*       user );
-
-#define  QT_FT_Outline_LineTo_Func  QT_FT_Outline_LineToFunc
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <FuncType>                                                            */
-  /*    QT_FT_Outline_ConicToFunc                                          */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A function pointer type use to describe the signature of a `conic  */
-  /*    to' function during outline walking/decomposition.                 */
-  /*                                                                       */
-  /*    A `conic to' is emitted to indicate a second-order Bezier arc in   */
-  /*    the outline.                                                       */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    control :: An intermediate control point between the last position */
-  /*               and the new target in `to'.                             */
-  /*                                                                       */
-  /*    to      :: A pointer to the target end point of the conic arc.     */
-  /*                                                                       */
-  /*    user    :: A typeless pointer which is passed from the caller of   */
-  /*               the decomposition function.                             */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    Error code.  0 means success.                                      */
-  /*                                                                       */
-  typedef int
-  (*QT_FT_Outline_ConicToFunc)( QT_FT_Vector*  control,
-                             QT_FT_Vector*  to,
-                             void*       user );
-
-#define  QT_FT_Outline_ConicTo_Func  QT_FT_Outline_ConicToFunc
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <FuncType>                                                            */
-  /*    QT_FT_Outline_CubicToFunc                                          */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A function pointer type used to describe the signature of a `cubic */
-  /*    to' function during outline walking/decomposition.                 */
-  /*                                                                       */
-  /*    A `cubic to' is emitted to indicate a third-order Bezier arc.      */
-  /*                                                                       */
-  /* <Input>                                                               */
-  /*    control1 :: A pointer to the first Bezier control point.           */
-  /*                                                                       */
-  /*    control2 :: A pointer to the second Bezier control point.          */
-  /*                                                                       */
-  /*    to       :: A pointer to the target end point.                     */
-  /*                                                                       */
-  /*    user     :: A typeless pointer which is passed from the caller of  */
-  /*                the decomposition function.                            */
-  /*                                                                       */
-  /* <Return>                                                              */
-  /*    Error code.  0 means success.                                      */
-  /*                                                                       */
-  typedef int
-  (*QT_FT_Outline_CubicToFunc)( QT_FT_Vector*  control1,
-                             QT_FT_Vector*  control2,
-                             QT_FT_Vector*  to,
-                             void*       user );
-
-#define  QT_FT_Outline_CubicTo_Func  QT_FT_Outline_CubicToFunc
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Struct>                                                              */
-  /*    QT_FT_Outline_Funcs                                                */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A structure to hold various function pointers used during outline  */
-  /*    decomposition in order to emit segments, conic, and cubic Beziers, */
-  /*    as well as `move to' and `close to' operations.                    */
-  /*                                                                       */
-  /* <Fields>                                                              */
-  /*    move_to  :: The `move to' emitter.                                 */
-  /*                                                                       */
-  /*    line_to  :: The segment emitter.                                   */
-  /*                                                                       */
-  /*    conic_to :: The second-order Bezier arc emitter.                   */
-  /*                                                                       */
-  /*    cubic_to :: The third-order Bezier arc emitter.                    */
-  /*                                                                       */
-  /*    shift    :: The shift that is applied to coordinates before they   */
-  /*                are sent to the emitter.                               */
-  /*                                                                       */
-  /*    delta    :: The delta that is applied to coordinates before they   */
-  /*                are sent to the emitter, but after the shift.          */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    The point coordinates sent to the emitters are the transformed     */
-  /*    version of the original coordinates (this is important for high    */
-  /*    accuracy during scan-conversion).  The transformation is simple:   */
-  /*                                                                       */
-  /*      x' = (x << shift) - delta                                        */
-  /*      y' = (x << shift) - delta                                        */
-  /*                                                                       */
-  /*    Set the value of `shift' and `delta' to 0 to get the original      */
-  /*    point coordinates.                                                 */
-  /*                                                                       */
-  typedef struct  QT_FT_Outline_Funcs_
-  {
-    QT_FT_Outline_MoveToFunc   move_to;
-    QT_FT_Outline_LineToFunc   line_to;
-    QT_FT_Outline_ConicToFunc  conic_to;
-    QT_FT_Outline_CubicToFunc  cubic_to;
-
-    int                     shift;
-    QT_FT_Pos                  delta;
-
-  } QT_FT_Outline_Funcs;
-
-
   /*************************************************************************/
   /*                                                                       */
   /* <Section>                                                             */
@@ -514,98 +234,6 @@ QT_FT_BEGIN_HEADER
   /*                                                                       */
   /*************************************************************************/
 
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Macro>                                                               */
-  /*    QT_FT_IMAGE_TAG                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    This macro converts four letter tags into an unsigned long.        */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    Since many 16bit compilers don't like 32bit enumerations, you      */
-  /*    should redefine this macro in case of problems to something like   */
-  /*    this:                                                              */
-  /*                                                                       */
-  /*      #define QT_FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value      */
-  /*                                                                       */
-  /*    to get a simple enumeration without assigning special numbers.     */
-  /*                                                                       */
-#ifndef QT_FT_IMAGE_TAG
-#define QT_FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \
-          value = ( ( (unsigned long)_x1 << 24 ) | \
-                    ( (unsigned long)_x2 << 16 ) | \
-                    ( (unsigned long)_x3 << 8  ) | \
-                      (unsigned long)_x4         )
-#endif /* QT_FT_IMAGE_TAG */
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Enum>                                                                */
-  /*    QT_FT_Glyph_Format                                                    */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    An enumeration type used to describe the format of a given glyph   */
-  /*    image.  Note that this version of FreeType only supports two image */
-  /*    formats, even though future font drivers will be able to register  */
-  /*    their own format.                                                  */
-  /*                                                                       */
-  /* <Values>                                                              */
-  /*    QT_FT_GLYPH_FORMAT_NONE ::                                            */
-  /*      The value 0 is reserved and does describe a glyph format.        */
-  /*                                                                       */
-  /*    QT_FT_GLYPH_FORMAT_COMPOSITE ::                                       */
-  /*      The glyph image is a composite of several other images.  This    */
-  /*      format is _only_ used with @QT_FT_LOAD_NO_RECURSE, and is used to   */
-  /*      report compound glyphs (like accented characters).               */
-  /*                                                                       */
-  /*    QT_FT_GLYPH_FORMAT_OUTLINE ::                                         */
-  /*      The glyph image is a vertorial outline made of line segments     */
-  /*      and Bezier arcs; it can be described as an @QT_FT_Outline; you      */
-  /*      generally want to access the `outline' field of the              */
-  /*      @QT_FT_GlyphSlotRec structure to read it.                           */
-  /*                                                                       */
-  /*    QT_FT_GLYPH_FORMAT_PLOTTER ::                                         */
-  /*      The glyph image is a vectorial path with no inside/outside       */
-  /*      contours.  Some Type 1 fonts, like those in the Hershey family,  */
-  /*      contain glyphs in this format.  These are described as           */
-  /*      @QT_FT_Outline, but FreeType isn't currently capable of rendering   */
-  /*      them correctly.                                                  */
-  /*                                                                       */
-  typedef enum  QT_FT_Glyph_Format_
-  {
-    QT_FT_IMAGE_TAG( QT_FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),
-
-    QT_FT_IMAGE_TAG( QT_FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
-    QT_FT_IMAGE_TAG( QT_FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),
-    QT_FT_IMAGE_TAG( QT_FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )
-
-  } QT_FT_Glyph_Format;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Enum>                                                                */
-  /*    qt_ft_glyph_format_xxx                                             */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A list of decprecated constants.  Use the corresponding            */
-  /*    @QT_FT_Glyph_Format values instead.                                */
-  /*                                                                       */
-  /* <Values>                                                              */
-  /*    qt_ft_glyph_format_none      :: see @QT_FT_GLYPH_FORMAT_NONE       */
-  /*    qt_ft_glyph_format_composite :: see @QT_FT_GLYPH_FORMAT_COMPOSITE  */
-  /*    qt_ft_glyph_format_outline   :: see @QT_FT_GLYPH_FORMAT_OUTLINE    */
-  /*    qt_ft_glyph_format_plotter   :: see @QT_FT_GLYPH_FORMAT_PLOTTER    */
-  /*                                                                       */
-#define qt_ft_glyph_format_none       QT_FT_GLYPH_FORMAT_NONE
-#define qt_ft_glyph_format_composite  QT_FT_GLYPH_FORMAT_COMPOSITE
-#define qt_ft_glyph_format_outline    QT_FT_GLYPH_FORMAT_OUTLINE
-#define qt_ft_glyph_format_plotter    QT_FT_GLYPH_FORMAT_PLOTTER
-
-
   /*************************************************************************/
   /*************************************************************************/
   /*************************************************************************/
@@ -736,51 +364,6 @@ QT_FT_BEGIN_HEADER
 
 #define QT_FT_Raster_Span_Func   QT_FT_SpanFunc
 
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Enum>                                                                */
-  /*    QT_FT_RASTER_FLAG_XXX                                              */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    A list of bit flag constants as used in the `flags' field of a     */
-  /*    @QT_FT_Raster_Params structure.                                    */
-  /*                                                                       */
-  /* <Values>                                                              */
-  /*    QT_FT_RASTER_FLAG_DEFAULT :: This value is 0.                      */
-  /*                                                                       */
-  /*    QT_FT_RASTER_FLAG_AA      :: This flag is set to indicate that an  */
-  /*                              anti-aliased glyph image should be       */
-  /*                              generated.  Otherwise, it will be        */
-  /*                              monochrome (1-bit).                      */
-  /*                                                                       */
-  /*    QT_FT_RASTER_FLAG_DIRECT  :: This flag is set to indicate direct   */
-  /*                              rendering.  In this mode, client         */
-  /*                              applications must provide their own span */
-  /*                              callback.  This lets them directly       */
-  /*                              draw or compose over an existing bitmap. */
-  /*                              If this bit is not set, the target       */
-  /*                              pixmap's buffer _must_ be zeroed before  */
-  /*                              rendering.                               */
-  /*                                                                       */
-  /*                              Note that for now, direct rendering is   */
-  /*                              only possible with anti-aliased glyphs.  */
-  /*                                                                       */
-  /*    QT_FT_RASTER_FLAG_CLIP    :: This flag is only used in direct      */
-  /*                              rendering mode.  If set, the output will */
-  /*                              be clipped to a box specified in the     */
-  /*                              "clip_box" field of the QT_FT_Raster_Params */
-  /*                              structure.                               */
-  /*                                                                       */
-  /*                              Note that by default, the glyph bitmap   */
-  /*                              is clipped to the target pixmap, except  */
-  /*                              in direct rendering mode where all spans */
-  /*                              are generated if no clipping box is set. */
-  /*                                                                       */
-#define QT_FT_RASTER_FLAG_DEFAULT  0x0
-#define QT_FT_RASTER_FLAG_AA       0x1
-#define QT_FT_RASTER_FLAG_DIRECT   0x2
-#define QT_FT_RASTER_FLAG_CLIP     0x4
-
 
   /*************************************************************************/
   /*                                                                       */
@@ -875,9 +458,6 @@ QT_FT_BEGIN_HEADER
   /* <Input>                                                               */
   /*    raster    :: A handle to the new raster object.                    */
   /*                                                                       */
-  /*    pool_base :: The address in memory of the render pool.             */
-  /*                                                                       */
-  /*    pool_size :: The size in bytes of the render pool.                 */
   /*                                                                       */
   /* <Note>                                                                */
   /*    Rasters can ignore the render pool and rely on dynamic memory      */
@@ -886,8 +466,7 @@ QT_FT_BEGIN_HEADER
   /*    recommended for efficiency purposes.                               */
   /*                                                                       */
   typedef void
-  (*QT_FT_Raster_ResetFunc)( QT_FT_Raster       raster,
-                          char*  pool_base);
+  (*QT_FT_Raster_ResetFunc)( QT_FT_Raster       raster);
 
 #define  QT_FT_Raster_Reset_Func   QT_FT_Raster_ResetFunc
 
@@ -940,8 +519,6 @@ QT_FT_BEGIN_HEADER
   /*   A structure used to describe a given raster class to the library.   */
   /*                                                                       */
   /* <Fields>                                                              */
-  /*    glyph_format  :: The supported glyph format for this raster.       */
-  /*                                                                       */
   /*    raster_new    :: The raster constructor.                           */
   /*                                                                       */
   /*    raster_reset  :: Used to reset the render pool within the raster.  */
@@ -951,7 +528,6 @@ QT_FT_BEGIN_HEADER
   /*                                                                       */
   typedef struct  QT_FT_Raster_Funcs_
   {
-    QT_FT_Glyph_Format         glyph_format;
     QT_FT_Raster_NewFunc       raster_new;
     QT_FT_Raster_ResetFunc     raster_reset;
     QT_FT_Raster_RenderFunc    raster_render;
index ad9c5a2..8ee6d86 100644 (file)
@@ -79,9 +79,7 @@ QWindowSurface *QGLGraphicsSystem::createWindowSurface(QWidget *widget) const
         // provide proper buffer flipping, which should be faster than QX11GL's
         // blitting approach:
         QGraphicsView* qgv = qobject_cast<QGraphicsView*>(widget);
-        if (qgv && qgv->viewportUpdateMode() == QGraphicsView::FullViewportUpdate)
-            return new QGLWindowSurface(widget);
-        else
+        if (!qgv || qgv->viewportUpdateMode() != QGraphicsView::FullViewportUpdate)
             return new QX11GLWindowSurface(widget);
     }
 #endif