From: Ivailo Monev Date: Mon, 22 Aug 2016 01:26:43 +0000 (+0000) Subject: mostly rasterizer cleanup X-Git-Tag: 4.12.0~6811 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2dff72714d4e42e0008862186aa9f8832ff7fa61;p=kde%2FKatie.git mostly rasterizer cleanup Signed-off-by: Ivailo Monev --- diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c index 9588f6ad0..734c7a978 100644 --- a/src/gui/painting/qgrayraster.c +++ b/src/gui/painting/qgrayraster.c @@ -266,8 +266,8 @@ qt_ft_jmp_buf jump_buffer; - void* buffer; - long buffer_size; + char* buffer; + int buffer_size; PCell* ycells; int ycount; @@ -278,8 +278,8 @@ typedef struct TRaster_ { - void* buffer; - long buffer_size; + char* buffer; + int buffer_size; int band_size; PWorker worker; @@ -1234,8 +1234,8 @@ 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; @@ -1415,41 +1415,28 @@ 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, diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 3c337b369..1248c3490 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -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(), diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index b7dccb1dd..f8f65e3a4 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -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 -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 -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 -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(a, t); - bool outB = compare(b, t); + bool outA = compare(a, t, edge); + bool outB = compare(b, t, edge); if (outA && outB) return; if (outA) - addLine(result, QLineF(intersectLine(a, b, t), b)); + addLine(result, QLineF(intersectLine(a, b, t, edge), b)); else if(outB) - addLine(result, QLineF(a, intersectLine(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 -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(a, t); - bool outB = compare(b, t); - bool outC = compare(c, t); - bool outD = compare(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(points[i], t); - outB = compare(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 -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(path.elementAt(i-1), path.elementAt(i), t, result); + clipLine(path.elementAt(i-1), path.elementAt(i), t, result, edge); } else { - clipBezier(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(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 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(subPath, rect.left()); + subPath = clip(subPath, rect.left(), Left); if (bounds.right() > rect.right()) - subPath = clip(subPath, rect.right()); + subPath = clip(subPath, rect.right(), Right); bounds = subPath.boundingRect(); if (bounds.top() < rect.top()) - subPath = clip(subPath, rect.top()); + subPath = clip(subPath, rect.top(), Top); if (bounds.bottom() > rect.bottom()) - subPath = clip(subPath, rect.bottom()); + subPath = clip(subPath, rect.bottom(), Bottom); if (subPath.elementCount() > 1) result.addPath(subPath); diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h index c0daf3a77..2a07755a6 100644 --- a/src/gui/painting/qpathclipper_p.h +++ b/src/gui/painting/qpathclipper_p.h @@ -56,7 +56,6 @@ #include #include -#include #include #include diff --git a/src/gui/painting/qrasterdefs_p.h b/src/gui/painting/qrasterdefs_p.h index 90431b2e7..341fe809d 100644 --- a/src/gui/painting/qrasterdefs_p.h +++ b/src/gui/painting/qrasterdefs_p.h @@ -116,7 +116,6 @@ QT_FT_BEGIN_HEADER } QT_FT_Vector; - /*************************************************************************/ /* */ /* */ @@ -143,68 +142,6 @@ QT_FT_BEGIN_HEADER } QT_FT_BBox; - - /*************************************************************************/ - /* */ - /* */ - /* QT_FT_Pixel_Mode */ - /* */ - /* */ - /* An enumeration type used to describe the format of pixels in a */ - /* given bitmap. Note that additional formats may be added in the */ - /* future. */ - /* */ - /* */ - /* 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; - /*************************************************************************/ /* */ /*
*/ @@ -275,62 +212,13 @@ QT_FT_BEGIN_HEADER /* */ /* 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 - - /*************************************************************************/ - /* */ - /* */ - /* QT_FT_Outline_MoveToFunc */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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 - - /*************************************************************************/ - /* */ - /* */ - /* QT_FT_Outline_LineToFunc */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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 - - /*************************************************************************/ - /* */ - /* */ - /* QT_FT_Outline_ConicToFunc */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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 - - /*************************************************************************/ - /* */ - /* */ - /* QT_FT_Outline_CubicToFunc */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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 - - - /*************************************************************************/ - /* */ - /* */ - /* QT_FT_Outline_Funcs */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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; - - /*************************************************************************/ /* */ /*
*/ @@ -514,98 +234,6 @@ QT_FT_BEGIN_HEADER /* */ /*************************************************************************/ - - /*************************************************************************/ - /* */ - /* */ - /* QT_FT_IMAGE_TAG */ - /* */ - /* */ - /* This macro converts four letter tags into an unsigned long. */ - /* */ - /* */ - /* 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 */ - - - /*************************************************************************/ - /* */ - /* */ - /* QT_FT_Glyph_Format */ - /* */ - /* */ - /* 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. */ - /* */ - /* */ - /* 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; - - - /*************************************************************************/ - /* */ - /* */ - /* qt_ft_glyph_format_xxx */ - /* */ - /* */ - /* A list of decprecated constants. Use the corresponding */ - /* @QT_FT_Glyph_Format values instead. */ - /* */ - /* */ - /* 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 - /*************************************************************************/ - /* */ - /* */ - /* QT_FT_RASTER_FLAG_XXX */ - /* */ - /* */ - /* A list of bit flag constants as used in the `flags' field of a */ - /* @QT_FT_Raster_Params structure. */ - /* */ - /* */ - /* 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 /* */ /* 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. */ /* */ /* */ /* 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. */ /* */ /* */ - /* 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; diff --git a/src/opengl/qgraphicssystem_gl.cpp b/src/opengl/qgraphicssystem_gl.cpp index ad9c5a208..8ee6d860b 100644 --- a/src/opengl/qgraphicssystem_gl.cpp +++ b/src/opengl/qgraphicssystem_gl.cpp @@ -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(widget); - if (qgv && qgv->viewportUpdateMode() == QGraphicsView::FullViewportUpdate) - return new QGLWindowSurface(widget); - else + if (!qgv || qgv->viewportUpdateMode() != QGraphicsView::FullViewportUpdate) return new QX11GLWindowSurface(widget); } #endif