33 vgSetPaint(opacityPaint(), VG_FILL_PATH);
34 vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_MULTIPLY);
36 vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
40 vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
43 VGImage image =
static_cast<VGImage>(m_texture->comparisonKey());
44 QSize textureSize = m_texture->textureSize();
46 if (image == VG_INVALID_HANDLE || !textureSize.isValid())
52 vgTranslate(m_targetRect.width(), 0.0f);
57 vgSeti(VG_IMAGE_QUALITY, VG_IMAGE_QUALITY_BETTER);
59 vgSeti(VG_IMAGE_QUALITY, VG_IMAGE_QUALITY_NONANTIALIASED);
62 if (m_innerTargetRect != m_targetRect) {
64 QSGOpenVGHelpers::qDrawBorderImage(image, textureSize, m_targetRect, m_innerTargetRect, m_subSourceRect);
65 }
else if (m_tileHorizontal || m_tileVertical) {
68 float sx = m_targetRect.width() / (m_subSourceRect.width() * textureSize.width());
69 float sy = m_targetRect.height() / (m_subSourceRect.height() * textureSize.height());
70 QPointF offset(m_subSourceRect.left() * textureSize.width(), m_subSourceRect.top() * textureSize.height());
72 QSGOpenVGHelpers::qDrawTiled(image, textureSize, m_targetRect, offset, sx, sy);
77 QRectF sr(m_subSourceRect.left() * textureSize.width(), m_subSourceRect.top() * textureSize.height(),
78 m_subSourceRect.width() * textureSize.width(), m_subSourceRect.height() * textureSize.height());
80 if (m_subSourceRectImageDirty) {
81 if (m_subSourceRectImage != 0)
82 vgDestroyImage(m_subSourceRectImage);
83 m_subSourceRectImage = vgChildImage(image, sr.x(), sr.y(), sr.width(), sr.height());
84 m_subSourceRectImageDirty =
false;
88 if (sr == m_targetRect) {
92 float scaleX = m_targetRect.width() / sr.width();
93 float scaleY = m_targetRect.height() / sr.height();
94 vgTranslate(m_targetRect.x(), m_targetRect.y());
95 vgScale(scaleX, scaleY);
96 vgDrawImage(m_subSourceRectImage);