mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
remove the gray raster code
this is mostly for test purposes only. the removal will affect some of the widgets drawing, especially round corners (like the Plasma "Tool Box" and radio buttons with the Oxygen style). with previous tests some changes to the outline mapper (QOutlineMapper) were needed to fix some rounding issues but caused others so I am not sure if I can make it work well without the Freetype2 rasterizer but I sure will try, again, if I have the time for it. Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
f9a80a9d0f
commit
142d67c13e
6 changed files with 13 additions and 1635 deletions
|
@ -102,7 +102,6 @@ set(GUI_SOURCES
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/painting/qgraphicssystemplugin.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/painting/qwindowsurface_raster.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/painting/qprinterinfo_unix.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/painting/qgrayraster.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/painting/qcolormap_x11.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/painting/qpaintdevice_x11.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/painting/qpaintengine_x11.cpp
|
||||
|
|
|
@ -57,10 +57,6 @@
|
|||
#include "QtGui/qcolor.h"
|
||||
#include "QtGui/qpainter.h"
|
||||
#include "QtGui/qimage.h"
|
||||
#ifndef QT_FT_BEGIN_HEADER
|
||||
#define QT_FT_BEGIN_HEADER
|
||||
#define QT_FT_END_HEADER
|
||||
#endif
|
||||
#include "qrasterdefs_p.h"
|
||||
#include "qmath.h"
|
||||
#include "qmath_p.h"
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -58,9 +58,6 @@
|
|||
#include <QtGui/qtransform.h>
|
||||
#include <QtGui/qpainterpath.h>
|
||||
|
||||
#define QT_FT_BEGIN_HEADER
|
||||
#define QT_FT_END_HEADER
|
||||
|
||||
#include <qrasterdefs_p.h>
|
||||
#include <qdatabuffer_p.h>
|
||||
#include "qpaintengineex_p.h"
|
||||
|
|
|
@ -42,9 +42,6 @@
|
|||
#include <QtCore/qglobal.h>
|
||||
#include <QtCore/qmutex.h>
|
||||
|
||||
#define QT_FT_BEGIN_HEADER
|
||||
#define QT_FT_END_HEADER
|
||||
|
||||
#include <qrasterdefs_p.h>
|
||||
#include <qpainterpath.h>
|
||||
#include <qdebug.h>
|
||||
|
@ -2971,21 +2968,13 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
|
|||
if (!callback || !outline)
|
||||
return;
|
||||
|
||||
Q_Q(QRasterPaintEngine);
|
||||
QRasterPaintEngineState *s = q->state();
|
||||
initializeRasterizer(spanData);
|
||||
|
||||
if (!s->flags.antialiased) {
|
||||
initializeRasterizer(spanData);
|
||||
const Qt::FillRule fillRule = outline->flags == QT_FT_OUTLINE_NONE
|
||||
? Qt::WindingFill
|
||||
: Qt::OddEvenFill;
|
||||
|
||||
const Qt::FillRule fillRule = outline->flags == QT_FT_OUTLINE_NONE
|
||||
? Qt::WindingFill
|
||||
: Qt::OddEvenFill;
|
||||
|
||||
rasterizer->rasterize(outline, fillRule);
|
||||
return;
|
||||
}
|
||||
|
||||
rasterize(outline, callback, (void *)spanData);
|
||||
rasterizer->rasterize(outline, fillRule);
|
||||
}
|
||||
|
||||
void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
|
||||
|
@ -2998,34 +2987,15 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
|
|||
Q_Q(QRasterPaintEngine);
|
||||
QRasterPaintEngineState *s = q->state();
|
||||
|
||||
if (!s->flags.antialiased) {
|
||||
rasterizer->setAntialiased(s->flags.antialiased);
|
||||
rasterizer->setClipRect(deviceRect);
|
||||
rasterizer->initialize(callback, userData);
|
||||
rasterizer->setAntialiased(s->flags.antialiased);
|
||||
rasterizer->setClipRect(deviceRect);
|
||||
rasterizer->initialize(callback, userData);
|
||||
|
||||
const Qt::FillRule fillRule = outline->flags == QT_FT_OUTLINE_NONE
|
||||
? Qt::WindingFill
|
||||
: Qt::OddEvenFill;
|
||||
const Qt::FillRule fillRule = outline->flags == QT_FT_OUTLINE_NONE
|
||||
? Qt::WindingFill
|
||||
: Qt::OddEvenFill;
|
||||
|
||||
rasterizer->rasterize(outline, fillRule);
|
||||
return;
|
||||
}
|
||||
|
||||
gray_raster_reset();
|
||||
|
||||
QT_FT_BBox clip_box = { deviceRect.x(),
|
||||
deviceRect.y(),
|
||||
deviceRect.x() + deviceRect.width(),
|
||||
deviceRect.y() + deviceRect.height() };
|
||||
|
||||
QT_FT_Raster_Params rasterParams;
|
||||
rasterParams.source = outline;
|
||||
rasterParams.black_spans = 0;
|
||||
rasterParams.user = userData;
|
||||
rasterParams.clip_box = clip_box;
|
||||
rasterParams.gray_spans = callback;
|
||||
rasterParams.skip_spans = 0;
|
||||
gray_raster_render(&rasterParams);
|
||||
rasterizer->rasterize(outline, fillRule);
|
||||
}
|
||||
|
||||
QImage QRasterBuffer::colorizeBitmap(const QImage &image, const QColor &color)
|
||||
|
|
|
@ -72,8 +72,6 @@
|
|||
// We mean it.
|
||||
*/
|
||||
|
||||
QT_FT_BEGIN_HEADER
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
|
@ -116,32 +114,6 @@ QT_FT_BEGIN_HEADER
|
|||
|
||||
} QT_FT_Vector;
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* QT_FT_BBox */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure used to hold an outline's bounding box, i.e., the */
|
||||
/* coordinates of its extrema in the horizontal and vertical */
|
||||
/* directions. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* xMin :: The horizontal minimum (left-most). */
|
||||
/* */
|
||||
/* yMin :: The vertical minimum (bottom-most). */
|
||||
/* */
|
||||
/* xMax :: The horizontal maximum (right-most). */
|
||||
/* */
|
||||
/* yMax :: The vertical maximum (top-most). */
|
||||
/* */
|
||||
typedef struct QT_FT_BBox_
|
||||
{
|
||||
QT_FT_Pos xMin, yMin;
|
||||
QT_FT_Pos xMax, yMax;
|
||||
|
||||
} QT_FT_BBox;
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Section> */
|
||||
|
@ -274,18 +246,6 @@ QT_FT_BEGIN_HEADER
|
|||
/*************************************************************************/
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Type> */
|
||||
/* QT_FT_Raster */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A handle (pointer) to a raster object. Each object can be used */
|
||||
/* independently to convert an outline into a bitmap or pixmap. */
|
||||
/* */
|
||||
typedef struct TRaster_ *QT_FT_Raster;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
|
@ -316,7 +276,7 @@ QT_FT_BEGIN_HEADER
|
|||
{
|
||||
short x;
|
||||
unsigned short len;
|
||||
short y;
|
||||
short y;
|
||||
unsigned char coverage;
|
||||
} QT_FT_Span;
|
||||
|
||||
|
@ -362,136 +322,6 @@ QT_FT_BEGIN_HEADER
|
|||
const QT_FT_Span* spans,
|
||||
void* worker);
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
/* QT_FT_Raster_Params */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A structure to hold the arguments used by a raster's render */
|
||||
/* function. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* target :: The target bitmap. */
|
||||
/* */
|
||||
/* source :: A pointer to the source glyph image (e.g. an */
|
||||
/* QT_FT_Outline). */
|
||||
/* */
|
||||
/* flags :: The rendering flags. */
|
||||
/* */
|
||||
/* gray_spans :: The gray span drawing callback. */
|
||||
/* */
|
||||
/* black_spans :: The black span drawing callback. */
|
||||
/* */
|
||||
/* user :: User-supplied data that is passed to each drawing */
|
||||
/* callback. */
|
||||
/* */
|
||||
/* clip_box :: An optional clipping box. It is only used in */
|
||||
/* direct rendering mode. Note that coordinates here */
|
||||
/* should be expressed in _integer_ pixels (and not in */
|
||||
/* 26.6 fixed-point units). */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* An anti-aliased glyph bitmap is drawn if the QT_FT_RASTER_FLAG_AA bit */
|
||||
/* flag is set in the `flags' field, otherwise a monochrome bitmap */
|
||||
/* will be generated. */
|
||||
/* */
|
||||
/* If the QT_FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the */
|
||||
/* raster will call the `gray_spans' callback to draw gray pixel */
|
||||
/* spans, in the case of an aa glyph bitmap, it will call */
|
||||
/* `black_spans' in the case of a monochrome bitmap. This allows */
|
||||
/* direct composition over a pre-existing bitmap through */
|
||||
/* user-provided callbacks to perform the span drawing/composition. */
|
||||
/* */
|
||||
/* Note that the `bit_test' and `bit_set' callbacks are required when */
|
||||
/* rendering a monochrome bitmap, as they are crucial to implement */
|
||||
/* correct drop-out control as defined in the TrueType specification. */
|
||||
/* */
|
||||
typedef struct QT_FT_Raster_Params_
|
||||
{
|
||||
void* source;
|
||||
QT_FT_SpanFunc gray_spans;
|
||||
QT_FT_SpanFunc black_spans;
|
||||
void* user;
|
||||
QT_FT_BBox clip_box;
|
||||
int skip_spans;
|
||||
|
||||
} QT_FT_Raster_Params;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Func> */
|
||||
/* gray_raster_reset */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* FreeType provides an area of memory called the `render pool', */
|
||||
/* available to all registered rasters. This pool can be freely used */
|
||||
/* during a given scan-conversion but is shared by all rasters. Its */
|
||||
/* content is thus transient. */
|
||||
/* */
|
||||
/* This function is called each time the render pool changes, or just */
|
||||
/* after a new raster object is created. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* Rasters can ignore the render pool and rely on dynamic memory */
|
||||
/* allocation if they want to (a handle to the memory allocator is */
|
||||
/* passed to the raster constructor). However, this is not */
|
||||
/* recommended for efficiency purposes. */
|
||||
/* */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
void gray_raster_reset( );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Func> */
|
||||
/* gray_raster_render */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Invokes a given raster to scan-convert a given glyph image into a */
|
||||
/* target bitmap. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* raster :: A handle to the raster object. */
|
||||
/* */
|
||||
/* params :: A pointer to a QT_FT_Raster_Params structure used to store */
|
||||
/* the rendering parameters. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* Error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* The exact format of the source image depends on the raster's glyph */
|
||||
/* format defined in its QT_FT_Raster_Funcs structure. It can be an */
|
||||
/* QT_FT_Outline or anything else in order to support a large array of */
|
||||
/* glyph formats. */
|
||||
/* */
|
||||
/* Note also that the render function can fail and return a */
|
||||
/* QT_FT_Err_Unimplemented_Feature error code if the raster used does */
|
||||
/* not support direct composition. */
|
||||
/* */
|
||||
/* XXX: For now, the standard raster doesn't support direct */
|
||||
/* composition but this should change for the final release (see */
|
||||
/* the files demos/src/ftgrays.c and demos/src/ftgrays2.c for */
|
||||
/* examples of distinct implementations which support direct */
|
||||
/* composition). */
|
||||
/* */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int gray_raster_render( const QT_FT_Raster_Params* params );
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Minimum buffer size for raster object, that accounts for TWorker and */
|
||||
/* TCell sizes. */
|
||||
/* */
|
||||
#define RASTER_POOL_SIZE 8192
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* Any higher and rasterization of shapes will produce incorrect */
|
||||
|
@ -501,9 +331,6 @@ QT_FT_BEGIN_HEADER
|
|||
|
||||
/* */
|
||||
|
||||
|
||||
QT_FT_END_HEADER
|
||||
|
||||
#endif /* __FTIMAGE_H__ */
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue