Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qpaintengine_x11.cpp File Reference

(f84e654a620a4f04817b70bd1e7eab8a09a25526)

#include <QtCore/qrandom.h>
#include <private/qpixmapcache_p.h>
#include <private/qpaintengine_p.h>
#include <private/qpainterpath_p.h>
#include <private/qdrawhelper_p.h>
#include <private/qfontengineglyphcache_p.h>
#include "qpaintengine_x11_p.h"
#include "qpolygonclipper_p.h"
#include "qtessellator_p.h"
#include "qpixmap_x11_p.h"
#include "qcolormap_x11_p.h"
#include "qt_x11_p.h"
#include "qxcbexport.h"
#include "qxcbnativepainting.h"
+ Include dependency graph for qpaintengine_x11.cpp:

Go to the source code of this file.

Classes

class  QX11PaintEnginePrivate
 
struct  QX11PaintEnginePrivate::qt_float_point
 
struct  HexString< T >
 
struct  QConcatenable< HexString< T > >
 

Macros

#define X11   qt_x11Data
 
#define DITHER_SIZE   16
 

Functions

QPixmap qt_pixmapForBrush (int brushStyle, bool invert)
 
QPixmap qt_toX11Pixmap (const QPixmap &pixmap)
 
Q_XCB_EXPORT Drawable qt_x11Handle (const QPaintDevice *pd)
 
static const QXcbX11Infoqt_x11Info (const QPaintDevice *pd)
 
GC Q_XCB_EXPORT qt_x11_get_pen_gc (QPainter *p)
 Returns the X11 specific pen GC for the painter p.
 
GC Q_XCB_EXPORT qt_x11_get_brush_gc (QPainter *p)
 Returns the X11 specific brush GC for the painter p.
 
static void x11SetClipRegion (Display *dpy, GC gc, GC gc2, Qt::HANDLE picture, const QRegion &r)
 
static void x11ClearClipRegion (Display *dpy, GC gc, GC gc2, Qt::HANDLE picture)
 
static QPixmap qt_patternForAlpha (uchar alpha, int screen)
 
static QPaintEngine::PaintEngineFeatures qt_decide_features ()
 
static bool clipLine (QLineF *line, const QRect &rect)
 
static QLine clipStraightLine (const QRect &clip, const QLine &l)
 
static void setCapStyle (int cap_style, GC gc)
 
Q_GUI_EXPORT void qt_x11_drawImage (const QRect &rect, const QPoint &pos, const QImage &image, Drawable hd, GC gc, Display *dpy, Visual *visual, int depth)
 
void qt_draw_tile (QPaintEngine *, qreal, qreal, qreal, qreal, const QPixmap &, qreal, qreal)
 

Variables

static const qreal aliasedCoordinateDelta = 0.5 - 0.015625
 
static const uchar base_dither_matrix [DITHER_SIZE][DITHER_SIZE]
 

Macro Definition Documentation

◆ DITHER_SIZE

#define DITHER_SIZE   16

Definition at line 397 of file qpaintengine_x11.cpp.

Referenced by qt_patternForAlpha().

◆ X11

Function Documentation

◆ clipLine()

static bool clipLine ( QLineF * line,
const QRect & rect )
static

Definition at line 728 of file qpaintengine_x11.cpp.

References Bottom, Left, line, p1, p2, rect, Right, and Top.

Referenced by QX11PaintEngine::drawLines(), QX11PaintEngine::drawLines(), and QGeoMapPolylineGeometry::updateSourcePoints().

+ Here is the caller graph for this function:

◆ clipStraightLine()

static QLine clipStraightLine ( const QRect & clip,
const QLine & l )
inlinestatic

Definition at line 875 of file qpaintengine_x11.cpp.

References QRect::bottom(), QRect::left(), QLine::p1(), QLine::p2(), Q_ASSERT, qBound(), QRect::right(), and QRect::top().

Referenced by QX11PaintEngine::drawRects().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_decide_features()

◆ qt_draw_tile()

void qt_draw_tile ( QPaintEngine * gc,
qreal x,
qreal y,
qreal w,
qreal h,
const QPixmap & pixmap,
qreal xOffset,
qreal yOffset )
extern

Definition at line 519 of file qpaintengine.cpp.

References gc(), and pixmap.

Referenced by QPaintEngine::drawTiledPixmap(), and QX11PaintEngine::drawTiledPixmap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_patternForAlpha()

static QPixmap qt_patternForAlpha ( uchar alpha,
int screen )
static

Definition at line 417 of file qpaintengine_x11.cpp.

References base_dither_matrix, DITHER_SIZE, QPixmapCache::find(), QImage::Format_ARGB32, QBitmap::fromImage(), QPixmapCache::insert(), qt_x11SetScreen(), and screen.

Referenced by QX11PaintEngine::updateBrush().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_pixmapForBrush()

QPixmap qt_pixmapForBrush ( int brushStyle,
bool invert )
extern

Definition at line 80 of file qbrush.cpp.

Referenced by QX11PaintEngine::updateBrush().

+ Here is the caller graph for this function:

◆ qt_toX11Pixmap()

QPixmap qt_toX11Pixmap ( const QPixmap & pixmap)
extern

Definition at line 62 of file qpixmap_x11.cpp.

References data_ptr(), pixmap, qt_toX11Pixmap(), and QPlatformPixmap::X11Class.

Referenced by QX11PaintEngine::drawPixmap(), and QX11PaintEngine::updateBrush().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_x11_drawImage()

Q_GUI_EXPORT void qt_x11_drawImage ( const QRect & rect,
const QPoint & pos,
const QImage & image,
Drawable hd,
GC gc,
Display * dpy,
Visual * visual,
int depth )

Definition at line 1960 of file qpaintengine_x11.cpp.

References QSysInfo::BigEndian, QImage::bits(), QSysInfo::ByteOrder, QImage::bytesPerLine(), QXcbX11Info::display(), QImage::Format_RGB32, gc(), i, QSysInfo::LittleEndian, pos, Q_ASSERT, and rect.

Referenced by QX11PaintEngine::drawImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_x11_get_brush_gc()

GC Q_XCB_EXPORT qt_x11_get_brush_gc ( QPainter * p)

Returns the X11 specific brush GC for the painter p.

Note that QPainter::begin() must be called before this function returns a valid GC.

Definition at line 273 of file qpaintengine_x11.cpp.

References gc(), and QTransform::TxNone.

+ Here is the call graph for this function:

◆ qt_x11_get_pen_gc()

GC Q_XCB_EXPORT qt_x11_get_pen_gc ( QPainter * p)

Returns the X11 specific pen GC for the painter p.

Note that QPainter::begin() must be called before this function returns a valid GC.

Definition at line 258 of file qpaintengine_x11.cpp.

◆ qt_x11Handle()

Q_XCB_EXPORT Drawable qt_x11Handle ( const QPaintDevice * pd)

Definition at line 219 of file qpaintengine_x11.cpp.

References QPaintDevice::devType(), QInternal::Pixmap, and qt_x11PixmapHandle().

Referenced by QX11PaintEngine::begin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_x11Info()

static const QXcbX11Info * qt_x11Info ( const QPaintDevice * pd)
static

Definition at line 234 of file qpaintengine_x11.cpp.

References QPaintDevice::devType(), QInternal::Pixmap, and qt_x11Info().

Referenced by QX11PaintEngine::begin(), QX11PaintEngine::drawPixmap(), QX11PaintEngine::drawTiledPixmap(), and qt_x11Info().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCapStyle()

static void setCapStyle ( int cap_style,
GC gc )
inlinestatic

Definition at line 1070 of file qpaintengine_x11.cpp.

References QXcbX11Info::display(), and gc().

Referenced by QX11PaintEngine::drawPoints(), and QX11PaintEngine::drawPoints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ x11ClearClipRegion()

static void x11ClearClipRegion ( Display * dpy,
GC gc,
GC gc2,
Qt::HANDLE picture )
inlinestatic

Definition at line 372 of file qpaintengine_x11.cpp.

References attrs, gc(), Q_UNUSED, and XNone.

Referenced by QX11PaintEngine::updateBrush(), QX11PaintEngine::updateClipRegion_dev(), and QX11PaintEngine::updatePen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ x11SetClipRegion()

static void x11SetClipRegion ( Display * dpy,
GC gc,
GC gc2,
Qt::HANDLE picture,
const QRegion & r )
inlinestatic

Definition at line 345 of file qpaintengine_x11.cpp.

References gc(), Q_UNUSED, and qt_region_to_xrectangles().

Referenced by QX11PaintEngine::updateBrush(), QX11PaintEngine::updateClipRegion_dev(), and QX11PaintEngine::updatePen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ aliasedCoordinateDelta

◆ base_dither_matrix

const uchar base_dither_matrix[DITHER_SIZE][DITHER_SIZE]
static
Initial value:
= {
{ 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 },
{ 128, 64,176,112,140, 76,188,124,131, 67,179,115,143, 79,191,127 },
{ 32,224, 16,208, 44,236, 28,220, 35,227, 19,211, 47,239, 31,223 },
{ 160, 96,144, 80,172,108,156, 92,163, 99,147, 83,175,111,159, 95 },
{ 8,200, 56,248, 4,196, 52,244, 11,203, 59,251, 7,199, 55,247 },
{ 136, 72,184,120,132, 68,180,116,139, 75,187,123,135, 71,183,119 },
{ 40,232, 24,216, 36,228, 20,212, 43,235, 27,219, 39,231, 23,215 },
{ 168,104,152, 88,164,100,148, 84,171,107,155, 91,167,103,151, 87 },
{ 2,194, 50,242, 14,206, 62,254, 1,193, 49,241, 13,205, 61,253 },
{ 130, 66,178,114,142, 78,190,126,129, 65,177,113,141, 77,189,125 },
{ 34,226, 18,210, 46,238, 30,222, 33,225, 17,209, 45,237, 29,221 },
{ 162, 98,146, 82,174,110,158, 94,161, 97,145, 81,173,109,157, 93 },
{ 10,202, 58,250, 6,198, 54,246, 9,201, 57,249, 5,197, 53,245 },
{ 138, 74,186,122,134, 70,182,118,137, 73,185,121,133, 69,181,117 },
{ 42,234, 26,218, 38,230, 22,214, 41,233, 25,217, 37,229, 21,213 },
{ 170,106,154, 90,166,102,150, 86,169,105,153, 89,165,101,149, 85 }
}

Definition at line 398 of file qpaintengine_x11.cpp.

Referenced by qt_patternForAlpha().