Qt 4.8
Public Functions | Public Variables | Friends | List of all members
QOpenGLPaintEnginePrivate Class Reference
Inheritance diagram for QOpenGLPaintEnginePrivate:
QPaintEngineExPrivate QPaintEnginePrivate

Public Functions

void addItem (const QGLMaskTextureCache::CacheLocation &location)
 
void cacheItemErased (int channel, const QRect &rect)
 
void cleanupGLContextRefs (const QGLContext *context)
 
void composite (const QRectF &rect, const QPoint &maskOffset=QPoint())
 
void composite (GLuint primitive, const GLfloat *vertexArray, int vertexCount, const QPoint &maskOffset=QPoint())
 
void copyDrawable (const QRectF &rect)
 
bool createFragmentPrograms ()
 
void createGradientPaletteTexture (const QGradient &g)
 
void curveToStencil (const QPointF &cp1, const QPointF &cp2, const QPointF &ep)
 
void deleteFragmentPrograms ()
 
void disableClipping ()
 
void drawFastRect (const QRectF &rect)
 
void drawImageAsPath (const QRectF &r, const QImage &img, const QRectF &sr)
 
void drawItem (const QDrawQueueItem &item)
 
void drawOffscreenPath (const QPainterPath &path)
 
void drawTiledImageAsPath (const QRectF &r, const QImage &img, qreal sx, qreal sy, const QPointF &offset)
 
void drawVertexArrays ()
 
void enableClipping ()
 
void ensureDrawableTexture ()
 
void fillPath (const QPainterPath &path)
 
void fillPolygon_dev (const QPointF *polygonPoints, int pointCount, Qt::FillRule fill)
 
void fillVertexArray (Qt::FillRule fillRule)
 
void flushDrawQueue ()
 
bool isFastRect (const QRectF &r)
 
void lineToStencil (qreal x, qreal y)
 
void pathToVertexArrays (const QPainterPath &path)
 
 QOpenGLPaintEnginePrivate ()
 
void setGLBrush (const QColor &c)
 
void setGLPen (const QColor &c)
 
void setGradientOps (const QBrush &brush, const QRectF &bounds)
 
void setInvMatrixData (const QTransform &inv_matrix)
 
void setPorterDuffData (float a, float b, float x, float y, float z)
 
void strokeLines (const QPainterPath &path)
 
void strokePath (const QPainterPath &path, bool use_cache)
 
void strokePathFastPen (const QPainterPath &path, bool needsResolving)
 
void systemStateChanged ()
 
void updateDepthClip ()
 
void updateFastPen ()
 
void updateFragmentProgramData (int locations[])
 
void updateGLMatrix () const
 
void updateGradient (const QBrush &brush, const QRectF &bounds)
 
void updateUseEmulation ()
 
- Public Functions inherited from QPaintEngineExPrivate
bool hasClipOperations () const
 
 QPaintEngineExPrivate ()
 
void replayClipOperations ()
 
 ~QPaintEngineExPrivate ()
 
- Public Functions inherited from QPaintEnginePrivate
void drawBoxTextItem (const QPointF &p, const QTextItemInt &ti)
 
 QPaintEnginePrivate ()
 
void setSystemTransform (const QTransform &xform)
 
void setSystemViewport (const QRegion &region)
 
void transformSystemClip ()
 
virtual ~QPaintEnginePrivate ()
 

Public Variables

float angle_data [4]
 
GLubyte brush_color [4]
 
QPointF brush_origin
 
Qt::BrushStyle brush_style
 
QBrush cbrush
 
QPainter::CompositionMode composition_mode
 
QPen cpen
 
Qt::BrushStyle current_style
 
QGLPaintDevicedevice
 
uint dirty_drawable_texture: 1
 
QRegion dirty_stencil
 
GLuint drawable_texture
 
QSize drawable_texture_size
 
QList< QDrawQueueItemdrawQueue
 
float fmp2_m_radius2_data [4]
 
float fmp_data [4]
 
FragmentBrushType fragment_brush
 
FragmentCompositionModeType fragment_composition_mode
 
GLuint grad_palette
 
uint has_antialiasing: 1
 
uint has_brush: 1
 
uint has_fast_composition_mode: 1
 
uint has_fast_pen: 1
 
uint has_pen: 1
 
uint has_stencil_face_ext: 1
 
uint high_quality_antialiasing: 1
 
float inv_matrix_data [3][4]
 
qreal inverseScale
 
QPainterStatelast_created_state
 
float linear_data [4]
 
float mask_channel_data [4]
 
GLuint mask_fragment_programs [num_fragment_masks]
 
float mask_offset_data [4]
 
QTransform matrix
 
int max_texture_size
 
qreal max_x
 
qreal max_y
 
qreal min_x
 
qreal min_y
 
int moveToCount
 
GLdouble mv_matrix [4][4]
 
QGLOffscreen offscreen
 
qreal opacity
 
GLuint painter_fragment_programs [num_fragment_brushes][num_fragment_composition_modes]
 
QPointF path_start
 
Qt::BrushStyle pen_brush_style
 
GLubyte pen_color [4]
 
float porterduff_ab_data [4]
 
float porterduff_xyz_data [4]
 
GLdouble projection_matrix [4][4]
 
QGLPrivateCleanup ref_cleaner
 
QGLContextshader_ctx
 
QDataBuffer< QPointFtess_points
 
QVector< int > tess_points_stops
 
QTransform::TransformationType txop
 
uint use_emulation: 1
 
uint use_fragment_programs: 1
 
uint use_smooth_pixmap_transform: 1
 
uint use_stencil_method: 1
 
uint use_system_clip: 1
 
- Public Variables inherited from QPaintEngineExPrivate
QStrokerOpsactiveStroker
 
QDashStroker dasher
 
QRect exDeviceRect
 
StrokeHandlerstrokeHandler
 
QStroker stroker
 
QPen strokerPen
 
- Public Variables inherited from QPaintEnginePrivate
QWidgetcurrentClipWidget
 
uint hasSystemTransform: 1
 
uint hasSystemViewport: 1
 
QPaintDevicepdev
 
QPaintEngineq_ptr
 
QRegion systemClip
 
QRect systemRect
 
QTransform systemTransform
 
QRegion systemViewport
 

Friends

class QGLMaskTextureCache
 

Detailed Description

Definition at line 650 of file qpaintengine_opengl.cpp.

Constructors and Destructors

◆ QOpenGLPaintEnginePrivate()

QOpenGLPaintEnginePrivate::QOpenGLPaintEnginePrivate ( )
inline

Definition at line 654 of file qpaintengine_opengl.cpp.

655  : opacity(1)
657  , has_pen(false)
658  , has_brush(false)
659  , has_fast_pen(false)
660  , use_stencil_method(false)
661  , dirty_drawable_texture(false)
662  , has_stencil_face_ext(false)
663  , use_fragment_programs(false)
666  , use_emulation(false)
668  , inverseScale(1)
669  , moveToCount(0)
670  , last_created_state(0)
671  , shader_ctx(0)
672  , grad_palette(0)
673  , tess_points(0)
674  , drawable_texture(0)
675  , ref_cleaner(this)
676  {}
QTransform::TransformationType txop
QPainter::CompositionMode composition_mode
QDataBuffer< QPointF > tess_points

Functions

◆ addItem()

void QOpenGLPaintEnginePrivate::addItem ( const QGLMaskTextureCache::CacheLocation location)

◆ cacheItemErased()

void QOpenGLPaintEnginePrivate::cacheItemErased ( int  channel,
const QRect rect 
)

Definition at line 5321 of file qpaintengine_opengl.cpp.

5322 {
5323  bool isInDrawQueue = false;
5324 
5325  foreach (const QDrawQueueItem &item, drawQueue) {
5326  if (item.location.channel == channel && item.location.rect == rect) {
5327  isInDrawQueue = true;
5328  break;
5329  }
5330  }
5331 
5332  if (isInDrawQueue)
5333  flushDrawQueue();
5334 }
QGLMaskTextureCache::CacheLocation location
QList< QDrawQueueItem > drawQueue

◆ cleanupGLContextRefs()

void QOpenGLPaintEnginePrivate::cleanupGLContextRefs ( const QGLContext context)
inline

Definition at line 716 of file qpaintengine_opengl.cpp.

716  {
717  if (context == shader_ctx)
718  shader_ctx = 0;
719  }

◆ composite() [1/2]

void QOpenGLPaintEnginePrivate::composite ( const QRectF rect,
const QPoint maskOffset = QPoint() 
)

Definition at line 5189 of file qpaintengine_opengl.cpp.

5190 {
5191 #ifdef Q_WS_QWS
5192  Q_UNUSED(rect);
5193  Q_UNUSED(maskOffset);
5194 #else
5195  GLfloat vertexArray[8];
5196  qt_add_rect_to_array(rect, vertexArray);
5197 
5198  composite(GL_TRIANGLE_FAN, vertexArray, 4, maskOffset);
5199 #endif
5200 }
#define GL_TRIANGLE_FAN
void composite(const QRectF &rect, const QPoint &maskOffset=QPoint())
void qt_add_rect_to_array(const QRectF &r, GLfloat *array)
Definition: qgl.cpp:2972
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ composite() [2/2]

void QOpenGLPaintEnginePrivate::composite ( GLuint  primitive,
const GLfloat *  vertexArray,
int  vertexCount,
const QPoint maskOffset = QPoint() 
)

Definition at line 5203 of file qpaintengine_opengl.cpp.

5204 {
5205 #ifdef QT_OPENGL_ES
5206  Q_UNUSED(primitive);
5207  Q_UNUSED(vertexArray);
5208  Q_UNUSED(vertexCount);
5209  Q_UNUSED(maskOffset);
5210 #else
5213 
5214  if (current_style == Qt::NoBrush)
5215  return;
5216 
5217  DEBUG_ONCE qDebug() << "QOpenGLPaintEnginePrivate: Using compositing program: fragment_brush ="
5218  << fragment_brush << ", fragment_composition_mode =" << fragment_composition_mode;
5219 
5221  q->updateCompositionMode(composition_mode);
5222  else {
5223  qreal minX = 1e9, minY = 1e9, maxX = -1e9, maxY = -1e9;
5224 
5225  for (int i = 0; i < vertexCount; ++i) {
5226  qreal x = vertexArray[2 * i];
5227  qreal y = vertexArray[2 * i + 1];
5228 
5229  qreal tx, ty;
5230  matrix.map(x, y, &tx, &ty);
5231 
5232  minX = qMin(minX, tx);
5233  minY = qMin(minY, ty);
5234  maxX = qMax(maxX, tx);
5235  maxY = qMax(maxY, ty);
5236  }
5237 
5238  QRectF r(minX, minY, maxX - minX, maxY - minY);
5239  copyDrawable(r);
5240 
5241  glBlendFunc(GL_ONE, GL_ZERO);
5242  }
5243 
5245 
5246  int texture_locations[] = { locations[VAR_DST_TEXTURE],
5247  locations[VAR_MASK_TEXTURE],
5248  locations[VAR_PALETTE] };
5249 
5250  int brush_texture_location = locations[VAR_BRUSH_TEXTURE];
5251 
5252  GLuint texture_targets[] = { GL_TEXTURE_2D,
5253  GL_TEXTURE_2D,
5254  GL_TEXTURE_1D };
5255 
5256  GLuint textures[] = { drawable_texture,
5258  grad_palette };
5259 
5260  const int num_textures = sizeof(textures) / sizeof(*textures);
5261 
5262  Q_ASSERT(num_textures == sizeof(texture_locations) / sizeof(*texture_locations));
5263  Q_ASSERT(num_textures == sizeof(texture_targets) / sizeof(*texture_targets));
5264 
5265  for (int i = 0; i < num_textures; ++i)
5266  if (texture_locations[i] >= 0) {
5267  glActiveTexture(GL_TEXTURE0 + texture_locations[i]);
5268  glBindTexture(texture_targets[i], textures[i]);
5269  }
5270 
5271  if (brush_texture_location >= 0) {
5272  glActiveTexture(GL_TEXTURE0 + brush_texture_location);
5273 
5277  else
5279  GL_TEXTURE_2D, GL_RGBA,
5281 
5283  }
5284 
5285  glEnableClientState(GL_VERTEX_ARRAY);
5286  glVertexPointer(2, GL_FLOAT, 0, vertexArray);
5287  glEnable(GL_FRAGMENT_PROGRAM_ARB);
5288  GLuint program = qt_gl_program_cache()->getProgram(device->context(),
5290  fragment_composition_mode, false);
5292 
5293  mask_offset_data[0] = maskOffset.x();
5294  mask_offset_data[1] = -maskOffset.y();
5295 
5296  updateFragmentProgramData(locations);
5297 
5298  glDrawArrays(primitive, 0, vertexCount);
5299 
5300  glDisable(GL_FRAGMENT_PROGRAM_ARB);
5301  glDisableClientState(GL_VERTEX_ARRAY);
5302 
5303  for (int i = 0; i < num_textures; ++i)
5304  if (texture_locations[i] >= 0) {
5305  glActiveTexture(GL_TEXTURE0 + texture_locations[i]);
5306  glBindTexture(texture_targets[i], 0);
5307  }
5308 
5309  if (brush_texture_location >= 0) {
5310  glActiveTexture(GL_TEXTURE0 + brush_texture_location);
5311  glBindTexture(GL_TEXTURE_2D, 0);
5312  }
5313 
5315 
5317  q->updateCompositionMode(composition_mode);
5318 #endif
5319 }
Q_GUI_EXPORT QImage qt_imageForBrush(int brushStyle, bool invert)
Definition: qbrush.cpp:167
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
#define QGL_FUNC_CONTEXT
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
GLuint bindTexture(const QImage &image, GLenum target, GLint format, BindOptions options)
Generates and binds a 2D GL texture to the current context, based on image.
Definition: qgl.cpp:2854
#define GL_TEXTURE_2D
virtual QGLContext * context() const =0
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define Q_Q(Class)
Definition: qglobal.h:2483
#define GL_REPEAT
void copyDrawable(const QRectF &rect)
Q_CORE_EXPORT void qDebug(const char *,...)
#define GL_TEXTURE0
Definition: glfunctions.h:61
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
void updateFragmentProgramData(int locations[])
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...
static int painter_variable_locations[num_fragment_brushes][num_fragment_composition_modes][num_fragment_variables]
#define GL_FLOAT
#define GL_ZERO
QPainter::CompositionMode composition_mode
#define glActiveTexture
Definition: glfunctions.h:69
GLuint offscreenTexture() const
static void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform)
#define DEBUG_ONCE
#define GL_FRAGMENT_PROGRAM_ARB
FragmentCompositionModeType fragment_composition_mode
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
#define GL_RGBA
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
QImage textureImage() const
Returns the custom brush pattern, or a null image if no custom brush pattern has been set...
Definition: qbrush.cpp:829
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
#define glBindProgramARB
#define GL_ONE

◆ copyDrawable()

void QOpenGLPaintEnginePrivate::copyDrawable ( const QRectF rect)

Definition at line 5167 of file qpaintengine_opengl.cpp.

5168 {
5169 #ifdef Q_WS_QWS
5170  Q_UNUSED(rect);
5171 #else
5173 
5174  DEBUG_ONCE qDebug() << "Refreshing drawable_texture for rectangle" << rect;
5175  QRectF screen_rect = rect.adjusted(-1, -1, 1, 1);
5176 
5177  int left = qMax(0, static_cast<int>(screen_rect.left()));
5178  int width = qMin(device->size().width() - left, static_cast<int>(screen_rect.width()) + 1);
5179 
5180  int bottom = qMax(0, static_cast<int>(device->size().height() - screen_rect.bottom()));
5181  int height = qMin(device->size().height() - bottom, static_cast<int>(screen_rect.height()) + 1);
5182 
5183  glBindTexture(GL_TEXTURE_2D, drawable_texture);
5184  glCopyTexSubImage2D(GL_TEXTURE_2D, 0, left, bottom, left, bottom, width, height);
5185 #endif
5186 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
qreal left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:525
virtual QSize size() const =0
#define GL_TEXTURE_2D
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
Q_CORE_EXPORT void qDebug(const char *,...)
int width() const
Returns the width.
Definition: qsize.h:126
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition: qrect.h:781
#define DEBUG_ONCE
int height() const
Returns the height.
Definition: qsize.h:129
qreal bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:528
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ createFragmentPrograms()

bool QOpenGLPaintEnginePrivate::createFragmentPrograms ( )

◆ createGradientPaletteTexture()

void QOpenGLPaintEnginePrivate::createGradientPaletteTexture ( const QGradient g)

Definition at line 1174 of file qpaintengine_opengl.cpp.

1175 {
1176 #ifdef QT_OPENGL_ES //###
1177  Q_UNUSED(g);
1178 #else
1179  GLuint texId = qt_opengl_gradient_cache()->getBuffer(g, opacity, device->context());
1180  glBindTexture(GL_TEXTURE_1D, texId);
1181  grad_palette = texId;
1183  glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
1184  else if (g.spread() == QGradient::ReflectSpread)
1185  glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT_IBM);
1186  else
1187  glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
1188 
1189  glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1190  glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
1191 
1192 #endif
1193 }
#define GL_CLAMP_TO_EDGE
Definition: glfunctions.h:62
#define GL_TEXTURE_MIN_FILTER
#define GL_TEXTURE_WRAP_S
virtual QGLContext * context() const =0
#define GL_REPEAT
#define GL_MIRRORED_REPEAT_IBM
#define GL_LINEAR
Type type() const
Returns the type of gradient.
Definition: qbrush.h:232
Spread spread() const
Returns the spread method use by this gradient.
Definition: qbrush.h:235
#define GL_TEXTURE_MAG_FILTER
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ curveToStencil()

void QOpenGLPaintEnginePrivate::curveToStencil ( const QPointF cp1,
const QPointF cp2,
const QPointF ep 
)
inline

Definition at line 1893 of file qpaintengine_opengl.cpp.

1894 {
1895  qreal inverseScaleHalf = inverseScale / 2;
1896 
1897  QBezier beziers[32];
1898  beziers[0] = QBezier::fromPoints(tess_points.last(), cp1, cp2, ep);
1899  QBezier *b = beziers;
1900  while (b >= beziers) {
1901  // check if we can pop the top bezier curve from the stack
1902  qreal l = qAbs(b->x4 - b->x1) + qAbs(b->y4 - b->y1);
1903  qreal d;
1904  if (l > inverseScale) {
1905  d = qAbs( (b->x4 - b->x1)*(b->y1 - b->y2) - (b->y4 - b->y1)*(b->x1 - b->x2) )
1906  + qAbs( (b->x4 - b->x1)*(b->y1 - b->y3) - (b->y4 - b->y1)*(b->x1 - b->x3) );
1907  d /= l;
1908  } else {
1909  d = qAbs(b->x1 - b->x2) + qAbs(b->y1 - b->y2) +
1910  qAbs(b->x1 - b->x3) + qAbs(b->y1 - b->y3);
1911  }
1912  if (d < inverseScaleHalf || b == beziers + 31) {
1913  // good enough, we pop it off and add the endpoint
1914  lineToStencil(b->x4, b->y4);
1915  --b;
1916  } else {
1917  // split, second half of the polygon goes lower into the stack
1918  b->split(b+1, b);
1919  ++b;
1920  }
1921  }
1922 }
double d
Definition: qnumeric_p.h:62
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
static QBezier fromPoints(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4)
Definition: qbezier.cpp:71
Type & last()
Definition: qdatabuffer_p.h:88
void lineToStencil(qreal x, qreal y)
QFactoryLoader * l
QDataBuffer< QPointF > tess_points

◆ deleteFragmentPrograms()

void QOpenGLPaintEnginePrivate::deleteFragmentPrograms ( )

◆ disableClipping()

void QOpenGLPaintEnginePrivate::disableClipping ( )

Definition at line 2228 of file qpaintengine_opengl.cpp.

2229 {
2230  glDisable(GL_DEPTH_TEST);
2231  glDisable(GL_SCISSOR_TEST);
2232 }
#define GL_DEPTH_TEST
#define GL_SCISSOR_TEST

◆ drawFastRect()

void QOpenGLPaintEnginePrivate::drawFastRect ( const QRectF rect)

Definition at line 3406 of file qpaintengine_opengl.cpp.

3407 {
3409  DEBUG_ONCE_STR("QOpenGLPaintEngine::drawRects(): drawing fast rect");
3410 
3411  GLfloat vertexArray[10];
3412  qt_add_rect_to_array(r, vertexArray);
3413 
3414  if (has_pen)
3416 
3417  if (has_brush) {
3418  flushDrawQueue();
3419 
3420  bool temp = high_quality_antialiasing;
3421  high_quality_antialiasing = false;
3422 
3423  q->updateCompositionMode(composition_mode);
3424 
3425  setGradientOps(cbrush, r);
3426 
3427  bool fast_style = current_style == Qt::LinearGradientPattern
3429 
3430  if (fast_style && has_fast_composition_mode) {
3431  glEnableClientState(GL_VERTEX_ARRAY);
3432  glVertexPointer(2, GL_FLOAT, 0, vertexArray);
3433  glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
3434  glDisableClientState(GL_VERTEX_ARRAY);
3435  } else {
3436  composite(r);
3437  }
3438 
3440 
3441  q->updateCompositionMode(composition_mode);
3442  }
3443 
3444  if (has_pen) {
3446  setGradientOps(cpen.brush(), r);
3447 
3448  vertexArray[8] = vertexArray[0];
3449  vertexArray[9] = vertexArray[1];
3450 
3451  glVertexPointer(2, GL_FLOAT, 0, vertexArray);
3452  glEnableClientState(GL_VERTEX_ARRAY);
3453  glDrawArrays(GL_LINE_STRIP, 0, 5);
3454  glDisableClientState(GL_VERTEX_ARRAY);
3455  } else {
3456  QPainterPath path;
3458 
3459  qreal left = r.left();
3460  qreal right = r.right();
3461  qreal top = r.top();
3462  qreal bottom = r.bottom();
3463 
3464  path.moveTo(left, top);
3465  path.lineTo(right, top);
3466  path.lineTo(right, bottom);
3467  path.lineTo(left, bottom);
3468  path.lineTo(left, top);
3469 
3470  strokePath(path, false);
3471  }
3472 
3474  }
3475 }
#define DEBUG_ONCE_STR(str)
double qreal
Definition: qglobal.h:1193
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
void strokePath(const QPainterPath &path, bool use_cache)
static void disableOffset(QOpenGLPaintEnginePrivate *d)
#define Q_Q(Class)
Definition: qglobal.h:2483
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
void setFillRule(Qt::FillRule fillRule)
Sets the fill rule of the painter path to the given fillRule.
QTextStream & right(QTextStream &stream)
Calls QTextStream::setFieldAlignment(QTextStream::AlignRight) on stream and returns stream...
static void enableOffset(QOpenGLPaintEnginePrivate *d)
#define GL_TRIANGLE_FAN
void setGradientOps(const QBrush &brush, const QRectF &bounds)
#define GL_FLOAT
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
Definition: qpen.cpp:797
QPainter::CompositionMode composition_mode
#define GL_LINE_STRIP
void composite(const QRectF &rect, const QPoint &maskOffset=QPoint())
void qt_add_rect_to_array(const QRectF &r, GLfloat *array)
Definition: qgl.cpp:2972
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
QTextStream & left(QTextStream &stream)
Calls QTextStream::setFieldAlignment(QTextStream::AlignLeft) on stream and returns stream...

◆ drawImageAsPath()

void QOpenGLPaintEnginePrivate::drawImageAsPath ( const QRectF r,
const QImage img,
const QRectF sr 
)

Definition at line 4222 of file qpaintengine_opengl.cpp.

4223 {
4224  QBrush old_brush = cbrush;
4225  QPointF old_brush_origin = brush_origin;
4226 
4227  qreal scaleX = r.width() / sr.width();
4228  qreal scaleY = r.height() / sr.height();
4229 
4230  QTransform brush_matrix = QTransform::fromTranslate(r.left(), r.top());
4231  brush_matrix.scale(scaleX, scaleY);
4232  brush_matrix.translate(-sr.left(), -sr.top());
4233 
4234  cbrush = QBrush(img);
4235  cbrush.setTransform(brush_matrix);
4236  brush_origin = QPointF();
4237 
4238  QPainterPath p;
4239  p.addRect(r);
4240  fillPath(p);
4241 
4242  cbrush = old_brush;
4243  brush_origin = old_brush_origin;
4244 }
double qreal
Definition: qglobal.h:1193
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
void setTransform(const QTransform &)
Sets matrix as an explicit transformation matrix on the current brush.
Definition: qbrush.cpp:968
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
qreal left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:525
QTransform & translate(qreal dx, qreal dy)
Moves the coordinate system dx along the x axis and dy along the y axis, and returns a reference to t...
Definition: qtransform.cpp:417
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
qreal top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:526
static QTransform fromTranslate(qreal dx, qreal dy)
Creates a matrix which corresponds to a translation of dx along the x axis and dy along the y axis...
Definition: qtransform.cpp:462
QTransform & scale(qreal sx, qreal sy)
Scales the coordinate system by sx horizontally and sy vertically, and returns a reference to the mat...
Definition: qtransform.cpp:485
void fillPath(const QPainterPath &path)
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ drawItem()

void QOpenGLPaintEnginePrivate::drawItem ( const QDrawQueueItem item)

Definition at line 5341 of file qpaintengine_opengl.cpp.

5342 {
5344 
5345  opacity = item.opacity;
5346  brush_origin = item.brush_origin;
5347  q->updateCompositionMode(item.composition_mode);
5348  matrix = item.matrix;
5349  cbrush = item.brush;
5350  brush_style = item.brush.style();
5351 
5352  mask_channel_data[0] = item.location.channel == 0;
5353  mask_channel_data[1] = item.location.channel == 1;
5354  mask_channel_data[2] = item.location.channel == 2;
5355  mask_channel_data[3] = item.location.channel == 3;
5356 
5358 
5361 }
QGLMaskTextureCache::CacheLocation location
virtual QSize size() const =0
#define Q_Q(Class)
Definition: qglobal.h:2483
void setGradientOps(const QBrush &brush, const QRectF &bounds)
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
QPainter::CompositionMode composition_mode
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int height() const
Returns the height.
Definition: qsize.h:129
QSize offscreenSize() const
void composite(const QRectF &rect, const QPoint &maskOffset=QPoint())
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ drawOffscreenPath()

void QOpenGLPaintEnginePrivate::drawOffscreenPath ( const QPainterPath path)

Definition at line 3388 of file qpaintengine_opengl.cpp.

3389 {
3390 #ifdef Q_WS_QWS
3391  Q_UNUSED(path);
3392 #else
3393  DEBUG_ONCE_STR("QOpenGLPaintEnginePrivate::drawOffscreenPath()");
3394 
3395  disableClipping();
3396 
3397  GLuint program = qt_gl_program_cache()->getProgram(device->context(),
3399  QGLPathMaskGenerator maskGenerator(path, matrix, offscreen, program);
3400  addItem(qt_mask_texture_cache()->getMask(maskGenerator, this));
3401 
3402  enableClipping();
3403 #endif
3404 }
#define DEBUG_ONCE_STR(str)
void addItem(const QGLMaskTextureCache::CacheLocation &location)
virtual QGLContext * context() const =0
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ drawTiledImageAsPath()

void QOpenGLPaintEnginePrivate::drawTiledImageAsPath ( const QRectF r,
const QImage img,
qreal  sx,
qreal  sy,
const QPointF offset 
)

Definition at line 4246 of file qpaintengine_opengl.cpp.

4248 {
4249  QBrush old_brush = cbrush;
4250  QPointF old_brush_origin = brush_origin;
4251 
4252  QTransform brush_matrix = QTransform::fromTranslate(r.left(), r.top());
4253  brush_matrix.scale(sx, sy);
4254  brush_matrix.translate(-offset.x(), -offset.y());
4255 
4256  cbrush = QBrush(img);
4257  cbrush.setTransform(brush_matrix);
4258  brush_origin = QPointF();
4259 
4260  QPainterPath p;
4261  p.addRect(r);
4262  fillPath(p);
4263 
4264  cbrush = old_brush;
4265  brush_origin = old_brush_origin;
4266 }
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
void setTransform(const QTransform &)
Sets matrix as an explicit transformation matrix on the current brush.
Definition: qbrush.cpp:968
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
qreal left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:525
QTransform & translate(qreal dx, qreal dy)
Moves the coordinate system dx along the x axis and dy along the y axis, and returns a reference to t...
Definition: qtransform.cpp:417
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
qreal top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:526
static QTransform fromTranslate(qreal dx, qreal dy)
Creates a matrix which corresponds to a translation of dx along the x axis and dy along the y axis...
Definition: qtransform.cpp:462
QTransform & scale(qreal sx, qreal sy)
Scales the coordinate system by sx horizontally and sy vertically, and returns a reference to the mat...
Definition: qtransform.cpp:485
void fillPath(const QPainterPath &path)
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ drawVertexArrays()

void QOpenGLPaintEnginePrivate::drawVertexArrays ( )

Definition at line 1958 of file qpaintengine_opengl.cpp.

1959 {
1960  if (tess_points_stops.count() == 0)
1961  return;
1962  glEnableClientState(GL_VERTEX_ARRAY);
1963  glVertexPointer(2, GL_DOUBLE, 0, tess_points.data());
1964  int previous_stop = 0;
1965  foreach(int stop, tess_points_stops) {
1966  glDrawArrays(GL_TRIANGLE_FAN, previous_stop, stop-previous_stop);
1967  previous_stop = stop;
1968  }
1969  glDisableClientState(GL_VERTEX_ARRAY);
1970 }
Type * data() const
Definition: qdatabuffer_p.h:84
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
#define GL_TRIANGLE_FAN
QDataBuffer< QPointF > tess_points

◆ enableClipping()

void QOpenGLPaintEnginePrivate::enableClipping ( )

Definition at line 2234 of file qpaintengine_opengl.cpp.

2235 {
2237  if (!q->state()->hasClipping)
2238  return;
2239 
2240  if (q->state()->fastClip.isEmpty())
2241  glEnable(GL_DEPTH_TEST);
2242  else
2243  updateDepthClip(); // this will enable the scissor test
2244 }
#define GL_DEPTH_TEST
#define Q_Q(Class)
Definition: qglobal.h:2483

◆ ensureDrawableTexture()

void QOpenGLPaintEnginePrivate::ensureDrawableTexture ( )

Definition at line 5615 of file qpaintengine_opengl.cpp.

5616 {
5618  return;
5619 
5620  dirty_drawable_texture = false;
5621 
5622 #ifndef QT_OPENGL_ES
5623  glGenTextures(1, &drawable_texture);
5624  glBindTexture(GL_TEXTURE_2D, drawable_texture);
5625 
5626  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,
5629  GL_RGBA, GL_UNSIGNED_BYTE, NULL);
5630 
5631  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
5632  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
5635 #endif
5636 }
#define GL_CLAMP_TO_EDGE
Definition: glfunctions.h:62
#define GL_TEXTURE_MIN_FILTER
#define GL_TEXTURE_WRAP_S
#define GL_TEXTURE_2D
int width() const
Returns the width.
Definition: qsize.h:126
#define GL_TEXTURE_WRAP_T
#define GL_UNSIGNED_BYTE
int height() const
Returns the height.
Definition: qsize.h:129
#define GL_RGBA
#define GL_TEXTURE_MAG_FILTER
#define GL_NEAREST

◆ fillPath()

void QOpenGLPaintEnginePrivate::fillPath ( const QPainterPath path)

Definition at line 2097 of file qpaintengine_opengl.cpp.

2098 {
2099  if (path.isEmpty())
2100  return;
2101 
2103  pathToVertexArrays(path);
2104  fillVertexArray(path.fillRule());
2105  return;
2106  }
2107 
2108  glMatrixMode(GL_MODELVIEW);
2109  glLoadIdentity();
2110 
2112  drawOffscreenPath(path);
2113  else {
2114  QPolygonF poly = path.toFillPolygon(matrix);
2115  fillPolygon_dev(poly.data(), poly.count(),
2116  path.fillRule());
2117  }
2118 
2119  updateGLMatrix();
2120 }
bool isEmpty() const
Returns true if either there are no elements in this path, or if the only element is a MoveToElement;...
Definition: qpainterpath.h:392
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
void fillPolygon_dev(const QPointF *polygonPoints, int pointCount, Qt::FillRule fill)
void drawOffscreenPath(const QPainterPath &path)
void pathToVertexArrays(const QPainterPath &path)
QPolygonF toFillPolygon(const QMatrix &matrix=QMatrix()) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QPolygonF class provides a vector of points using floating point precision.
Definition: qpolygon.h:134
Qt::FillRule fillRule() const
Returns the painter path&#39;s currently set fill rule.
void fillVertexArray(Qt::FillRule fillRule)
T * data()
Returns a pointer to the data stored in the vector.
Definition: qvector.h:152

◆ fillPolygon_dev()

void QOpenGLPaintEnginePrivate::fillPolygon_dev ( const QPointF polygonPoints,
int  pointCount,
Qt::FillRule  fill 
)

Definition at line 1849 of file qpaintengine_opengl.cpp.

1851 {
1853  tessellator.tessellate(polygonPoints, pointCount, fill == Qt::WindingFill);
1854 
1855  DEBUG_ONCE qDebug() << "QOpenGLPaintEnginePrivate: Drawing polygon with" << pointCount << "points using fillPolygon_dev";
1856 
1857  setGradientOps(cbrush, tessellator.bounds);
1858 
1859  bool fast_style = current_style == Qt::LinearGradientPattern
1861 
1862 #ifndef QT_OPENGL_ES
1863  GLenum geometry_mode = GL_QUADS;
1864 #else
1865  GLenum geometry_mode = GL_TRIANGLES;
1866 #endif
1867 
1868  if (use_fragment_programs && !(fast_style && has_fast_composition_mode)) {
1869  composite(geometry_mode, tessellator.vertices, tessellator.size / 2);
1870  } else {
1871  glVertexPointer(2, GL_FLOAT, 0, tessellator.vertices);
1872  glEnableClientState(GL_VERTEX_ARRAY);
1873  glDrawArrays(geometry_mode, 0, tessellator.size/2);
1874  glDisableClientState(GL_VERTEX_ARRAY);
1875  }
1876 }
void tessellate(const QPointF *points, int nPoints, bool winding)
Q_CORE_EXPORT void qDebug(const char *,...)
void setGradientOps(const QBrush &brush, const QRectF &bounds)
#define GL_FLOAT
#define GL_TRIANGLES
unsigned int GLenum
Definition: main.cpp:50
#define DEBUG_ONCE
void composite(const QRectF &rect, const QPoint &maskOffset=QPoint())

◆ fillVertexArray()

void QOpenGLPaintEnginePrivate::fillVertexArray ( Qt::FillRule  fillRule)

Definition at line 1972 of file qpaintengine_opengl.cpp.

1973 {
1975 
1976  QRect rect = dirty_stencil.boundingRect();
1977 
1978  if (use_system_clip)
1979  rect = q->systemClip().intersected(dirty_stencil).boundingRect();
1980 
1981  glStencilMask(~0);
1982 
1983  if (!rect.isEmpty()) {
1984  disableClipping();
1985 
1986  glEnable(GL_SCISSOR_TEST);
1987 
1988  const int left = rect.left();
1989  const int width = rect.width();
1990  const int bottom = device->size().height() - (rect.bottom() + 1);
1991  const int height = rect.height();
1992 
1993  glScissor(left, bottom, width, height);
1994 
1995  glClearStencil(0);
1996  glClear(GL_STENCIL_BUFFER_BIT);
1997  dirty_stencil -= rect;
1998 
1999  glDisable(GL_SCISSOR_TEST);
2000 
2001  enableClipping();
2002  }
2003 
2004  // Enable stencil.
2005  glEnable(GL_STENCIL_TEST);
2006 
2007  // Disable color writes.
2008  glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
2009 
2010  GLuint stencilMask = 0;
2011 
2012  if (fillRule == Qt::OddEvenFill) {
2013  stencilMask = 1;
2014 
2015  // Enable stencil writes.
2016  glStencilMask(stencilMask);
2017 
2018  // Set stencil xor mode.
2019  glStencilOp(GL_KEEP, GL_KEEP, GL_INVERT);
2020 
2021  // Disable stencil func.
2022  glStencilFunc(GL_ALWAYS, 0, ~0);
2023 
2024  drawVertexArrays();
2025  } else if (fillRule == Qt::WindingFill) {
2026  stencilMask = ~0;
2027 
2028  if (has_stencil_face_ext) {
2030  glEnable(GL_STENCIL_TEST_TWO_SIDE_EXT);
2031 
2033  glStencilOp(GL_KEEP, GL_KEEP, GL_DECR_WRAP_EXT);
2034  glStencilFunc(GL_ALWAYS, 0, ~0);
2035 
2037  glStencilOp(GL_KEEP, GL_KEEP, GL_INCR_WRAP_EXT);
2038  glStencilFunc(GL_ALWAYS, 0, ~0);
2039 
2040  drawVertexArrays();
2041 
2042  glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
2043  } else {
2044  glStencilFunc(GL_ALWAYS, 0, ~0);
2045  glEnable(GL_CULL_FACE);
2046 
2047  glCullFace(GL_BACK);
2048  glStencilOp(GL_KEEP, GL_KEEP, GL_INCR_WRAP_EXT);
2049  drawVertexArrays();
2050 
2051  glCullFace(GL_FRONT);
2052  glStencilOp(GL_KEEP, GL_KEEP, GL_DECR_WRAP_EXT);
2053  drawVertexArrays();
2054 
2055  glDisable(GL_CULL_FACE);
2056  }
2057  }
2058 
2059  // Enable color writes.
2060  glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
2061  glStencilMask(stencilMask);
2062 
2064 
2065  bool fast_fill = has_fast_composition_mode && (current_style == Qt::LinearGradientPattern || current_style == Qt::SolidPattern);
2066 
2067  if (use_fragment_programs && !fast_fill) {
2068  DEBUG_ONCE qDebug() << "QOpenGLPaintEnginePrivate: Drawing polygon using stencil method (fragment programs)";
2070 
2071  // Enable stencil func.
2072  glStencilFunc(GL_NOTEQUAL, 0, stencilMask);
2073  glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
2074  composite(rect);
2075  } else {
2076  DEBUG_ONCE qDebug() << "QOpenGLPaintEnginePrivate: Drawing polygon using stencil method (no fragment programs)";
2077 
2078  // Enable stencil func.
2079  glStencilFunc(GL_NOTEQUAL, 0, stencilMask);
2080  glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
2081 #ifndef QT_OPENGL_ES
2082  glBegin(GL_QUADS);
2083  glVertex2f(min_x, min_y);
2084  glVertex2f(max_x, min_y);
2085  glVertex2f(max_x, max_y);
2086  glVertex2f(min_x, max_y);
2087  glEnd();
2088 #endif
2089  }
2090 
2091  // Disable stencil writes.
2092  glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
2093  glStencilMask(0);
2094  glDisable(GL_STENCIL_TEST);
2095 }
#define GL_INCR_WRAP_EXT
#define GL_TRUE
#define GL_INVERT
#define QGL_FUNC_CONTEXT
#define GL_STENCIL_BUFFER_BIT
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
Definition: qrect.h:481
QRect boundingRect() const
Returns the bounding rectangle of this region.
Definition: qregion.cpp:4363
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
virtual QSize size() const =0
#define GL_STENCIL_TEST_TWO_SIDE_EXT
#define GL_STENCIL_TEST
The QSizeF class defines the size of a two-dimensional object using floating point precision...
Definition: qsize.h:202
#define GL_SCISSOR_TEST
#define Q_Q(Class)
Definition: qglobal.h:2483
Q_CORE_EXPORT void qDebug(const char *,...)
#define GL_FALSE
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
#define GL_DECR_WRAP_EXT
void setGradientOps(const QBrush &brush, const QRectF &bounds)
#define GL_NOTEQUAL
#define glActiveStencilFaceEXT
#define GL_FRONT
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
Definition: qrect.h:234
#define GL_BACK
#define DEBUG_ONCE
#define GL_CULL_FACE
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void composite(const QRectF &rect, const QPoint &maskOffset=QPoint())
#define GL_ALWAYS
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
#define GL_REPLACE
#define GL_KEEP

◆ flushDrawQueue()

void QOpenGLPaintEnginePrivate::flushDrawQueue ( )

Definition at line 5363 of file qpaintengine_opengl.cpp.

5364 {
5365 #ifndef QT_OPENGL_ES
5367 
5368  offscreen.release();
5369 
5370  if (!drawQueue.isEmpty()) {
5371  DEBUG_ONCE qDebug() << "QOpenGLPaintEngine::flushDrawQueue():" << drawQueue.size() << "items";
5372 
5373  glPushMatrix();
5374  glLoadIdentity();
5375  qreal old_opacity = opacity;
5376  QPointF old_brush_origin = brush_origin;
5377  QPainter::CompositionMode old_composition_mode = composition_mode;
5378  QTransform old_matrix = matrix;
5379  QBrush old_brush = cbrush;
5380 
5381  bool hqaa_old = high_quality_antialiasing;
5382 
5384 
5385  foreach (const QDrawQueueItem &item, drawQueue)
5386  drawItem(item);
5387 
5388  opacity = old_opacity;
5389  brush_origin = old_brush_origin;
5390  q->updateCompositionMode(old_composition_mode);
5391  matrix = old_matrix;
5392  cbrush = old_brush;
5393  brush_style = old_brush.style();
5394 
5395  high_quality_antialiasing = hqaa_old;
5396 
5397  setGLBrush(old_brush.color());
5399 
5400  drawQueue.clear();
5401 
5402  glPopMatrix();
5403  }
5404 #endif
5405 }
double qreal
Definition: qglobal.h:1193
const QColor & color() const
Returns the brush color.
Definition: qbrush.h:183
CompositionMode
Defines the modes supported for digital image compositing.
Definition: qpainter.h:138
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
static void qt_glColor4ubv(unsigned char *col)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
Q_CORE_EXPORT void qDebug(const char *,...)
void drawItem(const QDrawQueueItem &item)
void clear()
Removes all items from the list.
Definition: qlist.h:764
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
QList< QDrawQueueItem > drawQueue
QPainter::CompositionMode composition_mode
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
#define DEBUG_ONCE
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
void setGLBrush(const QColor &c)
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ isFastRect()

bool QOpenGLPaintEnginePrivate::isFastRect ( const QRectF r)

Definition at line 3477 of file qpaintengine_opengl.cpp.

3478 {
3479  if (matrix.type() < QTransform::TxRotate) {
3480  QRectF r = matrix.mapRect(rect);
3481  return r.topLeft().toPoint() == r.topLeft()
3482  && r.bottomRight().toPoint() == r.bottomRight();
3483  }
3484 
3485  return false;
3486 }
QPointF bottomRight() const
Returns the position of the rectangle&#39;s bottom-right corner.
Definition: qrect.h:540
QPointF topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:539
TransformationType type() const
Returns the transformation type of this matrix.
QRect mapRect(const QRect &) const
Creates and returns a QRect object that is a copy of the given rectangle, mapped into the coordinate ...
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition: qpoint.h:376

◆ lineToStencil()

void QOpenGLPaintEnginePrivate::lineToStencil ( qreal  x,
qreal  y 
)
inline

Definition at line 1879 of file qpaintengine_opengl.cpp.

1880 {
1881  tess_points.add(QPointF(x, y));
1882 
1883  if (x > max_x)
1884  max_x = x;
1885  else if (x < min_x)
1886  min_x = x;
1887  if (y > max_y)
1888  max_y = y;
1889  else if (y < min_y)
1890  min_y = y;
1891 }
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
void add(const Type &t)
Definition: qdatabuffer_p.h:93
QDataBuffer< QPointF > tess_points

◆ pathToVertexArrays()

void QOpenGLPaintEnginePrivate::pathToVertexArrays ( const QPainterPath path)

Definition at line 1925 of file qpaintengine_opengl.cpp.

1926 {
1927  const QPainterPath::Element &first = path.elementAt(0);
1928  min_x = max_x = first.x;
1929  min_y = max_y = first.y;
1930 
1931  tess_points.reset();
1933  lineToStencil(first.x, first.y);
1934 
1935  for (int i=1; i<path.elementCount(); ++i) {
1936  const QPainterPath::Element &e = path.elementAt(i);
1937  switch (e.type) {
1940  lineToStencil(e.x, e.y);
1941  break;
1943  lineToStencil(e.x, e.y);
1944  break;
1946  curveToStencil(e, path.elementAt(i+1), path.elementAt(i+2));
1947  i+=2;
1948  break;
1949  default:
1950  break;
1951  }
1952  }
1953  lineToStencil(first.x, first.y);
1955 }
ElementType type
the type of element
Definition: qpainterpath.h:81
The QPainterPath::Element class specifies the position and type of a subpath.
Definition: qpainterpath.h:77
qreal y
the y coordinate of the element&#39;s position.
Definition: qpainterpath.h:80
const QPainterPath::Element & elementAt(int i) const
Returns the element at the given index in the painter path.
Definition: qpainterpath.h:402
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
Definition: qvector.h:347
void append(const T &t)
Inserts value at the end of the vector.
Definition: qvector.h:573
void lineToStencil(qreal x, qreal y)
qreal x
the x coordinate of the element&#39;s position.
Definition: qpainterpath.h:79
int elementCount() const
Returns the number of path elements in the painter path.
Definition: qpainterpath.h:397
QDataBuffer< QPointF > tess_points
void curveToStencil(const QPointF &cp1, const QPointF &cp2, const QPointF &ep)
void reset()
Definition: qdatabuffer_p.h:79
int size() const
Definition: qdatabuffer_p.h:83

◆ setGLBrush()

void QOpenGLPaintEnginePrivate::setGLBrush ( const QColor c)
inline

Definition at line 686 of file qpaintengine_opengl.cpp.

686  {
687  uint alpha = qRound(c.alpha() * opacity);
688  brush_color[0] = qt_div_255(c.red() * alpha);
689  brush_color[1] = qt_div_255(c.green() * alpha);
690  brush_color[2] = qt_div_255(c.blue() * alpha);
691  brush_color[3] = alpha;
692  }
ushort red
Returns the red color component of this color.
Definition: qcolor.h:243
unsigned int uint
Definition: qglobal.h:996
ushort blue
Returns the blue color component of this color.
Definition: qcolor.h:245
ushort alpha
Returns the alpha color component of this color.
Definition: qcolor.h:242
Q_STATIC_INLINE_FUNCTION int qt_div_255(int x)
ushort green
Returns the green color component of this color.
Definition: qcolor.h:244
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ setGLPen()

void QOpenGLPaintEnginePrivate::setGLPen ( const QColor c)
inline

Definition at line 678 of file qpaintengine_opengl.cpp.

678  {
679  uint alpha = qRound(c.alpha() * opacity);
680  pen_color[0] = qt_div_255(c.red() * alpha);
681  pen_color[1] = qt_div_255(c.green() * alpha);
682  pen_color[2] = qt_div_255(c.blue() * alpha);
683  pen_color[3] = alpha;
684  }
ushort red
Returns the red color component of this color.
Definition: qcolor.h:243
unsigned int uint
Definition: qglobal.h:996
ushort blue
Returns the blue color component of this color.
Definition: qcolor.h:245
ushort alpha
Returns the alpha color component of this color.
Definition: qcolor.h:242
Q_STATIC_INLINE_FUNCTION int qt_div_255(int x)
ushort green
Returns the green color component of this color.
Definition: qcolor.h:244
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ setGradientOps()

void QOpenGLPaintEnginePrivate::setGradientOps ( const QBrush brush,
const QRectF bounds 
)
inline

Definition at line 1196 of file qpaintengine_opengl.cpp.

1197 {
1198  current_style = brush.style();
1199 
1200  if (current_style < Qt::LinearGradientPattern || current_style > Qt::ConicalGradientPattern) {
1201  setGLBrush(brush.color());
1203  }
1204 
1205  updateGradient(brush, bounds);
1206 
1207 #ifndef QT_OPENGL_ES //### GLES does not have GL_TEXTURE_GEN_ so we are falling back for gradients
1208  glDisable(GL_TEXTURE_GEN_S);
1209  glDisable(GL_TEXTURE_1D);
1210 
1214  } else {
1215  glEnable(GL_TEXTURE_GEN_S);
1216  glEnable(GL_TEXTURE_1D);
1217  }
1218  } else {
1219  if (use_fragment_programs) {
1222  else if (current_style == Qt::ConicalGradientPattern)
1224  else if (current_style == Qt::SolidPattern)
1226  else if (current_style == Qt::TexturePattern && !brush.texture().isQBitmap())
1228  else
1230  }
1231  }
1232 #endif
1233 }
const QColor & color() const
Returns the brush color.
Definition: qbrush.h:183
static void qt_glColor4ubv(unsigned char *col)
bool isQBitmap() const
Returns true if this is a QBitmap; otherwise returns false.
Definition: qpixmap.cpp:599
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
QPixmap texture() const
Returns the custom brush pattern, or a null pixmap if no custom brush pattern has been set...
Definition: qbrush.cpp:785
void setGLBrush(const QColor &c)
void updateGradient(const QBrush &brush, const QRectF &bounds)

◆ setInvMatrixData()

void QOpenGLPaintEnginePrivate::setInvMatrixData ( const QTransform inv_matrix)

Definition at line 1542 of file qpaintengine_opengl.cpp.

1543 {
1544  inv_matrix_data[0][0] = inv_matrix.m11();
1545  inv_matrix_data[1][0] = inv_matrix.m21();
1546  inv_matrix_data[2][0] = inv_matrix.m31();
1547 
1548  inv_matrix_data[0][1] = inv_matrix.m12();
1549  inv_matrix_data[1][1] = inv_matrix.m22();
1550  inv_matrix_data[2][1] = inv_matrix.m32();
1551 
1552  inv_matrix_data[0][2] = inv_matrix.m13();
1553  inv_matrix_data[1][2] = inv_matrix.m23();
1554  inv_matrix_data[2][2] = inv_matrix.m33();
1555 }
qreal m32() const
Returns the vertical translation factor.
Definition: qtransform.h:265
qreal m21() const
Returns the horizontal shearing factor.
Definition: qtransform.h:249
qreal m22() const
Returns the vertical scaling factor.
Definition: qtransform.h:253
qreal m12() const
Returns the vertical shearing factor.
Definition: qtransform.h:241
qreal m31() const
Returns the horizontal translation factor.
Definition: qtransform.h:261
qreal m23() const
Returns the vertical projection factor.
Definition: qtransform.h:257
qreal m13() const
Returns the horizontal projection factor.
Definition: qtransform.h:245
qreal m11() const
Returns the horizontal scaling factor.
Definition: qtransform.h:237
qreal m33() const
Returns the division factor.
Definition: qtransform.h:269

◆ setPorterDuffData()

void QOpenGLPaintEnginePrivate::setPorterDuffData ( float  a,
float  b,
float  x,
float  y,
float  z 
)

Definition at line 2478 of file qpaintengine_opengl.cpp.

2479 {
2480  porterduff_ab_data[0] = a;
2481  porterduff_ab_data[1] = b;
2482 
2483  porterduff_xyz_data[0] = x;
2484  porterduff_xyz_data[1] = y;
2485  porterduff_xyz_data[2] = z;
2486 }
long ASN1_INTEGER_get ASN1_INTEGER * a

◆ strokeLines()

void QOpenGLPaintEnginePrivate::strokeLines ( const QPainterPath path)

Definition at line 3934 of file qpaintengine_opengl.cpp.

3935 {
3936  DEBUG_ONCE_STR("QOpenGLPaintEnginePrivate::strokeLines()");
3937 
3938  qreal penWidth = cpen.widthF();
3939 
3940  GLuint program = qt_gl_program_cache()->getProgram(device->context(),
3942  QGLLineMaskGenerator maskGenerator(path, matrix, penWidth == 0 ? 1.0 : penWidth,
3943  offscreen, program);
3944 
3945  disableClipping();
3946 
3947  QBrush temp = cbrush;
3948  QPointF origin = brush_origin;
3949 
3950  cbrush = cpen.brush();
3951  brush_origin = QPointF();
3952 
3953  addItem(qt_mask_texture_cache()->getMask(maskGenerator, this));
3954 
3955  cbrush = temp;
3956  brush_origin = origin;
3957 
3958  enableClipping();
3959 }
#define DEBUG_ONCE_STR(str)
double qreal
Definition: qglobal.h:1193
void addItem(const QGLMaskTextureCache::CacheLocation &location)
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
virtual QGLContext * context() const =0
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
Definition: qpen.cpp:797
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
qreal widthF() const
Returns the pen width with floating point precision.
Definition: qpen.cpp:645

◆ strokePath()

void QOpenGLPaintEnginePrivate::strokePath ( const QPainterPath path,
bool  use_cache 
)

Definition at line 3963 of file qpaintengine_opengl.cpp.

3964 {
3965  QBrush old_brush = cbrush;
3966  cbrush = cpen.brush();
3967 
3968  qreal txscale = 1;
3969  if (cpen.isCosmetic() || (qt_scaleForTransform(matrix, &txscale) && txscale != 1)) {
3970  QTransform temp = matrix;
3971  matrix = QTransform();
3972  glPushMatrix();
3973 
3974  if (has_antialiasing) {
3975  glLoadIdentity();
3976  } else {
3977  float offs_matrix[] =
3978  { 1, 0, 0, 0,
3979  0, 1, 0, 0,
3980  0, 0, 1, 0,
3981  0.5, 0.5, 0, 1 };
3982  glLoadMatrixf(offs_matrix);
3983  }
3984 
3985  QPen pen = cpen;
3986  if (txscale != 1)
3987  pen.setWidthF(pen.widthF() * txscale);
3988  if (use_cache)
3989  fillPath(qt_opengl_stroke_cache()->getStrokedPath(temp.map(path), pen));
3990  else
3991  fillPath(strokeForPath(temp.map(path), pen));
3992 
3993  glPopMatrix();
3994  matrix = temp;
3995  } else if (use_cache) {
3996  fillPath(qt_opengl_stroke_cache()->getStrokedPath(path, cpen));
3997  } else {
3998  fillPath(strokeForPath(path, cpen));
3999  }
4000 
4001  cbrush = old_brush;
4002 }
Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale)
double qreal
Definition: qglobal.h:1193
The QPen class defines how a QPainter should draw lines and outlines of shapes.
Definition: qpen.h:64
bool isCosmetic() const
Returns true if the pen is cosmetic; otherwise returns false.
Definition: qpen.cpp:840
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
Definition: qpen.cpp:797
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
void setWidthF(qreal width)
Sets the pen width to the given width in pixels with floating point precision.
Definition: qpen.cpp:690
qreal widthF() const
Returns the pen width with floating point precision.
Definition: qpen.cpp:645
void fillPath(const QPainterPath &path)
static QPainterPath strokeForPath(const QPainterPath &path, const QPen &cpen)
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ strokePathFastPen()

void QOpenGLPaintEnginePrivate::strokePathFastPen ( const QPainterPath path,
bool  needsResolving 
)

Definition at line 4004 of file qpaintengine_opengl.cpp.

4005 {
4006 #ifndef QT_OPENGL_ES
4007  QRectF bounds;
4008  if (needsResolving)
4009  bounds = path.controlPointRect();
4010  setGradientOps(cpen.brush(), bounds);
4011 
4012  QBezier beziers[32];
4013  for (int i=0; i<path.elementCount(); ++i) {
4014  const QPainterPath::Element &e = path.elementAt(i);
4015  switch (e.type) {
4017  if (i != 0)
4018  glEnd(); // GL_LINE_STRIP
4019  glBegin(GL_LINE_STRIP);
4020  glVertex2d(e.x, e.y);
4021 
4022  break;
4024  glVertex2d(e.x, e.y);
4025  break;
4026 
4028  {
4029  QPointF sp = path.elementAt(i-1);
4030  QPointF cp2 = path.elementAt(i+1);
4031  QPointF ep = path.elementAt(i+2);
4032  i+=2;
4033 
4034  qreal inverseScaleHalf = inverseScale / 2;
4035  beziers[0] = QBezier::fromPoints(sp, e, cp2, ep);
4036  QBezier *b = beziers;
4037  while (b >= beziers) {
4038  // check if we can pop the top bezier curve from the stack
4039  qreal l = qAbs(b->x4 - b->x1) + qAbs(b->y4 - b->y1);
4040  qreal d;
4041  if (l > inverseScale) {
4042  d = qAbs( (b->x4 - b->x1)*(b->y1 - b->y2)
4043  - (b->y4 - b->y1)*(b->x1 - b->x2) )
4044  + qAbs( (b->x4 - b->x1)*(b->y1 - b->y3)
4045  - (b->y4 - b->y1)*(b->x1 - b->x3) );
4046  d /= l;
4047  } else {
4048  d = qAbs(b->x1 - b->x2) + qAbs(b->y1 - b->y2) +
4049  qAbs(b->x1 - b->x3) + qAbs(b->y1 - b->y3);
4050  }
4051  if (d < inverseScaleHalf || b == beziers + 31) {
4052  // good enough, we pop it off and add the endpoint
4053  glVertex2d(b->x4, b->y4);
4054  --b;
4055  } else {
4056  // split, second half of the polygon goes lower into the stack
4057  b->split(b+1, b);
4058  ++b;
4059  }
4060  }
4061  } // case CurveToElement
4062  default:
4063  break;
4064  } // end of switch
4065  }
4066  glEnd(); // GL_LINE_STRIP
4067 #else
4068  // have to use vertex arrays on embedded
4069  QRectF bounds;
4070  if (needsResolving)
4071  bounds = path.controlPointRect();
4072  setGradientOps(cpen.brush(), bounds);
4073 
4074  glEnableClientState(GL_VERTEX_ARRAY);
4075  tess_points.reset();
4076  QBezier beziers[32];
4077  for (int i=0; i<path.elementCount(); ++i) {
4078  const QPainterPath::Element &e = path.elementAt(i);
4079  switch (e.type) {
4081  if (i != 0) {
4082  glVertexPointer(2, GL_FLOAT, 0, tess_points.data());
4083  glDrawArrays(GL_LINE_STRIP, 0, tess_points.size());
4084  tess_points.reset();
4085  }
4086  tess_points.add(QPointF(e.x, e.y));
4087 
4088  break;
4090  tess_points.add(QPointF(e.x, e.y));
4091  break;
4092 
4094  {
4095  QPointF sp = path.elementAt(i-1);
4096  QPointF cp2 = path.elementAt(i+1);
4097  QPointF ep = path.elementAt(i+2);
4098  i+=2;
4099 
4100  qreal inverseScaleHalf = inverseScale / 2;
4101  beziers[0] = QBezier::fromPoints(sp, e, cp2, ep);
4102  QBezier *b = beziers;
4103  while (b >= beziers) {
4104  // check if we can pop the top bezier curve from the stack
4105  qreal l = qAbs(b->x4 - b->x1) + qAbs(b->y4 - b->y1);
4106  qreal d;
4107  if (l > inverseScale) {
4108  d = qAbs( (b->x4 - b->x1)*(b->y1 - b->y2)
4109  - (b->y4 - b->y1)*(b->x1 - b->x2) )
4110  + qAbs( (b->x4 - b->x1)*(b->y1 - b->y3)
4111  - (b->y4 - b->y1)*(b->x1 - b->x3) );
4112  d /= l;
4113  } else {
4114  d = qAbs(b->x1 - b->x2) + qAbs(b->y1 - b->y2) +
4115  qAbs(b->x1 - b->x3) + qAbs(b->y1 - b->y3);
4116  }
4117  if (d < inverseScaleHalf || b == beziers + 31) {
4118  // good enough, we pop it off and add the endpoint
4119  tess_points.add(QPointF(b->x4, b->y4));
4120  --b;
4121  } else {
4122  // split, second half of the polygon goes lower into the stack
4123  b->split(b+1, b);
4124  ++b;
4125  }
4126  }
4127  } // case CurveToElement
4128  default:
4129  break;
4130  } // end of switch
4131  }
4132  glVertexPointer(2, GL_FLOAT, 0, tess_points.data());
4133  glDrawArrays(GL_LINE_STRIP, 0, tess_points.size());
4134  glDisableClientState(GL_VERTEX_ARRAY);
4135 #endif
4136 }
ElementType type
the type of element
Definition: qpainterpath.h:81
double d
Definition: qnumeric_p.h:62
The QPainterPath::Element class specifies the position and type of a subpath.
Definition: qpainterpath.h:77
double qreal
Definition: qglobal.h:1193
Type * data() const
Definition: qdatabuffer_p.h:84
qreal x2
Definition: qbezier_p.h:116
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
qreal y
the y coordinate of the element&#39;s position.
Definition: qpainterpath.h:80
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
const QPainterPath::Element & elementAt(int i) const
Returns the element at the given index in the painter path.
Definition: qpainterpath.h:402
qreal y2
Definition: qbezier_p.h:116
qreal x4
Definition: qbezier_p.h:116
static QBezier fromPoints(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4)
Definition: qbezier.cpp:71
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
void setGradientOps(const QBrush &brush, const QRectF &bounds)
#define GL_FLOAT
void add(const Type &t)
Definition: qdatabuffer_p.h:93
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
Definition: qpen.cpp:797
qreal y4
Definition: qbezier_p.h:116
#define GL_LINE_STRIP
QRectF controlPointRect() const
Returns the rectangle containing all the points and control points in this path.
qreal x3
Definition: qbezier_p.h:116
QFactoryLoader * l
qreal x1
Definition: qbezier_p.h:116
void split(QBezier *firstHalf, QBezier *secondHalf) const
Definition: qbezier_p.h:224
qreal x
the x coordinate of the element&#39;s position.
Definition: qpainterpath.h:79
qreal y1
Definition: qbezier_p.h:116
int elementCount() const
Returns the number of path elements in the painter path.
Definition: qpainterpath.h:397
QDataBuffer< QPointF > tess_points
qreal y3
Definition: qbezier_p.h:116
void reset()
Definition: qdatabuffer_p.h:79
static bool needsResolving(const QBrush &brush)
Definition: qpainter.cpp:7339
int size() const
Definition: qdatabuffer_p.h:83

◆ systemStateChanged()

void QOpenGLPaintEnginePrivate::systemStateChanged ( )
virtual

Reimplemented from QPaintEnginePrivate.

Definition at line 2338 of file qpaintengine_opengl.cpp.

2339 {
2341  if (q->painter()->hasClipping())
2342  q->updateClipRegion(q->painter()->clipRegion(), Qt::ReplaceClip);
2343  else
2344  q->updateClipRegion(QRegion(), Qt::NoClip);
2345 }
#define Q_Q(Class)
Definition: qglobal.h:2483
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68

◆ updateDepthClip()

void QOpenGLPaintEnginePrivate::updateDepthClip ( )

Definition at line 2246 of file qpaintengine_opengl.cpp.

2247 {
2249 
2250  ++q->state()->depthClipId;
2251 
2252  glDisable(GL_DEPTH_TEST);
2253  glDisable(GL_SCISSOR_TEST);
2254 
2255  if (!q->state()->hasClipping)
2256  return;
2257 
2258  QRect fastClip;
2259  if (q->state()->clipEnabled) {
2260  fastClip = q->state()->fastClip;
2261  } else if (use_system_clip && q->systemClip().rects().count() == 1) {
2262  fastClip = q->systemClip().rects().at(0);
2263  }
2264 
2265  if (!fastClip.isEmpty()) {
2266  glEnable(GL_SCISSOR_TEST);
2267 
2268  const int left = fastClip.left();
2269  const int width = fastClip.width();
2270  const int bottom = device->size().height() - (fastClip.bottom() + 1);
2271  const int height = fastClip.height();
2272 
2273  glScissor(left, bottom, width, height);
2274  return;
2275  }
2276 
2277 #if defined(QT_OPENGL_ES_1) || defined(QT_OPENGL_ES_2)
2278  glClearDepthf(0.0f);
2279 #else
2280  glClearDepth(0.0f);
2281 #endif
2282 
2283  glEnable(GL_DEPTH_TEST);
2284  glDepthMask(GL_TRUE);
2285  glClear(GL_DEPTH_BUFFER_BIT);
2286 
2287  glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
2288  glDepthFunc(GL_ALWAYS);
2289 
2290  const QVector<QRect> rects = q->state()->clipEnabled ? q->state()->clipRegion.rects() : q->systemClip().rects();
2291 
2292  // rectangle count * 2 (triangles) * vertex count * component count (Z omitted)
2293  QDataBuffer<GLfloat> clipVertex(rects.size()*2*3*2);
2294  for (int i = 0; i < rects.size(); ++i) {
2295  GLfloat x = GLfloat(rects.at(i).left());
2296  GLfloat w = GLfloat(rects.at(i).width());
2297  GLfloat h = GLfloat(rects.at(i).height());
2298  GLfloat y = GLfloat(rects.at(i).top());
2299 
2300  // First triangle
2301  clipVertex.add(x);
2302  clipVertex.add(y);
2303 
2304  clipVertex.add(x);
2305  clipVertex.add(y + h);
2306 
2307  clipVertex.add(x + w);
2308  clipVertex.add(y);
2309 
2310  // Second triangle
2311  clipVertex.add(x);
2312  clipVertex.add(y + h);
2313 
2314  clipVertex.add(x + w);
2315  clipVertex.add(y + h);
2316 
2317  clipVertex.add (x + w);
2318  clipVertex.add(y);
2319  }
2320 
2321  if (rects.size()) {
2322  glMatrixMode(GL_MODELVIEW);
2323  glLoadIdentity();
2324 
2325  glEnableClientState(GL_VERTEX_ARRAY);
2326  glVertexPointer(2, GL_FLOAT, 0, clipVertex.data());
2327 
2328  glDrawArrays(GL_TRIANGLES, 0, rects.size()*2*3);
2329  glDisableClientState(GL_VERTEX_ARRAY);
2330  updateGLMatrix();
2331  }
2332 
2333  glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
2334  glDepthMask(GL_FALSE);
2335  glDepthFunc(GL_LEQUAL);
2336 }
#define GL_TRUE
#define GL_DEPTH_TEST
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
virtual QSize size() const =0
#define GL_SCISSOR_TEST
#define Q_Q(Class)
Definition: qglobal.h:2483
#define GL_FALSE
#define GL_FLOAT
void add(const Type &t)
Definition: qdatabuffer_p.h:93
#define GL_LEQUAL
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
#define GL_DEPTH_BUFFER_BIT
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
Definition: qrect.h:234
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
#define GL_TRIANGLES
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
#define GL_ALWAYS
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

◆ updateFastPen()

void QOpenGLPaintEnginePrivate::updateFastPen ( )
inline

Definition at line 721 of file qpaintengine_opengl.cpp.

721  {
722  qreal pen_width = cpen.widthF();
723  has_fast_pen =
724  ((pen_width == 0 || (pen_width <= 1 && matrix.type() <= QTransform::TxTranslate))
725  || cpen.isCosmetic())
726  && cpen.style() == Qt::SolidLine
727  && cpen.isSolid();
728 
729  }
double qreal
Definition: qglobal.h:1193
Qt::PenStyle style() const
Returns the pen style.
Definition: qpen.cpp:428
TransformationType type() const
Returns the transformation type of this matrix.
bool isCosmetic() const
Returns true if the pen is cosmetic; otherwise returns false.
Definition: qpen.cpp:840
qreal widthF() const
Returns the pen width with floating point precision.
Definition: qpen.cpp:645
bool isSolid() const
Returns true if the pen has a solid fill, otherwise false.
Definition: qpen.cpp:820

◆ updateFragmentProgramData()

void QOpenGLPaintEnginePrivate::updateFragmentProgramData ( int  locations[])

Definition at line 5078 of file qpaintengine_opengl.cpp.

5079 {
5080 #ifdef Q_WS_QWS
5081  Q_UNUSED(locations);
5082 #else
5084 
5085  QSize sz = offscreen.offscreenSize();
5086 
5087  float inv_mask_size_data[4] = { 1.0f / sz.width(), 1.0f / sz.height(), 0.0f, 0.0f };
5088 
5089  sz = drawable_texture_size;
5090 
5091  float inv_dst_size_data[4] = { 1.0f / sz.width(), 1.0f / sz.height(), 0.0f, 0.0f };
5092 
5093  // default inv size 0.125f == 1.0f / 8.0f for pattern brushes
5094  float inv_brush_texture_size_data[4] = { 0.125f, 0.125f };
5095 
5096  // texture patterns have their own size
5098  QSize sz = cbrush.texture().size();
5099 
5100  inv_brush_texture_size_data[0] = 1.0f / sz.width();
5101  inv_brush_texture_size_data[1] = 1.0f / sz.height();
5102  }
5103 
5104  for (unsigned int i = 0; i < num_fragment_variables; ++i) {
5105  int location = locations[i];
5106 
5107  if (location < 0)
5108  continue;
5109 
5110  switch (i) {
5111  case VAR_ANGLE:
5113  break;
5114  case VAR_LINEAR:
5116  break;
5117  case VAR_FMP:
5119  break;
5120  case VAR_FMP2_M_RADIUS2:
5122  break;
5123  case VAR_INV_MASK_SIZE:
5124  glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, location, inv_mask_size_data);
5125  break;
5126  case VAR_INV_DST_SIZE:
5127  glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, location, inv_dst_size_data);
5128  break;
5129  case VAR_INV_MATRIX_M0:
5131  break;
5132  case VAR_INV_MATRIX_M1:
5134  break;
5135  case VAR_INV_MATRIX_M2:
5137  break;
5138  case VAR_PORTERDUFF_AB:
5140  break;
5141  case VAR_PORTERDUFF_XYZ:
5143  break;
5145  glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, location, inv_brush_texture_size_data);
5146  break;
5147  case VAR_MASK_OFFSET:
5149  break;
5150  case VAR_MASK_CHANNEL:
5152  break;
5153  case VAR_DST_TEXTURE:
5154  case VAR_MASK_TEXTURE:
5155  case VAR_PALETTE:
5156  case VAR_BRUSH_TEXTURE:
5157  // texture variables, not handled here
5158  break;
5159  default:
5160  qDebug() << "QOpenGLPaintEnginePrivate: Unhandled fragment variable:" << i;
5161  }
5162  }
5163 #endif
5164 }
QSize size() const
Returns the size of the pixmap.
Definition: qpixmap.cpp:661
#define QGL_FUNC_CONTEXT
Q_CORE_EXPORT void qDebug(const char *,...)
int width() const
Returns the width.
Definition: qsize.h:126
QPixmap texture() const
Returns the custom brush pattern, or a null pixmap if no custom brush pattern has been set...
Definition: qbrush.cpp:785
#define glProgramLocalParameter4fvARB
static const unsigned int num_fragment_variables
static QTestResult::TestLocation location
Definition: qtestresult.cpp:63
int height() const
Returns the height.
Definition: qsize.h:129
#define GL_FRAGMENT_PROGRAM_ARB
QSize offscreenSize() const
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ updateGLMatrix()

void QOpenGLPaintEnginePrivate::updateGLMatrix ( ) const

Definition at line 2218 of file qpaintengine_opengl.cpp.

Referenced by QOpenGLCoordinateOffset::enableOffset().

2219 {
2220  glMatrixMode(GL_MODELVIEW);
2221 #ifndef QT_OPENGL_ES
2222  glLoadMatrixd(&mv_matrix[0][0]);
2223 #else
2224  glLoadMatrixf(&mv_matrix[0][0]);
2225 #endif
2226 }

◆ updateGradient()

void QOpenGLPaintEnginePrivate::updateGradient ( const QBrush brush,
const QRectF bounds 
)

Definition at line 1558 of file qpaintengine_opengl.cpp.

1559 {
1560 #ifdef QT_OPENGL_ES
1561  Q_UNUSED(brush);
1562 #else
1563  bool has_mirrored_repeat = QGLExtensions::glExtensions() & QGLExtensions::MirroredRepeat;
1564  Qt::BrushStyle style = brush.style();
1565 
1566  if (has_mirrored_repeat && style == Qt::LinearGradientPattern) {
1567  const QLinearGradient *g = static_cast<const QLinearGradient *>(brush.gradient());
1568  QTransform m = brush.transform();
1569  QPointF realStart = g->start();
1570  QPointF realFinal = g->finalStop();
1571  QPointF start = m.map(realStart);
1572  QPointF stop;
1573 
1574  if (qFuzzyCompare(m.m11(), m.m22()) && m.m12() == 0.0 && m.m21() == 0.0) {
1575  // It is a simple uniform scale and/or translation
1576  stop = m.map(realFinal);
1577  } else {
1578  // It is not enough to just transform the endpoints.
1579  // We have to make sure the _pattern_ is transformed correctly.
1580 
1581  qreal odx = realFinal.x() - realStart.x();
1582  qreal ody = realFinal.y() - realStart.y();
1583 
1584  // nx, ny and dx, dy are normal and gradient direction after transform:
1585  qreal nx = m.m11()*ody - m.m21()*odx;
1586  qreal ny = m.m12()*ody - m.m22()*odx;
1587 
1588  qreal dx = m.m11()*odx + m.m21()*ody;
1589  qreal dy = m.m12()*odx + m.m22()*ody;
1590 
1591  qreal lx = 1 / (dx - dy*nx/ny);
1592  qreal ly = 1 / (dy - dx*ny/nx);
1593  qreal l = 1 / qSqrt(lx*lx+ly*ly);
1594 
1595  stop = start + QPointF(-ny, nx) * l/qSqrt(nx*nx+ny*ny);
1596  }
1597 
1598  float tr[4], f;
1599  tr[0] = stop.x() - start.x();
1600  tr[1] = stop.y() - start.y();
1601  f = 1.0 / (tr[0]*tr[0] + tr[1]*tr[1]);
1602  tr[0] *= f;
1603  tr[1] *= f;
1604  tr[2] = 0;
1605  tr[3] = -(start.x()*tr[0] + start.y()*tr[1]);
1606  brush_color[0] = brush_color[1] = brush_color[2] = brush_color[3] = 255;
1608  glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
1609  glTexGenfv(GL_S, GL_OBJECT_PLANE, tr);
1610  }
1611 
1612  if (use_fragment_programs) {
1613  if (style == Qt::RadialGradientPattern) {
1614  const QRadialGradient *g = static_cast<const QRadialGradient *>(brush.gradient());
1615  QPointF realCenter = g->center();
1616  QPointF realFocal = g->focalPoint();
1617  qreal realRadius = g->radius();
1618  QTransform translate(1, 0, 0, 1, -realFocal.x(), -realFocal.y());
1619  QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
1621  QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate;
1622 
1623  setInvMatrixData(inv_matrix);
1624 
1625  fmp_data[0] = realCenter.x() - realFocal.x();
1626  fmp_data[1] = realCenter.y() - realFocal.y();
1627 
1628  fmp2_m_radius2_data[0] = -fmp_data[0] * fmp_data[0] - fmp_data[1] * fmp_data[1] + realRadius * realRadius;
1629  } else if (style == Qt::ConicalGradientPattern) {
1630  const QConicalGradient *g = static_cast<const QConicalGradient *>(brush.gradient());
1631  QPointF realCenter = g->center();
1632  QTransform translate(1, 0, 0, 1, -realCenter.x(), -realCenter.y());
1633  QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
1635  QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate;
1636 
1637  setInvMatrixData(inv_matrix);
1638 
1639  angle_data[0] = -(g->angle() * 2 * Q_PI) / 360.0;
1640  } else if (style == Qt::LinearGradientPattern) {
1641  const QLinearGradient *g = static_cast<const QLinearGradient *>(brush.gradient());
1642 
1643  QPointF realStart = g->start();
1644  QPointF realFinal = g->finalStop();
1645  QTransform translate(1, 0, 0, 1, -realStart.x(), -realStart.y());
1646  QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
1648  QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate;
1649 
1650  setInvMatrixData(inv_matrix);
1651 
1652  QPointF l = realFinal - realStart;
1653 
1654  linear_data[0] = l.x();
1655  linear_data[1] = l.y();
1656 
1657  linear_data[2] = 1.0f / (l.x() * l.x() + l.y() * l.y());
1658  } else if (style != Qt::SolidPattern) {
1659  QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height());
1661  QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted();
1662 
1663  setInvMatrixData(inv_matrix);
1664  }
1665  }
1666 
1667  if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) {
1669  }
1670 #endif
1671 }
QPointF focalPoint() const
Returns the focal point of this radial gradient in logical coordinates.
Definition: qbrush.cpp:2251
BrushStyle
Definition: qnamespace.h:1162
double qreal
Definition: qglobal.h:1193
const QGradient * gradient() const
Returns the gradient describing this brush.
Definition: qbrush.cpp:871
qreal m21() const
Returns the horizontal shearing factor.
Definition: qtransform.h:249
int height() const
Definition: qpaintdevice.h:92
The QConicalGradient class is used in combination with QBrush to specify a conical gradient brush...
Definition: qbrush.h:329
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
qreal m22() const
Returns the vertical scaling factor.
Definition: qtransform.h:253
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
Definition: qglobal.h:2030
QTransform & translate(qreal dx, qreal dy)
Moves the coordinate system dx along the x axis and dy along the y axis, and returns a reference to t...
Definition: qtransform.cpp:417
static void qt_glColor4ubv(unsigned char *col)
The QRadialGradient class is used in combination with QBrush to specify a radial gradient brush...
Definition: qbrush.h:297
QTransform transform() const
Returns the current transformation matrix for the brush.
Definition: qbrush.h:185
qreal angle() const
Returns the start angle of the conical gradient in logical coordinates.
Definition: qbrush.cpp:2433
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
QPointF center() const
Returns the center of the conical gradient in logical coordinates.
Definition: qbrush.cpp:2391
void setInvMatrixData(const QTransform &inv_matrix)
qreal m12() const
Returns the vertical shearing factor.
Definition: qtransform.h:241
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...
Qt::BrushStyle style() const
Returns the brush style.
Definition: qbrush.h:182
QPointF start() const
Returns the start point of this linear gradient in logical coordinates.
Definition: qbrush.cpp:1796
The QLinearGradient class is used in combination with QBrush to specify a linear gradient brush...
Definition: qbrush.h:280
void createGradientPaletteTexture(const QGradient &g)
QFactoryLoader * l
qreal radius() const
Returns the radius of this radial gradient in logical coordinates.
Definition: qbrush.cpp:2150
static Extensions glExtensions()
Definition: qgl.cpp:5781
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
QPointF center() const
Returns the center of this radial gradient in logical coordinates.
Definition: qbrush.cpp:2102
QPaintDevice * pdev
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
qreal qSqrt(qreal v)
Definition: qmath.h:205
qreal m11() const
Returns the horizontal scaling factor.
Definition: qtransform.h:237
QPointF finalStop() const
Returns the final stop point of this linear gradient in logical coordinates.
Definition: qbrush.cpp:1856
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
static const qreal Q_PI
Definition: qmath_p.h:61

◆ updateUseEmulation()

void QOpenGLPaintEnginePrivate::updateUseEmulation ( )

Definition at line 2131 of file qpaintengine_opengl.cpp.

2132 {
2138 }
Q_GUI_EXPORT bool qt_isExtendedRadialGradient(const QBrush &brush)
Definition: qbrush.cpp:881
QBrush brush() const
Returns the brush used to fill strokes generated with this pen.
Definition: qpen.cpp:797
static bool needsEmulation(Qt::BrushStyle style)

Friends and Related Functions

◆ QGLMaskTextureCache

friend class QGLMaskTextureCache
friend

Definition at line 849 of file qpaintengine_opengl.cpp.

Properties

◆ angle_data

float QOpenGLPaintEnginePrivate::angle_data[4]

Definition at line 810 of file qpaintengine_opengl.cpp.

◆ brush_color

GLubyte QOpenGLPaintEnginePrivate::brush_color[4]

Definition at line 765 of file qpaintengine_opengl.cpp.

◆ brush_origin

QPointF QOpenGLPaintEnginePrivate::brush_origin

Definition at line 738 of file qpaintengine_opengl.cpp.

◆ brush_style

Qt::BrushStyle QOpenGLPaintEnginePrivate::brush_style

Definition at line 737 of file qpaintengine_opengl.cpp.

◆ cbrush

QBrush QOpenGLPaintEnginePrivate::cbrush

Definition at line 736 of file qpaintengine_opengl.cpp.

◆ composition_mode

QPainter::CompositionMode QOpenGLPaintEnginePrivate::composition_mode

Definition at line 741 of file qpaintengine_opengl.cpp.

◆ cpen

QPen QOpenGLPaintEnginePrivate::cpen

Definition at line 735 of file qpaintengine_opengl.cpp.

◆ current_style

Qt::BrushStyle QOpenGLPaintEnginePrivate::current_style

Definition at line 743 of file qpaintengine_opengl.cpp.

◆ device

QGLPaintDevice* QOpenGLPaintEnginePrivate::device

Definition at line 767 of file qpaintengine_opengl.cpp.

◆ dirty_drawable_texture

uint QOpenGLPaintEnginePrivate::dirty_drawable_texture

Definition at line 749 of file qpaintengine_opengl.cpp.

◆ dirty_stencil

QRegion QOpenGLPaintEnginePrivate::dirty_stencil

Definition at line 759 of file qpaintengine_opengl.cpp.

◆ drawable_texture

GLuint QOpenGLPaintEnginePrivate::drawable_texture

Definition at line 843 of file qpaintengine_opengl.cpp.

◆ drawable_texture_size

QSize QOpenGLPaintEnginePrivate::drawable_texture_size

Definition at line 844 of file qpaintengine_opengl.cpp.

◆ drawQueue

QList<QDrawQueueItem> QOpenGLPaintEnginePrivate::drawQueue

Definition at line 841 of file qpaintengine_opengl.cpp.

◆ fmp2_m_radius2_data

float QOpenGLPaintEnginePrivate::fmp2_m_radius2_data[4]

Definition at line 809 of file qpaintengine_opengl.cpp.

◆ fmp_data

float QOpenGLPaintEnginePrivate::fmp_data[4]

Definition at line 808 of file qpaintengine_opengl.cpp.

◆ fragment_brush

FragmentBrushType QOpenGLPaintEnginePrivate::fragment_brush

Definition at line 819 of file qpaintengine_opengl.cpp.

◆ fragment_composition_mode

FragmentCompositionModeType QOpenGLPaintEnginePrivate::fragment_composition_mode

Definition at line 820 of file qpaintengine_opengl.cpp.

◆ grad_palette

GLuint QOpenGLPaintEnginePrivate::grad_palette

Definition at line 802 of file qpaintengine_opengl.cpp.

◆ has_antialiasing

uint QOpenGLPaintEnginePrivate::has_antialiasing

◆ has_brush

uint QOpenGLPaintEnginePrivate::has_brush

Definition at line 746 of file qpaintengine_opengl.cpp.

◆ has_fast_composition_mode

uint QOpenGLPaintEnginePrivate::has_fast_composition_mode

Definition at line 754 of file qpaintengine_opengl.cpp.

◆ has_fast_pen

uint QOpenGLPaintEnginePrivate::has_fast_pen

Definition at line 747 of file qpaintengine_opengl.cpp.

◆ has_pen

uint QOpenGLPaintEnginePrivate::has_pen

Definition at line 745 of file qpaintengine_opengl.cpp.

◆ has_stencil_face_ext

uint QOpenGLPaintEnginePrivate::has_stencil_face_ext

Definition at line 750 of file qpaintengine_opengl.cpp.

◆ high_quality_antialiasing

uint QOpenGLPaintEnginePrivate::high_quality_antialiasing

Definition at line 752 of file qpaintengine_opengl.cpp.

◆ inv_matrix_data

float QOpenGLPaintEnginePrivate::inv_matrix_data[3][4]

Definition at line 807 of file qpaintengine_opengl.cpp.

◆ inverseScale

qreal QOpenGLPaintEnginePrivate::inverseScale

Definition at line 770 of file qpaintengine_opengl.cpp.

◆ last_created_state

QPainterState* QOpenGLPaintEnginePrivate::last_created_state
mutable

Definition at line 799 of file qpaintengine_opengl.cpp.

◆ linear_data

float QOpenGLPaintEnginePrivate::linear_data[4]

Definition at line 811 of file qpaintengine_opengl.cpp.

◆ mask_channel_data

float QOpenGLPaintEnginePrivate::mask_channel_data[4]

Definition at line 817 of file qpaintengine_opengl.cpp.

◆ mask_fragment_programs

GLuint QOpenGLPaintEnginePrivate::mask_fragment_programs[num_fragment_masks]

Definition at line 805 of file qpaintengine_opengl.cpp.

◆ mask_offset_data

float QOpenGLPaintEnginePrivate::mask_offset_data[4]

Definition at line 816 of file qpaintengine_opengl.cpp.

◆ matrix

QTransform QOpenGLPaintEnginePrivate::matrix

Definition at line 763 of file qpaintengine_opengl.cpp.

◆ max_texture_size

int QOpenGLPaintEnginePrivate::max_texture_size

Definition at line 846 of file qpaintengine_opengl.cpp.

◆ max_x

qreal QOpenGLPaintEnginePrivate::max_x

Definition at line 825 of file qpaintengine_opengl.cpp.

◆ max_y

qreal QOpenGLPaintEnginePrivate::max_y

Definition at line 826 of file qpaintengine_opengl.cpp.

◆ min_x

qreal QOpenGLPaintEnginePrivate::min_x

Definition at line 827 of file qpaintengine_opengl.cpp.

◆ min_y

qreal QOpenGLPaintEnginePrivate::min_y

Definition at line 828 of file qpaintengine_opengl.cpp.

◆ moveToCount

int QOpenGLPaintEnginePrivate::moveToCount

Definition at line 772 of file qpaintengine_opengl.cpp.

◆ mv_matrix

GLdouble QOpenGLPaintEnginePrivate::mv_matrix[4][4]

◆ offscreen

QGLOffscreen QOpenGLPaintEnginePrivate::offscreen

Definition at line 768 of file qpaintengine_opengl.cpp.

◆ opacity

qreal QOpenGLPaintEnginePrivate::opacity

Definition at line 740 of file qpaintengine_opengl.cpp.

◆ painter_fragment_programs

GLuint QOpenGLPaintEnginePrivate::painter_fragment_programs[num_fragment_brushes][num_fragment_composition_modes]

Definition at line 804 of file qpaintengine_opengl.cpp.

◆ path_start

QPointF QOpenGLPaintEnginePrivate::path_start

Definition at line 773 of file qpaintengine_opengl.cpp.

◆ pen_brush_style

Qt::BrushStyle QOpenGLPaintEnginePrivate::pen_brush_style

Definition at line 739 of file qpaintengine_opengl.cpp.

◆ pen_color

GLubyte QOpenGLPaintEnginePrivate::pen_color[4]

Definition at line 764 of file qpaintengine_opengl.cpp.

◆ porterduff_ab_data

float QOpenGLPaintEnginePrivate::porterduff_ab_data[4]

Definition at line 813 of file qpaintengine_opengl.cpp.

◆ porterduff_xyz_data

float QOpenGLPaintEnginePrivate::porterduff_xyz_data[4]

Definition at line 814 of file qpaintengine_opengl.cpp.

◆ projection_matrix

GLdouble QOpenGLPaintEnginePrivate::projection_matrix[4][4]

Definition at line 833 of file qpaintengine_opengl.cpp.

◆ ref_cleaner

QGLPrivateCleanup QOpenGLPaintEnginePrivate::ref_cleaner

Definition at line 848 of file qpaintengine_opengl.cpp.

◆ shader_ctx

QGLContext* QOpenGLPaintEnginePrivate::shader_ctx

Definition at line 801 of file qpaintengine_opengl.cpp.

◆ tess_points

QDataBuffer<QPointF> QOpenGLPaintEnginePrivate::tess_points

Definition at line 830 of file qpaintengine_opengl.cpp.

◆ tess_points_stops

QVector<int> QOpenGLPaintEnginePrivate::tess_points_stops

Definition at line 831 of file qpaintengine_opengl.cpp.

◆ txop

QTransform::TransformationType QOpenGLPaintEnginePrivate::txop

Definition at line 766 of file qpaintengine_opengl.cpp.

◆ use_emulation

uint QOpenGLPaintEnginePrivate::use_emulation

Definition at line 757 of file qpaintengine_opengl.cpp.

◆ use_fragment_programs

uint QOpenGLPaintEnginePrivate::use_fragment_programs

Definition at line 751 of file qpaintengine_opengl.cpp.

◆ use_smooth_pixmap_transform

uint QOpenGLPaintEnginePrivate::use_smooth_pixmap_transform

Definition at line 755 of file qpaintengine_opengl.cpp.

◆ use_stencil_method

uint QOpenGLPaintEnginePrivate::use_stencil_method

Definition at line 748 of file qpaintengine_opengl.cpp.

◆ use_system_clip

uint QOpenGLPaintEnginePrivate::use_system_clip

Definition at line 756 of file qpaintengine_opengl.cpp.


The documentation for this class was generated from the following file: