From 9e3bbc70ef6bd383435bf8d46165050a87f05d55 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Fri, 9 Oct 2009 15:50:16 +0200 Subject: Fixed bug where calling fill on pixmap with active painter would crash. Calling QPixmap::fill() on a pixmap may in some cases cause the painter's paint engine pointer to become stale. A subsequent call to the painter would therefore crash. Now, QPixmap::fill() will print a warning and return in those cases. I also added a warning in the documentation of QPixmap::fill(). Task-number: QTBUG-2832 Reviewed-by: Trond --- src/gui/image/qpixmap.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 558ae54..8133cc0 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -947,6 +947,9 @@ bool QPixmap::doImageIO(QImageWriter *writer, int quality) const /*! Fills the pixmap with the given \a color. + The effect of this function is undefined when the pixmap is + being painted on. + \sa {QPixmap#Pixmap Transformations}{Pixmap Transformations} */ @@ -955,6 +958,13 @@ void QPixmap::fill(const QColor &color) if (isNull()) return; + // Some people are probably already calling fill while a painter is active, so to not break + // their programs, only print a warning and return when the fill operation could cause a crash. + if (paintingActive() && (color.alpha() != 255) && !hasAlphaChannel()) { + qWarning("QPixmap::fill: Cannot fill while pixmap is being painted on"); + return; + } + detach(); data->fill(color); } -- cgit v0.12 From 7b61fbf03e170a7da37d5f57ed4053aae719ec7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 9 Oct 2009 12:33:03 +0200 Subject: Fixed bug on X11 with WA_TranslucentBackground and native child widgets. The native child widgets need to inherit the parent's visual in order to have a translucent background as well. Reviewed-by: Trond --- src/gui/kernel/qwidget_x11.cpp | 71 +++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 283dfb2..663178f 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -518,14 +518,18 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO if (!window) initializeWindow = true; + QX11Info *parentXinfo = parentWidget ? &parentWidget->d_func()->xinfo : 0; + if (desktop && qt_x11_create_desktop_on_screen >= 0 && qt_x11_create_desktop_on_screen != xinfo.screen()) { // desktop on a certain screen other than the default requested QX11InfoData *xd = &X11->screens[qt_x11_create_desktop_on_screen]; xinfo.setX11Data(xd); - } else if (parentWidget && parentWidget->d_func()->xinfo.screen() != xinfo.screen()) { - xinfo = parentWidget->d_func()->xinfo; + } else if (parentXinfo && (parentXinfo->screen() != xinfo.screen() + || parentXinfo->visual() != xinfo.visual())) + { + xinfo = *parentXinfo; } //get display, screen number, root window and desktop geometry for @@ -920,6 +924,43 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO #endif } +static void qt_x11_recreateWidget(QWidget *widget) +{ + if (widget->inherits("QGLWidget")) { + // We send QGLWidgets a ParentChange event which causes them to + // recreate their GL context, which in turn causes them to choose + // their visual again. Now that WA_TranslucentBackground is set, + // QGLContext::chooseVisual will select an ARGB visual. + QEvent e(QEvent::ParentChange); + QApplication::sendEvent(widget, &e); + } else { + // For regular widgets, reparent them with their parent which + // also triggers a recreation of the native window + QPoint pos = widget->pos(); + bool visible = widget->isVisible(); + if (visible) + widget->hide(); + + widget->setParent(widget->parentWidget(), widget->windowFlags()); + widget->move(pos); + if (visible) + widget->show(); + } +} + +static void qt_x11_recreateNativeWidgetsRecursive(QWidget *widget) +{ + if (widget->testAttribute(Qt::WA_NativeWindow)) + qt_x11_recreateWidget(widget); + + const QObjectList &children = widget->children(); + for (int i = 0; i < children.size(); ++i) { + QWidget *child = qobject_cast(children.at(i)); + if (child) + qt_x11_recreateNativeWidgetsRecursive(child); + } +} + void QWidgetPrivate::x11UpdateIsOpaque() { #ifndef QT_NO_XRENDER @@ -930,29 +971,9 @@ void QWidgetPrivate::x11UpdateIsOpaque() bool topLevel = (data.window_flags & Qt::Window); int screen = xinfo.screen(); if (topLevel && X11->use_xrender - && X11->argbVisuals[screen] && xinfo.depth() != 32) { - - if (q->inherits("QGLWidget")) { - // We send QGLWidgets a ParentChange event which causes them to - // recreate their GL context, which in turn causes them to choose - // their visual again. Now that WA_TranslucentBackground is set, - // QGLContext::chooseVisual will select an ARGB visual. - QEvent e(QEvent::ParentChange); - QApplication::sendEvent(q, &e); - } - else { - // For regular widgets, reparent them with their parent which - // also triggers a recreation of the native window - QPoint pos = q->pos(); - bool visible = q->isVisible(); - if (visible) - q->hide(); - - q->setParent(q->parentWidget(), q->windowFlags()); - q->move(pos); - if (visible) - q->show(); - } + && X11->argbVisuals[screen] && xinfo.depth() != 32) + { + qt_x11_recreateNativeWidgetsRecursive(q); } #endif } -- cgit v0.12 From 96bf551ec168e9b0d1a7c0892c4f809149c6ec51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 9 Oct 2009 15:04:05 +0200 Subject: Fixed documentation of QPixmap::x11Info() to not talk about widgets. Reviewed-by: Trond --- src/gui/image/qpixmap.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 8133cc0..5c8a1f9 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1673,10 +1673,10 @@ QPixmap QPixmap::transformed(const QMatrix &matrix, Qt::TransformationMode mode) identifies the contents of the QPixmap object. The x11Info() function returns information about the configuration - of the X display used to display the widget. The - x11PictureHandle() function returns the X11 Picture handle of the - pixmap for XRender support. Note that the two latter functions are - only available on x11. + of the X display used by the screen to which the pixmap currently + belongs. The x11PictureHandle() function returns the X11 Picture + handle of the pixmap for XRender support. Note that the two latter + functions are only available on x11. \endtable @@ -2094,7 +2094,7 @@ QPixmapData* QPixmap::pixmapData() const /*! \fn const QX11Info &QPixmap::x11Info() const \bold{X11 only:} Returns information about the configuration of - the X display used to display the widget. + the X display used by the screen to which the pixmap currently belongs. \warning This function is only available on X11. -- cgit v0.12 From e5954bba5bb1f88a847570d4790d0cef64f92209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 12 Oct 2009 15:48:50 +0200 Subject: Fixed bug when using QGLWidgets in -graphicssystem opengl We need to make sure that the FBO is bound in a valid context. Reviewed-by: Tom --- src/opengl/qglframebufferobject.cpp | 17 +++++++++++++++++ src/opengl/qglframebufferobject_p.h | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 5585208..9674cfb 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -331,8 +331,22 @@ void QGLFBOGLPaintDevice::setFBO(QGLFramebufferObject* f, } } +QGLContext *QGLFBOGLPaintDevice::context() const +{ + QGLContext *fboContext = const_cast(fbo->d_ptr->fbo_guard.context()); + QGLContext *currentContext = const_cast(QGLContext::currentContext()); + + if (QGLContextPrivate::contextGroup(fboContext) == QGLContextPrivate::contextGroup(currentContext)) + return currentContext; + else + return fboContext; +} + void QGLFBOGLPaintDevice::ensureActiveTarget() { + if (QGLContext::currentContext() != context()) + context()->makeCurrent(); + QGLContext* ctx = const_cast(QGLContext::currentContext()); Q_ASSERT(ctx); const GLuint fboId = fbo->d_func()->fbo(); @@ -344,6 +358,9 @@ void QGLFBOGLPaintDevice::ensureActiveTarget() void QGLFBOGLPaintDevice::beginPaint() { + if (QGLContext::currentContext() != context()) + context()->makeCurrent(); + // We let QFBO track the previously bound FBO rather than doing it // ourselves here. This has the advantage that begin/release & bind/end // work as expected. diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h index 055a752..43d4a41 100644 --- a/src/opengl/qglframebufferobject_p.h +++ b/src/opengl/qglframebufferobject_p.h @@ -109,7 +109,7 @@ class QGLFBOGLPaintDevice : public QGLPaintDevice public: virtual QPaintEngine* paintEngine() const {return fbo->paintEngine();} virtual QSize size() const {return fbo->size();} - virtual QGLContext* context() const {return const_cast(QGLContext::currentContext());} + virtual QGLContext* context() const; virtual QGLFormat format() const {return fboFormat;} virtual void ensureActiveTarget(); virtual void beginPaint(); -- cgit v0.12 From 33ed3d0bacddce214a43be60eb6481903e753a88 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 13 Oct 2009 10:18:59 +0200 Subject: Work around broken ATI X1600 drivers on Mac OS X The GLSL implementation messes up return values from functions so that all our srcPixel()'s become black and several matrices are off. We don't want to rewrite the shader code to fit an "ancient" graphics card, so we simply fall back to the GL 1 engine. Reviewed-by: Trond --- src/opengl/qgl.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 3f96d1c..8aef8b4 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -150,7 +150,25 @@ QGLSignalProxy *QGLSignalProxy::instance() class QGLEngineSelector { public: - QGLEngineSelector() : engineType(QPaintEngine::MaxUser) { } + QGLEngineSelector() : engineType(QPaintEngine::MaxUser) + { +#ifdef Q_WS_MAC + // The ATI X1600 driver for Mac OS X does not support return + // values from functions in GLSL. Since working around this in + // the GL2 engine would require a big, ugly rewrite, we're + // falling back to the GL 1 engine.. + QGLWidget *tmp = 0; + if (!QGLContext::currentContext()) { + tmp = new QGLWidget(); + tmp->makeCurrent(); + } + if (strstr((char *) glGetString(GL_RENDERER), "X1600")) + setPreferredPaintEngine(QPaintEngine::OpenGL); + if (tmp) + delete tmp; +#endif + + } void setPreferredPaintEngine(QPaintEngine::Type type) { if (type == QPaintEngine::OpenGL || type == QPaintEngine::OpenGL2) -- cgit v0.12 From c4bb0bd645e25bb68e9ac29f0dcc53566b148be9 Mon Sep 17 00:00:00 2001 From: gunnar Date: Fri, 9 Oct 2009 19:39:17 +0200 Subject: Make QStrokerOps, QStroker and QDashStroker properly modular --- src/gui/painting/qstroker.cpp | 39 ++++++++++++++++++++++++++++++++------- src/gui/painting/qstroker_p.h | 7 ++++++- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index 9063945..c57b3c1 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -969,13 +969,31 @@ QPointF qt_curves_for_arc(const QRectF &rect, qreal startAngle, qreal sweepLengt } +static inline void qdashstroker_moveTo(qfixed x, qfixed y, void *data) { + ((QStroker *) data)->moveTo(x, y); +} + +static inline void qdashstroker_lineTo(qfixed x, qfixed y, void *data) { + ((QStroker *) data)->lineTo(x, y); +} + +static inline void qdashstroker_cubicTo(qfixed, qfixed, qfixed, qfixed, qfixed, qfixed, void *) { + Q_ASSERT(0); +// ((QStroker *) data)->cubicTo(c1x, c1y, c2x, c2y, ex, ey); +} + + /******************************************************************************* * QDashStroker members */ QDashStroker::QDashStroker(QStroker *stroker) - : m_stroker(stroker), m_dashOffset(0) + : m_stroker(stroker), m_dashOffset(0), m_stroke_width(1), m_miter_limit(1) { - + if (m_stroker) { + setMoveToHook(qdashstroker_moveTo); + setLineToHook(qdashstroker_lineTo); + setCubicToHook(qdashstroker_cubicTo); + } } QVector QDashStroker::patternForStyle(Qt::PenStyle style) @@ -1012,10 +1030,16 @@ void QDashStroker::processCurrentSubpath() int dashCount = qMin(m_dashPattern.size(), 32); qfixed dashes[32]; + if (m_stroker) { + m_customData = m_stroker; + m_stroke_width = m_stroker->strokeWidth(); + m_miter_limit = m_stroker->miterLimit(); + } + qreal longestLength = 0; qreal sumLength = 0; for (int i=0; istrokeWidth(); + dashes[i] = qMax(m_dashPattern.at(i), qreal(0)) * m_stroke_width; sumLength += dashes[i]; if (dashes[i] > longestLength) longestLength = dashes[i]; @@ -1031,7 +1055,7 @@ void QDashStroker::processCurrentSubpath() int idash = 0; // Index to current dash qreal pos = 0; // The position on the curve, 0 <= pos <= path.length qreal elen = 0; // element length - qreal doffset = m_dashOffset * m_stroker->strokeWidth(); + qreal doffset = m_dashOffset * m_stroke_width; // make sure doffset is in range [0..sumLength) doffset -= qFloor(doffset / sumLength) * sumLength; @@ -1056,7 +1080,7 @@ void QDashStroker::processCurrentSubpath() qfixed2d line_to_pos; // Pad to avoid clipping the borders of thick pens. - qfixed padding = qt_real_to_fixed(qMax(m_stroker->strokeWidth(), m_stroker->miterLimit()) * longestLength); + qfixed padding = qt_real_to_fixed(qMax(m_stroke_width, m_miter_limit) * longestLength); qfixed2d clip_tl = { qt_real_to_fixed(m_clip_rect.left()) - padding, qt_real_to_fixed(m_clip_rect.top()) - padding }; qfixed2d clip_br = { qt_real_to_fixed(m_clip_rect.right()) + padding , @@ -1108,7 +1132,7 @@ void QDashStroker::processCurrentSubpath() // continue the current dash, without starting a // new subpath. if (!has_offset || !hasMoveTo) { - m_stroker->moveTo(move_to_pos.x, move_to_pos.y); + emitMoveTo(move_to_pos.x, move_to_pos.y); hasMoveTo = true; } @@ -1120,7 +1144,7 @@ void QDashStroker::processCurrentSubpath() || (line_to_pos.x > clip_tl.x && line_to_pos.x < clip_br.x && line_to_pos.y > clip_tl.y && line_to_pos.y < clip_br.y)) { - m_stroker->lineTo(line_to_pos.x, line_to_pos.y); + emitLineTo(line_to_pos.x, line_to_pos.y); } } else { move_to_pos.x = qt_real_to_fixed(p2.x()); @@ -1134,6 +1158,7 @@ void QDashStroker::processCurrentSubpath() estart = estop; prev = e; } + } QT_END_NAMESPACE diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h index d33eeb4..b78288c 100644 --- a/src/gui/painting/qstroker_p.h +++ b/src/gui/painting/qstroker_p.h @@ -171,7 +171,6 @@ protected: QRectF m_clip_rect; -private: void *m_customData; qStrokerMoveToHook m_moveTo; qStrokerLineToHook m_lineTo; @@ -258,12 +257,18 @@ public: virtual void begin(void *data); virtual void end(); + inline void setStrokeWidth(qreal width) { m_stroke_width = width; } + inline void setMiterLimit(qreal limit) { m_miter_limit = limit; } + protected: virtual void processCurrentSubpath(); QStroker *m_stroker; QVector m_dashPattern; qreal m_dashOffset; + + qreal m_stroke_width; + qreal m_miter_limit; }; -- cgit v0.12 From 3ca0529f18849e44de01dac620905ecdb28c3ce8 Mon Sep 17 00:00:00 2001 From: gunnar Date: Fri, 9 Oct 2009 19:39:17 +0200 Subject: Make QStrokerOps, QStroker and QDashStroker properly modular --- src/gui/painting/qstroker_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/painting/qstroker_p.h b/src/gui/painting/qstroker_p.h index b78288c..a10ebd9 100644 --- a/src/gui/painting/qstroker_p.h +++ b/src/gui/painting/qstroker_p.h @@ -366,16 +366,16 @@ inline void QStroker::emitCubicTo(qfixed c1x, qfixed c1y, */ inline void QDashStroker::begin(void *data) { - Q_ASSERT(m_stroker); - m_stroker->begin(data); + if (m_stroker) + m_stroker->begin(data); QStrokerOps::begin(data); } inline void QDashStroker::end() { - Q_ASSERT(m_stroker); QStrokerOps::end(); - m_stroker->end(); + if (m_stroker) + m_stroker->end(); } QT_END_NAMESPACE -- cgit v0.12 From 4b73217ceea55cb77eee550e039f8ec7ad566d80 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 13 Oct 2009 14:56:33 +0200 Subject: Fixed bug where bitmaps were painted black instead of in pen colour. penData and the pen painter state were not in sync when drawing bitmaps in the raster paint engine. Adding calls to ensurePen() fixed the bug. Task-number: QTBUG-4210 Reviewed-by: Trond --- src/gui/painting/qpaintengine_raster.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 6037bd5..995f0ac 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -2376,6 +2376,7 @@ void QRasterPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pixmap) Q_D(QRasterPaintEngine); QRasterPaintEngineState *s = state(); if (s->matrix.type() <= QTransform::TxTranslate) { + ensurePen(); drawBitmap(pos + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData); } else { drawImage(pos, d->rasterBuffer->colorizeBitmap(image, s->pen.color())); @@ -2389,6 +2390,7 @@ void QRasterPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pixmap) Q_D(QRasterPaintEngine); QRasterPaintEngineState *s = state(); if (s->matrix.type() <= QTransform::TxTranslate) { + ensurePen(); drawBitmap(pos + QPointF(s->matrix.dx(), s->matrix.dy()), image, &s->penData); } else { drawImage(pos, d->rasterBuffer->colorizeBitmap(image, s->pen.color())); -- cgit v0.12 From 8e709c4a3b8c1b843a662111e23076f8a02b2735 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 13 Oct 2009 16:51:53 +0200 Subject: Fixed handling of brush origin in the OpenGL paint engines. Fixed the OpenGL paint engines so that the brush origin is applied correctly and for all brushes just like in the raster paint engine. Task-number: QTBUG-2676 Reviewed-by: Trond --- src/gui/painting/qpainter.cpp | 3 +-- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 10 +++++----- src/opengl/qpaintengine_opengl.cpp | 15 ++++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index f271af9..155eefe 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -2051,8 +2051,7 @@ QPoint QPainter::brushOrigin() const Sets the brush origin to \a position. The brush origin specifies the (0, 0) coordinate of the painter's - brush. This setting only applies to pattern brushes and pixmap - brushes. + brush. Note that while the brushOrigin() was necessary to adopt the parent's background for a widget in Qt 3, this is no longer the diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index ab02c69..d7ce604 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -469,8 +469,6 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms() QPointF translationPoint; if (style <= Qt::DiagCrossPattern) { - translationPoint = q->state()->brushOrigin; - QColor col = qt_premultiplyColor(currentBrush->color(), (GLfloat)q->state()->opacity); shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::PatternColor), col); @@ -528,8 +526,6 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms() shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::HalfViewportSize), halfViewportSize); } else if (style == Qt::TexturePattern) { - translationPoint = q->state()->brushOrigin; - const QPixmap& texPixmap = currentBrush->texture(); if (qHasPixmapTexture(*currentBrush) && currentBrush->texture().isQBitmap()) { @@ -546,9 +542,13 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms() else qWarning("QGL2PaintEngineEx: Unimplemented fill style"); + const QPointF &brushOrigin = q->state()->brushOrigin; + QTransform matrix = q->state()->matrix; + matrix.translate(brushOrigin.x(), brushOrigin.y()); + QTransform translate(1, 0, 0, 1, -translationPoint.x(), -translationPoint.y()); QTransform gl_to_qt(1, 0, 0, -1, 0, height); - QTransform inv_matrix = gl_to_qt * (brushQTransform * q->state()->matrix).inverted() * translate; + QTransform inv_matrix = gl_to_qt * (brushQTransform * matrix).inverted() * translate; shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::BrushTransform), inv_matrix); shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::BrushTexture), QT_BRUSH_TEXTURE_UNIT); diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index 3e4a8e7..fc1695d 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -1596,7 +1596,8 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF qreal realRadius = g->radius(); QTransform translate(1, 0, 0, 1, -realFocal.x(), -realFocal.y()); QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height()); - QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate; + QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y()); + QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate; setInvMatrixData(inv_matrix); @@ -1609,7 +1610,8 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF QPointF realCenter = g->center(); QTransform translate(1, 0, 0, 1, -realCenter.x(), -realCenter.y()); QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height()); - QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate; + QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y()); + QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate; setInvMatrixData(inv_matrix); @@ -1621,8 +1623,8 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF QPointF realFinal = g->finalStop(); QTransform translate(1, 0, 0, 1, -realStart.x(), -realStart.y()); QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height()); - - QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate; + QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y()); + QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted() * translate; setInvMatrixData(inv_matrix); @@ -1633,10 +1635,9 @@ void QOpenGLPaintEnginePrivate::updateGradient(const QBrush &brush, const QRectF linear_data[2] = 1.0f / (l.x() * l.x() + l.y() * l.y()); } else if (style != Qt::SolidPattern) { - QTransform translate(1, 0, 0, 1, brush_origin.x(), brush_origin.y()); QTransform gl_to_qt(1, 0, 0, -1, 0, pdev->height()); - - QTransform inv_matrix = gl_to_qt * matrix.inverted() * brush.transform().inverted() * translate; + QTransform m = QTransform(matrix).translate(brush_origin.x(), brush_origin.y()); + QTransform inv_matrix = gl_to_qt * (brush.transform() * m).inverted(); setInvMatrixData(inv_matrix); } -- cgit v0.12 From 42a67d48d8772b91f59c4141b278a46d402d4276 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 14 Oct 2009 10:36:36 +0200 Subject: Fixed upside down brush patterns in the OpenGL paint engines. Task-number: QTBUG-2222 Reviewed-by: Gunnar --- src/opengl/gl2paintengineex/qglengineshadersource_p.h | 1 - src/opengl/util/pattern_brush.glsl | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h index 6712bf6..3eef808 100644 --- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h @@ -131,7 +131,6 @@ static const char* const qglslPositionWithPatternBrushVertexShader = "\ gl_Position.xy = gl_Position.xy * invertedHTexCoordsZ; \ gl_Position.w = invertedHTexCoordsZ; \ patternTexCoords.xy = (hTexCoords.xy * 0.125) * invertedHTexCoordsZ; \ - patternTexCoords.y = -patternTexCoords.y; \ }"; static const char* const qglslAffinePositionWithPatternBrushVertexShader diff --git a/src/opengl/util/pattern_brush.glsl b/src/opengl/util/pattern_brush.glsl index e070449..ac139b2 100644 --- a/src/opengl/util/pattern_brush.glsl +++ b/src/opengl/util/pattern_brush.glsl @@ -17,8 +17,6 @@ vec4 brush() coords *= inv_brush_texture_size; - coords.y = -coords.y; - float alpha = texture2D(brush_texture, coords).r; return gl_Color * alpha; -- cgit v0.12 From 5f7d9f9efe78fa7e537c32177c1b66a76fffddde Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 14 Oct 2009 10:39:17 +0200 Subject: updated fragment programs after changes to .glsl files --- src/opengl/util/fragmentprograms_p.h | 246 +++++++++++++++-------------------- 1 file changed, 105 insertions(+), 141 deletions(-) diff --git a/src/opengl/util/fragmentprograms_p.h b/src/opengl/util/fragmentprograms_p.h index 340023c..f61f275 100644 --- a/src/opengl/util/fragmentprograms_p.h +++ b/src/opengl/util/fragmentprograms_p.h @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + #ifndef FRAGMENTPROGRAMS_P_H #define FRAGMENTPROGRAMS_P_H @@ -5929,7 +5930,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.z;\n" "MUL R1.xy, R0.zwzw, c[0];\n" - "MOV R1.y, -R1;\n" "MUL R0.xy, fragment.position, c[7];\n" "TEX R0, R0, texture[0], 2D;\n" "TEX R1.x, R1, texture[2], 2D;\n" @@ -5970,7 +5970,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.z;\n" "MUL R1.xy, R0.zwzw, c[0];\n" - "MOV R1.y, -R1;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" "TEX R1.x, R1, texture[2], 2D;\n" @@ -6004,7 +6003,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "MOV R0.y, -R0;\n" "TEX R1.x, R0, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[5];\n" "ADD R3.xy, fragment.position, c[6];\n" @@ -6035,7 +6033,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "MOV R0.y, -R0;\n" "TEX R1.x, R0, texture[2], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R0.xy, fragment.position, c[5];\n" @@ -6081,9 +6078,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -6119,9 +6114,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -6159,13 +6152,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "MOV R0.y, -R0;\n" "TEX R0.x, R0, texture[2], 2D;\n" "MUL R1, fragment.color.primary, R0.x;\n" "MAX R0.x, R1.w, c[8].y;\n" "RCP R0.x, R0.x;\n" - "MAD R0.xyz, -R1, R0.x, c[8].x;\n" - "MAX R2.xyz, R0, c[8].y;\n" + "MAD R2.xyz, -R1, R0.x, c[8].x;\n" + "MAX R2.xyz, R2, c[8].y;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" "ADD R2.w, -R1, c[8].x;\n" @@ -6209,9 +6201,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[2], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R0.xy, fragment.position, c[5];\n" @@ -6261,7 +6251,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "MOV R0.y, -R0;\n" "TEX R1.x, R0, texture[2], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R0.xy, fragment.position, c[5];\n" @@ -6306,47 +6295,46 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "TEMP R4;\n" "TEMP R5;\n" "TEMP R6;\n" - "MUL R0.xyz, fragment.position.y, c[2];\n" - "MAD R0.xyz, fragment.position.x, c[1], R0;\n" - "ADD R1.xyz, R0, c[3];\n" - "RCP R0.z, R1.z;\n" - "MUL R1.xy, R1, R0.z;\n" - "MUL R1.xy, R1, c[0];\n" - "MOV R1.y, -R1;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.z, R0.w, c[8].y;\n" - "RCP R2.w, R1.z;\n" - "MUL R2.xyz, R0, R2.w;\n" - "MUL R6.xyz, -R2, c[9].x;\n" - "MAD R3.xyz, -R0, R2.w, c[8].x;\n" - "TEX R1.x, R1, texture[2], 2D;\n" - "MUL R1, fragment.color.primary, R1.x;\n" - "MAD R4.xyz, R1, c[8].z, -R1.w;\n" - "MUL R5.xyz, R3, R4;\n" - "MAD R3.xyz, -R3, R4, R1.w;\n" - "ADD R6.xyz, R6, c[8].w;\n" - "MAD R5.xyz, -R5, R6, R1.w;\n" - "RSQ R2.x, R2.x;\n" - "RSQ R2.z, R2.z;\n" - "RSQ R2.y, R2.y;\n" - "MUL R5.xyz, R0, R5;\n" - "MUL R3.xyz, R0, R3;\n" - "ADD R2.w, -R0, c[8].x;\n" - "RCP R2.x, R2.x;\n" - "RCP R2.z, R2.z;\n" - "RCP R2.y, R2.y;\n" - "MAD R2.xyz, R0.w, R2, -R0;\n" - "MUL R2.xyz, R2, R4;\n" - "MAD R2.xyz, R1.w, R0, R2;\n" - "ADD R6.xyz, R2, -R5;\n" + "MAX R1.x, R0.w, c[8].y;\n" + "RCP R2.w, R1.x;\n" + "MUL R1.xyz, R0, R2.w;\n" + "RSQ R1.w, R1.x;\n" + "RCP R2.x, R1.w;\n" + "RSQ R1.w, R1.y;\n" + "RCP R2.y, R1.w;\n" + "MUL R3.xyz, fragment.position.y, c[2];\n" + "MAD R3.xyz, fragment.position.x, c[1], R3;\n" + "ADD R3.xyz, R3, c[3];\n" + "RCP R2.z, R3.z;\n" + "MUL R3.xy, R3, R2.z;\n" + "MUL R3.xy, R3, c[0];\n" + "RSQ R1.w, R1.z;\n" + "RCP R2.z, R1.w;\n" + "MAD R6.xyz, R0.w, R2, -R0;\n" + "MUL R2.xyz, -R1, c[9].x;\n" + "ADD R5.xyz, R2, c[8].w;\n" + "MAD R2.xyz, -R0, R2.w, c[8].x;\n" + "TEX R3.x, R3, texture[2], 2D;\n" + "MUL R1, fragment.color.primary, R3.x;\n" + "MAD R3.xyz, R1, c[8].z, -R1.w;\n" + "MUL R4.xyz, R2, R3;\n" + "MAD R4.xyz, -R4, R5, R1.w;\n" + "MAD R2.xyz, -R2, R3, R1.w;\n" + "MUL R5.xyz, R6, R3;\n" + "MUL R4.xyz, R0, R4;\n" + "MAD R5.xyz, R1.w, R0, R5;\n" + "ADD R6.xyz, R5, -R4;\n" + "MUL R5.xyz, R0, c[9].x;\n" + "SGE R3.xyz, R5, R0.w;\n" + "MAD R3.xyz, R3, R6, R4;\n" + "MUL R2.xyz, R0, R2;\n" "MUL R4.xyz, R1, c[8].z;\n" - "MUL R2.xyz, R0, c[9].x;\n" - "SGE R2.xyz, R2, R0.w;\n" - "MAD R2.xyz, R2, R6, R5;\n" "SGE R4.xyz, R4, R1.w;\n" - "ADD R2.xyz, R2, -R3;\n" - "MAD R2.xyz, R4, R2, R3;\n" + "ADD R3.xyz, R3, -R2;\n" + "MAD R2.xyz, R4, R3, R2;\n" + "ADD R2.w, -R0, c[8].x;\n" "MAD R1.xyz, R1, R2.w, R2;\n" "ADD R2.x, -R1.w, c[8];\n" "MAD R2.xyz, R0, R2.x, R1;\n" @@ -6374,9 +6362,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -6410,9 +6396,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -6450,7 +6434,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.z;\n" "MUL R1.xy, R0.zwzw, c[0];\n" - "MOV R1.y, -R1;\n" "MUL R0.xy, fragment.position, c[6];\n" "TEX R0, R0, texture[0], 2D;\n" "MUL R2.xyz, R0, c[4].y;\n" @@ -6485,7 +6468,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.z;\n" "MUL R1.xy, R0.zwzw, c[0];\n" - "MOV R1.y, -R1;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" "TEX R1.x, R1, texture[1], 2D;\n" @@ -6511,9 +6493,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[1], 2D;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -6537,7 +6517,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "MOV R0.y, -R0;\n" "TEX R1.x, R0, texture[1], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R0.xy, fragment.position, c[4];\n" @@ -6577,9 +6556,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[1], 2D;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -6609,9 +6586,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[1], 2D;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -6642,31 +6617,30 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "MOV R0.y, -R0;\n" "TEX R0.x, R0, texture[1], 2D;\n" "MUL R1, fragment.color.primary, R0.x;\n" "MAX R0.x, R1.w, c[5].y;\n" "RCP R0.x, R0.x;\n" - "MAD R0.xyz, -R1, R0.x, c[5].x;\n" - "MAX R2.xyz, R0, c[5].y;\n" + "MAD R3.xyz, -R1, R0.x, c[5].x;\n" + "MAX R3.xyz, R3, c[5].y;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" - "ADD R2.w, -R1, c[5].x;\n" - "MUL R3.xyz, R0, R2.w;\n" + "ADD R2.x, -R1.w, c[5];\n" + "MUL R2.xyz, R0, R2.x;\n" "ADD R2.w, -R0, c[5].x;\n" - "MAD R3.xyz, R1, R2.w, R3;\n" + "MAD R2.xyz, R1, R2.w, R2;\n" "MUL R0.xyz, R1.w, R0;\n" - "RCP R2.x, R2.x;\n" - "RCP R2.y, R2.y;\n" - "RCP R2.z, R2.z;\n" - "MAD R2.xyz, R0, R2, R3;\n" + "RCP R3.x, R3.x;\n" + "RCP R3.y, R3.y;\n" + "RCP R3.z, R3.z;\n" + "MAD R3.xyz, R0, R3, R2;\n" "MAD R0.xyz, R1, R0.w, R0;\n" - "MAD R3.xyz, R1.w, R0.w, R3;\n" + "MAD R2.xyz, R1.w, R0.w, R2;\n" "MUL R2.w, R1, R0;\n" "ADD R1.x, R1.w, R0.w;\n" - "ADD R3.xyz, R3, -R2;\n" + "ADD R2.xyz, R2, -R3;\n" "SGE R0.xyz, R0, R2.w;\n" - "MAD result.color.xyz, R0, R3, R2;\n" + "MAD result.color.xyz, R0, R2, R3;\n" "MAD result.color.w, -R1, R0, R1.x;\n" "END\n" ; @@ -6686,9 +6660,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[1], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R0.xy, fragment.position, c[4];\n" @@ -6732,7 +6704,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "MOV R0.y, -R0;\n" "TEX R1.x, R0, texture[1], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R0.xy, fragment.position, c[4];\n" @@ -6743,19 +6714,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MUL R2.xyz, R2, R3;\n" "MUL R2.xyz, R2, c[5].x;\n" "MAD R2.xyz, R1.w, R0.w, -R2;\n" + "MAD R2.xyz, R1, R2.w, R2;\n" "MUL R4.xyz, R1, R2.w;\n" "MUL R3.xyz, R1, R0;\n" - "MAD R2.xyz, R1, R2.w, R2;\n" - "ADD R2.w, -R1, c[5].y;\n" "MUL R1.xyz, R1, c[5].x;\n" - "MAD R2.xyz, R0, R2.w, R2;\n" + "ADD R2.w, -R1, c[5].y;\n" "MAD R3.xyz, R3, c[5].x, R4;\n" - "MAD R0.xyz, R0, R2.w, R3;\n" - "ADD R2.w, R1, R0;\n" - "ADD R2.xyz, R2, -R0;\n" + "MAD R3.xyz, R0, R2.w, R3;\n" + "MAD R0.xyz, R0, R2.w, R2;\n" + "ADD R2.x, R1.w, R0.w;\n" + "ADD R0.xyz, R0, -R3;\n" "SGE R1.xyz, R1, R1.w;\n" - "MAD result.color.xyz, R1, R2, R0;\n" - "MAD result.color.w, -R1, R0, R2;\n" + "MAD result.color.xyz, R1, R0, R3;\n" + "MAD result.color.w, -R1, R0, R2.x;\n" "END\n" ; @@ -6771,46 +6742,45 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "TEMP R4;\n" "TEMP R5;\n" "TEMP R6;\n" - "MUL R0.xyz, fragment.position.y, c[2];\n" - "MAD R0.xyz, fragment.position.x, c[1], R0;\n" - "ADD R1.xyz, R0, c[3];\n" - "RCP R0.z, R1.z;\n" - "MUL R1.xy, R1, R0.z;\n" - "MUL R1.xy, R1, c[0];\n" - "MOV R1.y, -R1;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.z, R0.w, c[5].y;\n" - "RCP R2.w, R1.z;\n" - "MUL R2.xyz, R0, R2.w;\n" - "MUL R6.xyz, -R2, c[6].x;\n" - "MAD R3.xyz, -R0, R2.w, c[5].x;\n" - "TEX R1.x, R1, texture[1], 2D;\n" - "MUL R1, fragment.color.primary, R1.x;\n" - "MAD R4.xyz, R1, c[5].z, -R1.w;\n" - "MUL R5.xyz, R3, R4;\n" - "MAD R3.xyz, -R3, R4, R1.w;\n" - "ADD R6.xyz, R6, c[5].w;\n" - "MAD R5.xyz, -R5, R6, R1.w;\n" - "RSQ R2.x, R2.x;\n" - "RSQ R2.z, R2.z;\n" - "RSQ R2.y, R2.y;\n" - "MUL R5.xyz, R0, R5;\n" - "MUL R3.xyz, R0, R3;\n" - "RCP R2.x, R2.x;\n" - "RCP R2.z, R2.z;\n" - "RCP R2.y, R2.y;\n" - "MAD R2.xyz, R0.w, R2, -R0;\n" - "MUL R2.xyz, R2, R4;\n" - "MAD R2.xyz, R1.w, R0, R2;\n" - "ADD R6.xyz, R2, -R5;\n" + "MAX R1.x, R0.w, c[5].y;\n" + "RCP R2.w, R1.x;\n" + "MUL R1.xyz, R0, R2.w;\n" + "RSQ R1.w, R1.x;\n" + "RCP R2.x, R1.w;\n" + "RSQ R1.w, R1.y;\n" + "RCP R2.y, R1.w;\n" + "MUL R3.xyz, fragment.position.y, c[2];\n" + "MAD R3.xyz, fragment.position.x, c[1], R3;\n" + "ADD R3.xyz, R3, c[3];\n" + "RCP R2.z, R3.z;\n" + "MUL R3.xy, R3, R2.z;\n" + "MUL R3.xy, R3, c[0];\n" + "RSQ R1.w, R1.z;\n" + "RCP R2.z, R1.w;\n" + "MAD R6.xyz, R0.w, R2, -R0;\n" + "MUL R2.xyz, -R1, c[6].x;\n" + "ADD R5.xyz, R2, c[5].w;\n" + "MAD R2.xyz, -R0, R2.w, c[5].x;\n" + "TEX R3.x, R3, texture[1], 2D;\n" + "MUL R1, fragment.color.primary, R3.x;\n" + "MAD R3.xyz, R1, c[5].z, -R1.w;\n" + "MUL R4.xyz, R2, R3;\n" + "MAD R4.xyz, -R4, R5, R1.w;\n" + "MUL R5.xyz, R6, R3;\n" + "MAD R2.xyz, -R2, R3, R1.w;\n" + "MUL R4.xyz, R0, R4;\n" + "MAD R5.xyz, R1.w, R0, R5;\n" + "ADD R6.xyz, R5, -R4;\n" + "MUL R5.xyz, R0, c[6].x;\n" + "SGE R3.xyz, R5, R0.w;\n" + "MAD R3.xyz, R3, R6, R4;\n" + "MUL R2.xyz, R0, R2;\n" "MUL R4.xyz, R1, c[5].z;\n" - "MUL R2.xyz, R0, c[6].x;\n" - "SGE R2.xyz, R2, R0.w;\n" - "MAD R2.xyz, R2, R6, R5;\n" - "ADD R2.xyz, R2, -R3;\n" + "ADD R3.xyz, R3, -R2;\n" "SGE R4.xyz, R4, R1.w;\n" - "MAD R2.xyz, R4, R2, R3;\n" + "MAD R2.xyz, R4, R3, R2;\n" "ADD R2.w, -R0, c[5].x;\n" "MAD R1.xyz, R1, R2.w, R2;\n" "ADD R2.x, R1.w, R0.w;\n" @@ -6833,9 +6803,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[1], 2D;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -6863,9 +6831,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.xy, R0, c[0];\n" - "MOV R0.w, -R0.y;\n" - "MOV R0.z, R0.x;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" "TEX R1.x, R0.zwzw, texture[1], 2D;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -6894,7 +6860,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R1.z;\n" "MUL R0.zw, R1.xyxy, R0.z;\n" "MUL R1.xy, R0.zwzw, c[0];\n" - "MOV R1.y, -R1;\n" "ADD R0.xy, fragment.position, c[5];\n" "MUL R0.xy, R0, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -6915,7 +6880,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "MOV R0.y, -R0;\n" "TEX R0.x, R0, texture[0], 2D;\n" "MUL result.color, fragment.color.primary, R0.x;\n" "END\n" -- cgit v0.12 From 997dbe14d8bd4f370a7c972b594b5bc12e80f027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 13 Oct 2009 14:44:54 +0200 Subject: Fixed wrong use of graphics effects for pixmap graphics items. The blur, drop shadow, and bloom graphics effects are scale dependent, since they have radius and offset (in the case of drop shadow) parameters that are specified in device coordinates. Thus, we can't apply the effect in logical coordinates and scale up, and need to always use the device coordinate path for these effects. The opacity and grayscale effects still use the logical coordinate optimization. Reviewed-by: Gunnar Sletta --- src/gui/effects/qgraphicseffect.cpp | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index ee01fdc..01df46d 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -893,15 +893,8 @@ void QGraphicsBlurEffect::draw(QPainter *painter, QGraphicsEffectSource *source) return; } - QPoint offset; - if (source->isPixmap()) { - // No point in drawing in device coordinates (pixmap will be scaled anyways). - const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset); - d->filter->draw(painter, offset, pixmap); - return; - } - // Draw pixmap in device coordinates to avoid pixmap scaling. + QPoint offset; const QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset); QTransform restoreTransform = painter->worldTransform(); painter->setWorldTransform(QTransform()); @@ -1084,15 +1077,8 @@ void QGraphicsDropShadowEffect::draw(QPainter *painter, QGraphicsEffectSource *s return; } - QPoint offset; - if (source->isPixmap()) { - // No point in drawing in device coordinates (pixmap will be scaled anyways). - const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset); - d->filter->draw(painter, offset, pixmap); - return; - } - // Draw pixmap in device coordinates to avoid pixmap scaling. + QPoint offset; const QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset); QTransform restoreTransform = painter->worldTransform(); painter->setWorldTransform(QTransform()); @@ -1486,10 +1472,8 @@ void QGraphicsBloomEffect::draw(QPainter *painter, QGraphicsEffectSource *source return; } - const Qt::CoordinateSystem system = source->isPixmap() - ? Qt::LogicalCoordinates : Qt::DeviceCoordinates; QPoint offset; - QPixmap pixmap = source->pixmap(system, &offset); + QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset); QImage result = pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); // Blur. @@ -1514,14 +1498,10 @@ void QGraphicsBloomEffect::draw(QPainter *painter, QGraphicsEffectSource *source compPainter.drawImage(0, 0, overlay); compPainter.end(); - if (system == Qt::DeviceCoordinates) { - QTransform restoreTransform = painter->worldTransform(); - painter->setWorldTransform(QTransform()); - painter->drawImage(offset, result); - painter->setWorldTransform(restoreTransform); - } else { - painter->drawImage(offset, result); - } + QTransform restoreTransform = painter->worldTransform(); + painter->setWorldTransform(QTransform()); + painter->drawImage(offset, result); + painter->setWorldTransform(restoreTransform); } QT_END_NAMESPACE -- cgit v0.12 From d310f7c710ecb331a9689861f0551eabd38e946e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 13 Oct 2009 17:01:54 +0200 Subject: Added QPixmapData::createCompatiblePixmapData() used by QPixmap::copy(). QPixmap::copy() now returns a pixmap with the same pixmap backend. Reviewed-by: Gunnar Sletta --- src/gui/image/qpixmap.cpp | 8 +------- src/gui/image/qpixmap_mac.cpp | 5 +++++ src/gui/image/qpixmap_mac_p.h | 2 ++ src/gui/image/qpixmap_raster.cpp | 5 +++++ src/gui/image/qpixmap_raster_p.h | 2 ++ src/gui/image/qpixmap_x11.cpp | 5 +++++ src/gui/image/qpixmap_x11_p.h | 2 ++ src/gui/image/qpixmapdata.cpp | 13 +++++++++++++ src/gui/image/qpixmapdata_p.h | 4 +++- src/opengl/qpixmapdata_gl.cpp | 5 +++++ src/opengl/qpixmapdata_gl_p.h | 2 ++ src/openvg/qpixmapdata_vg.cpp | 5 +++++ src/openvg/qpixmapdata_vg_p.h | 2 ++ 13 files changed, 52 insertions(+), 8 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 5c8a1f9..c03a364 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -361,13 +361,7 @@ QPixmap QPixmap::copy(const QRect &rect) const const QRect r = rect.isEmpty() ? QRect(0, 0, width(), height()) : rect; - QPixmapData *d; - QGraphicsSystem* gs = QApplicationPrivate::graphicsSystem(); - if (gs) - d = gs->createPixmapData(data->pixelType()); - else - d = QGraphicsSystem::createDefaultPixmapData(data->pixelType()); - + QPixmapData *d = data->createCompatiblePixmapData(); d->copy(data.data(), r); return QPixmap(d); } diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index de532fd..afa6f83 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -166,6 +166,11 @@ QMacPixmapData::QMacPixmapData(PixelType type) { } +QPixmapData *QMacPixmapData::createCompatiblePixmapData() const +{ + return new QMacPixmapData(pixelType()); +} + #define BEST_BYTE_ALIGNMENT 16 #define COMPTUE_BEST_BYTES_PER_ROW(bpr) \ (((bpr) + (BEST_BYTE_ALIGNMENT - 1)) & ~(BEST_BYTE_ALIGNMENT - 1)) diff --git a/src/gui/image/qpixmap_mac_p.h b/src/gui/image/qpixmap_mac_p.h index 528dd1f..a3fb95f 100644 --- a/src/gui/image/qpixmap_mac_p.h +++ b/src/gui/image/qpixmap_mac_p.h @@ -65,6 +65,8 @@ public: QMacPixmapData(PixelType type); ~QMacPixmapData(); + QPixmapData *createCompatiblePixmapData() const; + void resize(int width, int height); void fromImage(const QImage &image, Qt::ImageConversionFlags flags); void copy(const QPixmapData *data, const QRect &rect); diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index ad68b07..3667e5b 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -64,6 +64,11 @@ QRasterPixmapData::~QRasterPixmapData() { } +QPixmapData *QRasterPixmapData::createCompatiblePixmapData() const +{ + return new QRasterPixmapData(pixelType()); +} + void QRasterPixmapData::resize(int width, int height) { QImage::Format format; diff --git a/src/gui/image/qpixmap_raster_p.h b/src/gui/image/qpixmap_raster_p.h index da0405e..1553940 100644 --- a/src/gui/image/qpixmap_raster_p.h +++ b/src/gui/image/qpixmap_raster_p.h @@ -68,6 +68,8 @@ public: QRasterPixmapData(PixelType type); ~QRasterPixmapData(); + QPixmapData *createCompatiblePixmapData() const; + void resize(int width, int height); void fromFile(const QString &filename, Qt::ImageConversionFlags flags); void fromImage(const QImage &image, Qt::ImageConversionFlags flags); diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 74543a0..ea9eff9 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -319,6 +319,11 @@ QX11PixmapData::QX11PixmapData(PixelType type) { } +QPixmapData *QX11PixmapData::createCompatiblePixmapData() const +{ + return new QX11PixmapData(pixelType()); +} + void QX11PixmapData::resize(int width, int height) { setSerialNumber(++qt_pixmap_serial); diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h index e34e690..2d6672d 100644 --- a/src/gui/image/qpixmap_x11_p.h +++ b/src/gui/image/qpixmap_x11_p.h @@ -71,6 +71,8 @@ public: // Qt::ImageConversionFlags flags); ~QX11PixmapData(); + QPixmapData *createCompatiblePixmapData() const; + void resize(int width, int height); void fromImage(const QImage &image, Qt::ImageConversionFlags flags); void copy(const QPixmapData *data, const QRect &rect); diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp index 93fc2eb..1ad1f02 100644 --- a/src/gui/image/qpixmapdata.cpp +++ b/src/gui/image/qpixmapdata.cpp @@ -43,6 +43,8 @@ #include #include #include +#include +#include QT_BEGIN_NAMESPACE @@ -67,6 +69,17 @@ QPixmapData::~QPixmapData() { } +QPixmapData *QPixmapData::createCompatiblePixmapData() const +{ + QPixmapData *d; + QGraphicsSystem *gs = QApplicationPrivate::graphicsSystem(); + if (gs) + d = gs->createPixmapData(pixelType()); + else + d = QGraphicsSystem::createDefaultPixmapData(pixelType()); + return d; +} + static QImage makeBitmapCompliantIfNeeded(QPixmapData *d, const QImage &image, Qt::ImageConversionFlags flags) { if (d->pixelType() == QPixmapData::BitmapType) { diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h index c26fba3..2f4f201 100644 --- a/src/gui/image/qpixmapdata_p.h +++ b/src/gui/image/qpixmapdata_p.h @@ -75,9 +75,11 @@ public: enum ClassId { RasterClass, X11Class, MacClass, DirectFBClass, OpenGLClass, OpenVGClass, CustomClass = 1024 }; - QPixmapData(PixelType pixelpType, int classId); + QPixmapData(PixelType pixelType, int classId); virtual ~QPixmapData(); + virtual QPixmapData *createCompatiblePixmapData() const; + virtual void resize(int width, int height) = 0; virtual void fromImage(const QImage &image, Qt::ImageConversionFlags flags) = 0; diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index cbb310b..3a657f1 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -240,6 +240,11 @@ QGLPixmapData::~QGLPixmapData() } } +QPixmapData *QGLPixmapData::createCompatiblePixmapData() const +{ + return new QGLPixmapData(pixelType()); +} + bool QGLPixmapData::isValid() const { return w > 0 && h > 0; diff --git a/src/opengl/qpixmapdata_gl_p.h b/src/opengl/qpixmapdata_gl_p.h index f67a7c2..6190d38 100644 --- a/src/opengl/qpixmapdata_gl_p.h +++ b/src/opengl/qpixmapdata_gl_p.h @@ -101,6 +101,8 @@ public: QGLPixmapData(PixelType type); ~QGLPixmapData(); + QPixmapData *createCompatiblePixmapData() const; + // Re-implemented from QPixmapData: void resize(int width, int height); void fromImage(const QImage &image, Qt::ImageConversionFlags flags); diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index 2003f3b..f86e116 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -101,6 +101,11 @@ QVGPixmapData::~QVGPixmapData() #endif } +QPixmapData *QVGPixmapData::createCompatiblePixmapData() const +{ + return new QVGPixmapData(pixelType()); +} + bool QVGPixmapData::isValid() const { return (w > 0 && h > 0); diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h index 99115df..f552c7b 100644 --- a/src/openvg/qpixmapdata_vg_p.h +++ b/src/openvg/qpixmapdata_vg_p.h @@ -72,6 +72,8 @@ public: QVGPixmapData(PixelType type); ~QVGPixmapData(); + QPixmapData *createCompatiblePixmapData() const; + // Is this pixmap valid (i.e. non-zero in size)? bool isValid() const; -- cgit v0.12 From ebe1ff6107cf26ae262961e12ab1eb2917648c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 13 Oct 2009 17:07:30 +0200 Subject: Added qt_toRasterPixmap functions. Similar to the existing qt_toX11Pixmap, this lets us explicitly create pixmaps with the raster pixmap backend. Reviewed-by: Gunnar Sletta --- src/gui/image/qpixmap_raster.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index 3667e5b..fc76dc3 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -55,6 +55,29 @@ QT_BEGIN_NAMESPACE const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; +QPixmap qt_toRasterPixmap(const QImage &image) +{ + QPixmapData *data = + new QRasterPixmapData(image.depth() == 1 + ? QPixmapData::BitmapType + : QPixmapData::PixmapType); + + data->fromImage(image, Qt::AutoColor); + + return QPixmap(data); +} + +QPixmap qt_toRasterPixmap(const QPixmap &pixmap) +{ + if (pixmap.isNull()) + return QPixmap(); + + if (QPixmap(pixmap).data_ptr()->classId() == QPixmapData::RasterClass) + return pixmap; + + return qt_toRasterPixmap(pixmap.toImage()); +} + QRasterPixmapData::QRasterPixmapData(PixelType type) : QPixmapData(type, RasterClass) { -- cgit v0.12 From 111558d709d7d55318bdf3de99442f26e246fcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 13 Oct 2009 18:18:56 +0200 Subject: Optimized bloom graphics effect implementation. Avoid doing so many conversions by operating on raster pixmaps, and by using INV_PREMUL/PREMUL instead of converting to ARGB32. Reviewed-by: Gunnar Sletta --- src/gui/effects/qgraphicseffect.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 01df46d..42845cc 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -105,6 +105,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -1461,6 +1462,8 @@ void QGraphicsBloomEffect::setStrength(qreal strength) The \a strength parameter holds the effect's new strength. */ +extern QPixmap qt_toRasterPixmap(const QPixmap &pixmap); + /*! \reimp */ @@ -1473,26 +1476,27 @@ void QGraphicsBloomEffect::draw(QPainter *painter, QGraphicsEffectSource *source } QPoint offset; - QPixmap pixmap = source->pixmap(Qt::DeviceCoordinates, &offset); - QImage result = pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied); + QPixmap pixmap = qt_toRasterPixmap(source->pixmap(Qt::DeviceCoordinates, &offset)); // Blur. - QPainter blurPainter(&pixmap); + QImage overlay(pixmap.size(), QImage::Format_ARGB32_Premultiplied); + overlay.fill(0); + + QPainter blurPainter(&overlay); d->blurFilter.draw(&blurPainter, QPointF(), pixmap); blurPainter.end(); // Brighten. - QImage overlay = pixmap.toImage().convertToFormat(QImage::Format_ARGB32); const int numBits = overlay.width() * overlay.height(); QRgb *bits = reinterpret_cast(overlay.bits()); for (int i = 0; i < numBits; ++i) { - const QRgb bit = bits[i]; - bits[i] = qRgba(d->colorTable[qRed(bit)], d->colorTable[qGreen(bit)], - d->colorTable[qBlue(bit)], qAlpha(bit)); + const QRgb pixel = INV_PREMUL(bits[i]); + bits[i] = PREMUL(qRgba(d->colorTable[qRed(pixel)], d->colorTable[qGreen(pixel)], + d->colorTable[qBlue(pixel)], qAlpha(pixel))); } // Composite. - QPainter compPainter(&result); + QPainter compPainter(&pixmap); compPainter.setCompositionMode(QPainter::CompositionMode_Overlay); compPainter.setOpacity(d->strength); compPainter.drawImage(0, 0, overlay); @@ -1500,7 +1504,7 @@ void QGraphicsBloomEffect::draw(QPainter *painter, QGraphicsEffectSource *source QTransform restoreTransform = painter->worldTransform(); painter->setWorldTransform(QTransform()); - painter->drawImage(offset, result); + painter->drawImage(offset, pixmap); painter->setWorldTransform(restoreTransform); } -- cgit v0.12 From 33d2bd641fd031d1a4e38198bf50538344a4ccdb Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 14 Oct 2009 17:22:57 +0200 Subject: Cleaned up OpenGL1 paint engine GLSL code. Fixed warnings about int->float and float->vecN conversions. Removed unused shader files. Reviewed-by: Trond --- src/opengl/util/composition_mode_colorburn.glsl | 4 +- src/opengl/util/composition_mode_colordodge.glsl | 4 +- src/opengl/util/composition_mode_darken.glsl | 2 +- src/opengl/util/composition_mode_difference.glsl | 2 +- src/opengl/util/composition_mode_exclusion.glsl | 2 +- src/opengl/util/composition_mode_hardlight.glsl | 6 +- src/opengl/util/composition_mode_lighten.glsl | 2 +- src/opengl/util/composition_mode_multiply.glsl | 2 +- src/opengl/util/composition_mode_overlay.glsl | 6 +- src/opengl/util/composition_mode_softlight.glsl | 10 +- src/opengl/util/conical_brush.glsl | 2 +- src/opengl/util/ellipse.glsl | 6 - src/opengl/util/ellipse_aa.glsl | 56 +- src/opengl/util/ellipse_aa_copy.glsl | 11 - src/opengl/util/ellipse_aa_radial.glsl | 24 - src/opengl/util/ellipse_functions.glsl | 63 - src/opengl/util/fragmentprograms_p.h | 1851 +++++++++++----------- src/opengl/util/masks.conf | 1 - src/opengl/util/simple_porter_duff.glsl | 6 +- src/opengl/util/trap_exact_aa.glsl | 12 +- 20 files changed, 1009 insertions(+), 1063 deletions(-) delete mode 100644 src/opengl/util/ellipse.glsl delete mode 100644 src/opengl/util/ellipse_aa_copy.glsl delete mode 100644 src/opengl/util/ellipse_aa_radial.glsl delete mode 100644 src/opengl/util/ellipse_functions.glsl diff --git a/src/opengl/util/composition_mode_colorburn.glsl b/src/opengl/util/composition_mode_colorburn.glsl index a5a153f..c913b97 100644 --- a/src/opengl/util/composition_mode_colorburn.glsl +++ b/src/opengl/util/composition_mode_colorburn.glsl @@ -5,8 +5,8 @@ vec4 composite(vec4 src, vec4 dst) { vec4 result; - result.rgb = mix(src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a), - src.a * (src.rgb * dst.a + dst.rgb * src.a - src.a * dst.a) / max(src.rgb, 0.00001) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a), + result.rgb = mix(src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a), + src.a * (src.rgb * dst.a + dst.rgb * src.a - src.a * dst.a) / max(src.rgb, 0.00001) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a), step(src.a * dst.a, src.rgb * dst.a + dst.rgb * src.a)); result.a = src.a + dst.a - src.a * dst.a; return result; diff --git a/src/opengl/util/composition_mode_colordodge.glsl b/src/opengl/util/composition_mode_colordodge.glsl index c194441..b75e83c 100644 --- a/src/opengl/util/composition_mode_colordodge.glsl +++ b/src/opengl/util/composition_mode_colordodge.glsl @@ -5,8 +5,8 @@ vec4 composite(vec4 src, vec4 dst) { vec4 result; - vec3 temp = src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a); - result.rgb = mix(dst.rgb * src.a / max(1 - src.rgb / max(src.a, 0.000001), 0.000001) + temp, + vec3 temp = src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); + result.rgb = mix(dst.rgb * src.a / max(1.0 - src.rgb / max(src.a, 0.000001), 0.000001) + temp, src.a * dst.a + temp, step(src.a * dst.a, src.rgb * dst.a + dst.rgb * src.a)); diff --git a/src/opengl/util/composition_mode_darken.glsl b/src/opengl/util/composition_mode_darken.glsl index c1e83fd..8bbb82b 100644 --- a/src/opengl/util/composition_mode_darken.glsl +++ b/src/opengl/util/composition_mode_darken.glsl @@ -3,7 +3,7 @@ vec4 composite(vec4 src, vec4 dst) { vec4 result; - result.rgb = min(src.rgb * dst.a, dst.rgb * src.a) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a); + result.rgb = min(src.rgb * dst.a, dst.rgb * src.a) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); result.a = src.a + dst.a - src.a * dst.a; return result; } diff --git a/src/opengl/util/composition_mode_difference.glsl b/src/opengl/util/composition_mode_difference.glsl index ca13ce7..3c46ec7 100644 --- a/src/opengl/util/composition_mode_difference.glsl +++ b/src/opengl/util/composition_mode_difference.glsl @@ -3,7 +3,7 @@ vec4 composite(vec4 src, vec4 dst) { vec4 result; - result.rgb = src.rgb + dst.rgb - 2 * min(src.rgb * dst.a, dst.rgb * src.a); + result.rgb = src.rgb + dst.rgb - 2.0 * min(src.rgb * dst.a, dst.rgb * src.a); result.a = src.a + dst.a - src.a * dst.a; return result; } diff --git a/src/opengl/util/composition_mode_exclusion.glsl b/src/opengl/util/composition_mode_exclusion.glsl index ccd1183..59c2da9 100644 --- a/src/opengl/util/composition_mode_exclusion.glsl +++ b/src/opengl/util/composition_mode_exclusion.glsl @@ -3,7 +3,7 @@ vec4 composite(vec4 src, vec4 dst) { vec4 result; - result.rgb = (src.rgb * dst.a + dst.rgb * src.a - 2 * src.rgb * dst.rgb) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a); + result.rgb = (src.rgb * dst.a + dst.rgb * src.a - 2.0 * src.rgb * dst.rgb) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); result.a = src.a + dst.a - src.a * dst.a; return result; } diff --git a/src/opengl/util/composition_mode_hardlight.glsl b/src/opengl/util/composition_mode_hardlight.glsl index 9dd4de3..4ea3550 100644 --- a/src/opengl/util/composition_mode_hardlight.glsl +++ b/src/opengl/util/composition_mode_hardlight.glsl @@ -5,9 +5,9 @@ vec4 composite(vec4 src, vec4 dst) { vec4 result; - result.rgb = mix(2 * src.rgb * dst.rgb + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a), - src.a * dst.a - 2 * (dst.a - dst.rgb) * (src.a - src.rgb) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a), - step(src.a, 2 * src.rgb)); + result.rgb = mix(2.0 * src.rgb * dst.rgb + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a), + src.a * dst.a - 2.0 * (dst.a - dst.rgb) * (src.a - src.rgb) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a), + step(src.a, 2.0 * src.rgb)); result.a = src.a + dst.a - src.a * dst.a; return result; diff --git a/src/opengl/util/composition_mode_lighten.glsl b/src/opengl/util/composition_mode_lighten.glsl index 1fbd27a..13ef507 100644 --- a/src/opengl/util/composition_mode_lighten.glsl +++ b/src/opengl/util/composition_mode_lighten.glsl @@ -3,7 +3,7 @@ vec4 composite(vec4 src, vec4 dst) { vec4 result; - result.rgb = max(src.rgb * dst.a, dst.rgb * src.a) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a); + result.rgb = max(src.rgb * dst.a, dst.rgb * src.a) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); result.a = src.a + dst.a - src.a * dst.a; return result; } diff --git a/src/opengl/util/composition_mode_multiply.glsl b/src/opengl/util/composition_mode_multiply.glsl index 268345a..f90b7f0 100644 --- a/src/opengl/util/composition_mode_multiply.glsl +++ b/src/opengl/util/composition_mode_multiply.glsl @@ -3,7 +3,7 @@ vec4 composite(vec4 src, vec4 dst) { vec4 result; - result.rgb = src.rgb * dst.rgb + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a); + result.rgb = src.rgb * dst.rgb + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); result.a = src.a + dst.a - src.a * dst.a; return result; } diff --git a/src/opengl/util/composition_mode_overlay.glsl b/src/opengl/util/composition_mode_overlay.glsl index a9b7226..f621bde 100644 --- a/src/opengl/util/composition_mode_overlay.glsl +++ b/src/opengl/util/composition_mode_overlay.glsl @@ -5,9 +5,9 @@ vec4 composite(vec4 src, vec4 dst) { vec4 result; - result.rgb = mix(2 * src.rgb * dst.rgb + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a), - src.a * dst.a - 2 * (dst.a - dst.rgb) * (src.a - src.rgb) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a), - step(dst.a, 2 * dst.rgb)); + result.rgb = mix(2.0 * src.rgb * dst.rgb + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a), + src.a * dst.a - 2.0 * (dst.a - dst.rgb) * (src.a - src.rgb) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a), + step(dst.a, 2.0 * dst.rgb)); result.a = src.a + dst.a - src.a * dst.a; return result; } diff --git a/src/opengl/util/composition_mode_softlight.glsl b/src/opengl/util/composition_mode_softlight.glsl index 0237827..4777b74 100644 --- a/src/opengl/util/composition_mode_softlight.glsl +++ b/src/opengl/util/composition_mode_softlight.glsl @@ -8,11 +8,11 @@ vec4 composite(vec4 src, vec4 dst) { vec4 result; float da = max(dst.a, 0.00001); - result.rgb = mix(dst.rgb * (src.a - (1 - dst.rgb / da) * (2 * src.rgb - src.a)), - mix(dst.rgb * (src.a - (1 - dst.rgb / da) * (2 * src.rgb - src.a) * (3 - 8 * dst.rgb / da)), - (dst.rgb * src.a + (sqrt(dst.rgb / da) * dst.a - dst.rgb) * (2 * src.rgb - src.a)), - step(dst.a, 8 * dst.rgb)), - step(src.a, 2 * src.rgb)) + src.rgb * (1 - dst.a) + dst.rgb * (1 - src.a); + result.rgb = mix(dst.rgb * (src.a - (1.0 - dst.rgb / da) * (2.0 * src.rgb - src.a)), + mix(dst.rgb * (src.a - (1.0 - dst.rgb / da) * (2.0 * src.rgb - src.a) * (3.0 - 8.0 * dst.rgb / da)), + (dst.rgb * src.a + (sqrt(dst.rgb / da) * dst.a - dst.rgb) * (2.0 * src.rgb - src.a)), + step(dst.a, 8.0 * dst.rgb)), + step(src.a, 2.0 * src.rgb)) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a); result.a = src.a + dst.a - src.a * dst.a; return result; } diff --git a/src/opengl/util/conical_brush.glsl b/src/opengl/util/conical_brush.glsl index 83ee2f5..b3ec1d7 100644 --- a/src/opengl/util/conical_brush.glsl +++ b/src/opengl/util/conical_brush.glsl @@ -20,7 +20,7 @@ vec4 brush() /* float val = fmod((atan2(-A.y, A.x) + angle) / (2.0 * M_PI), 1); */ if (abs(A.y) == abs(A.x)) A.y += 0.002; - float t = (atan2(-A.y, A.x) + angle) / (2.0 * M_PI); + float t = (atan(-A.y, A.x) + angle) / (2.0 * M_PI); float val = t - floor(t); return texture1D(palette, val); } diff --git a/src/opengl/util/ellipse.glsl b/src/opengl/util/ellipse.glsl deleted file mode 100644 index 860ae77..0000000 --- a/src/opengl/util/ellipse.glsl +++ /dev/null @@ -1,6 +0,0 @@ -#include "ellipse_functions.glsl" - -void main() -{ - gl_FragColor = ellipse(); -} diff --git a/src/opengl/util/ellipse_aa.glsl b/src/opengl/util/ellipse_aa.glsl index f7a6454..257e3bb 100644 --- a/src/opengl/util/ellipse_aa.glsl +++ b/src/opengl/util/ellipse_aa.glsl @@ -1,6 +1,58 @@ -#include "ellipse_functions.glsl" +uniform vec3 inv_matrix_m0; +uniform vec3 inv_matrix_m1; +uniform vec3 inv_matrix_m2; + +uniform vec2 ellipse_offset; + +// ellipse equation + +// s^2/a^2 + t^2/b^2 = 1 +// +// implicit equation: +// g(s,t) = 1 - s^2/r_s^2 - t^2/r_t^2 + +// distance from ellipse: +// grad = [dg/dx dg/dy] +// d(s, t) ~= g(s, t) / |grad| + +// dg/dx = dg/ds * ds/dx + dg/dt * dt/dx +// dg/dy = dg/ds * ds/dy + dg/dt * dt/dy + +float ellipse_aa() +{ + mat3 mat; + + mat[0] = inv_matrix_m0; + mat[1] = inv_matrix_m1; + mat[2] = inv_matrix_m2; + + vec3 hcoords = mat * vec3(gl_FragCoord.xy + ellipse_offset, 1); + float inv_w = 1.0 / hcoords.z; + vec2 st = hcoords.xy * inv_w; + + vec4 xy = vec4(mat[0].xy, mat[1].xy); + vec2 h = vec2(mat[0].z, mat[1].z); + + vec4 dstdxy = (xy.xzyw - h.xyxy * st.xxyy) * inv_w; + + //dstdxy.x = (mat[0].x - mat[0].z * st.x) * inv_w; // ds/dx + //dstdxy.y = (mat[1].x - mat[1].z * st.x) * inv_w; // ds/dy + //dstdxy.z = (mat[0].y - mat[0].z * st.y) * inv_w; // dt/dx + //dstdxy.w = (mat[1].y - mat[1].z * st.y) * inv_w; // dt/dy + + vec2 inv_r = gl_TexCoord[0].xy; + vec2 n = st * inv_r; + float g = 1.0 - dot(n, n); + + vec2 dgdst = -2.0 * n * inv_r; + + vec2 grad = vec2(dot(dgdst, dstdxy.xz), + dot(dgdst, dstdxy.yw)); + + return smoothstep(-0.5, 0.5, g * inversesqrt(dot(grad, grad))); +} void main() { - gl_FragColor = ellipse_aa(); + gl_FragColor = ellipse_aa().xxxx; } diff --git a/src/opengl/util/ellipse_aa_copy.glsl b/src/opengl/util/ellipse_aa_copy.glsl deleted file mode 100644 index 5372f58..0000000 --- a/src/opengl/util/ellipse_aa_copy.glsl +++ /dev/null @@ -1,11 +0,0 @@ -uniform vec2 r; // r_x and r_y - -uniform sampler2D texture; -uniform vec2 inv_texture_size; - -#include "ellipse_functions.glsl" - -void main() -{ - gl_FragColor = ellipse_aa() * texture2D(texture, gl_FragCoord.xy * inv_texture_size); -} diff --git a/src/opengl/util/ellipse_aa_radial.glsl b/src/opengl/util/ellipse_aa_radial.glsl deleted file mode 100644 index 0878f99..0000000 --- a/src/opengl/util/ellipse_aa_radial.glsl +++ /dev/null @@ -1,24 +0,0 @@ -#include "ellipse_functions.glsl" - -uniform sampler1D palette; -uniform vec2 fmp; -uniform float fmp2_m_radius2; -uniform vec4 inv_matrix; -uniform vec2 inv_matrix_offset; - -void main() -{ - // float2 A = frag_coord.xy;//mul(inv_matrix, frag_coord.xy) + inv_matrix_offset; - mat2 mat; - mat[0][0] = inv_matrix.x; - mat[0][1] = inv_matrix.y; - mat[1][0] = inv_matrix.z; - mat[1][1] = inv_matrix.w; - vec2 A = gl_FragCoord.xy * mat + inv_matrix_offset; - vec2 B = fmp; - float a = fmp2_m_radius2; - float b = 2.0*dot(A, B); - float c = -dot(A, A); - float val = (-b + sqrt(b*b - 4.0*a*c)) / (2.0*a); - gl_FragColor = texture1D(palette, val) * ellipse_aa(); -} diff --git a/src/opengl/util/ellipse_functions.glsl b/src/opengl/util/ellipse_functions.glsl deleted file mode 100644 index eed18e8..0000000 --- a/src/opengl/util/ellipse_functions.glsl +++ /dev/null @@ -1,63 +0,0 @@ -uniform vec3 inv_matrix_m0; -uniform vec3 inv_matrix_m1; -uniform vec3 inv_matrix_m2; - -uniform vec2 ellipse_offset; - -float ellipse() -{ - vec2 st = gl_TexCoord[0].st; - - if (dot(st, st) > 1) - discard; - - return 1.0; -} - -// ellipse equation - -// s^2/a^2 + t^2/b^2 = 1 -// -// implicit equation: -// g(s,t) = 1 - s^2/r_s^2 - t^2/r_t^2 - -// distance from ellipse: -// grad = [dg/dx dg/dy] -// d(s, t) ~= g(s, t) / |grad| - -// dg/dx = dg/ds * ds/dx + dg/dt * dt/dx -// dg/dy = dg/ds * ds/dy + dg/dt * dt/dy - -float ellipse_aa() -{ - mat3 mat; - - mat[0] = inv_matrix_m0; - mat[1] = inv_matrix_m1; - mat[2] = inv_matrix_m2; - - vec3 hcoords = mat * vec3(gl_FragCoord.xy + ellipse_offset, 1); - float inv_w = 1.0 / hcoords.z; - vec2 st = hcoords.xy * inv_w; - - vec4 xy = vec4(mat[0].xy, mat[1].xy); - vec2 h = vec2(mat[0].z, mat[1].z); - - vec4 dstdxy = (xy.xzyw - h.xyxy * st.xxyy) * inv_w; - - //dstdxy.x = (mat[0].x - mat[0].z * st.x) * inv_w; // ds/dx - //dstdxy.y = (mat[1].x - mat[1].z * st.x) * inv_w; // ds/dy - //dstdxy.z = (mat[0].y - mat[0].z * st.y) * inv_w; // dt/dx - //dstdxy.w = (mat[1].y - mat[1].z * st.y) * inv_w; // dt/dy - - vec2 inv_r = gl_TexCoord[0].xy; - vec2 n = st * inv_r; - float g = 1.0 - dot(n, n); - - vec2 dgdst = -2.0 * n * inv_r; - - vec2 grad = vec2(dot(dgdst, dstdxy.xz), - dot(dgdst, dstdxy.yw)); - - return smoothstep(-0.5, 0.5, g * inversesqrt(dot(grad, grad))); -} diff --git a/src/opengl/util/fragmentprograms_p.h b/src/opengl/util/fragmentprograms_p.h index f61f275..89cd182 100644 --- a/src/opengl/util/fragmentprograms_p.h +++ b/src/opengl/util/fragmentprograms_p.h @@ -132,58 +132,57 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA = "TEMP R2;\n" "TEMP R3;\n" "TEMP R4;\n" - "ADD R4.x, fragment.position, c[0];\n" + "ADD R3.z, fragment.position.x, c[0].x;\n" "ADD R0.y, fragment.position, -c[0].x;\n" - "MAX R3.w, fragment.texcoord[0].y, R0.y;\n" + "MAX R4.x, fragment.texcoord[0].y, R0.y;\n" "ADD R0.x, fragment.position.y, c[0];\n" - "MIN R3.z, R0.x, fragment.texcoord[0].x;\n" + "MIN R3.w, R0.x, fragment.texcoord[0].x;\n" "ADD R2.z, fragment.position.x, -c[0].x;\n" - "MOV R0.yw, R3.w;\n" - "MOV R0.xz, R3.z;\n" - "MAD R1, fragment.texcoord[1].xxzz, R0, fragment.texcoord[1].yyww;\n" - "MAD R1.zw, fragment.position.x, c[0].y, -R1;\n" - "MOV R0.z, R1.x;\n" - "MOV R0.w, R1.z;\n" - "MOV R0.y, R1.w;\n" - "MOV R0.x, R1.y;\n" - "MIN R2.xy, R0.zwzw, R0;\n" - "SGE R1.xy, R0, R0.zwzw;\n" - "ADD R1.zw, -fragment.texcoord[0], -fragment.texcoord[0];\n" - "MAX R0.xy, R0.zwzw, R0;\n" - "MAD R3.xy, R1, R1.zwzw, fragment.texcoord[0].zwzw;\n" - "MOV R2.w, R4.x;\n" - "ADD R1, -R2.xxyy, R2.zwzw;\n" - "MAD R1, R1, R3.xxyy, R3.w;\n" - "ADD R3.xy, R1.ywzw, R1.xzzw;\n" - "ADD R4.zw, R3.z, -R1.xyxz;\n" - "ADD R1.zw, -R3.w, R1.xyyw;\n" - "ADD R1.xy, R4.x, -R2;\n" - "MUL R1.xy, R1, R1.zwzw;\n" - "MAD R3.xy, -R3, c[0].x, R3.z;\n" - "ADD R2.w, R4.x, -R2.z;\n" - "MUL R0.zw, R3.xyxy, R2.w;\n" - "ADD R2.w, R3.z, -R3;\n" - "ADD R3.xy, -R2.z, R0;\n" + "MOV R2.w, R3.z;\n" + "MOV R0.yw, R4.x;\n" + "MOV R0.xz, R3.w;\n" + "MAD R0, fragment.texcoord[1].xxzz, R0, fragment.texcoord[1].yyww;\n" + "MAD R0.zw, fragment.position.x, c[0].y, -R0;\n" + "MOV R2.x, R0;\n" + "MOV R2.y, R0.z;\n" + "MOV R1.w, R0;\n" + "MOV R1.z, R0.y;\n" + "MIN R1.xy, R2, R1.zwzw;\n" + "SGE R0.xy, R1.zwzw, R2;\n" + "ADD R0.zw, -fragment.texcoord[0], -fragment.texcoord[0];\n" + "MAD R3.xy, R0, R0.zwzw, fragment.texcoord[0].zwzw;\n" + "ADD R0, -R1.xxyy, R2.zwzw;\n" + "MAD R0, R0, R3.xxyy, R4.x;\n" + "ADD R3.xy, R0.ywzw, R0.xzzw;\n" + "ADD R4.zw, R3.w, -R0.xyxz;\n" + "ADD R0.zw, -R4.x, R0.xyyw;\n" + "ADD R0.xy, R3.z, -R1;\n" + "MAX R1.zw, R2.xyxy, R1;\n" + "MUL R0.xy, R0, R0.zwzw;\n" + "MAD R3.xy, -R3, c[0].x, R3.w;\n" + "ADD R2.w, R3.z, -R2.z;\n" + "MUL R2.xy, R3, R2.w;\n" + "ADD R2.w, R3, -R4.x;\n" + "ADD R3.xy, -R2.z, R1.zwzw;\n" "MUL R3.xy, R4.zwzw, R3;\n" - "ADD R4.zw, R2.xyxy, R0.xyxy;\n" - "MAD R1.zw, R4, c[0].x, -R2.z;\n" - "MAD R1.xy, -R1, c[0].x, R2.w;\n" - "MAD R4.zw, R2.w, R1, -R1.xyxy;\n" - "SGE R1.zw, R4.x, R0.xyxy;\n" - "MAD R3.xy, R3, c[0].x, -R0.zwzw;\n" - "MAD R1.xy, R1.zwzw, R4.zwzw, R1;\n" - "MAD R0.zw, R1, R3.xyxy, R0;\n" - "ADD R1.zw, R0, -R1.xyxy;\n" - "SGE R0.zw, R2.z, R2.xyxy;\n" - "MAD R0.zw, R0, R1, R1.xyxy;\n" - "ADD R0.zw, -R2.w, R0;\n" - "SGE R1.xy, R4.x, R2;\n" - "MAD R0.zw, R1.xyxy, R0, R2.w;\n" - "SGE R0.xy, R0, R2.z;\n" - "MUL R0.xy, R0.zwzw, R0;\n" - "ADD R0.x, R2.w, -R0;\n" - "SGE R0.z, R3, R3.w;\n" - "ADD R0.x, R0, -R0.y;\n" + "ADD R4.zw, R1.xyxy, R1;\n" + "MAD R0.zw, R4, c[0].x, -R2.z;\n" + "MAD R0.xy, -R0, c[0].x, R2.w;\n" + "MAD R4.zw, R0, R2.w, -R0.xyxy;\n" + "SGE R0.zw, R3.z, R1;\n" + "MAD R0.xy, R0.zwzw, R4.zwzw, R0;\n" + "MAD R3.xy, R3, c[0].x, -R2;\n" + "MAD R0.zw, R0, R3.xyxy, R2.xyxy;\n" + "ADD R2.xy, R0.zwzw, -R0;\n" + "SGE R0.zw, R2.z, R1.xyxy;\n" + "MAD R0.xy, R0.zwzw, R2, R0;\n" + "SGE R0.zw, R1, R2.z;\n" + "ADD R0.xy, R0, -R2.w;\n" + "SGE R1.xy, R3.z, R1;\n" + "MAD R0.xy, R1, R0, R2.w;\n" + "MAD R0.x, -R0, R0.z, R2.w;\n" + "SGE R0.z, R3.w, R4.x;\n" + "MAD R0.x, -R0.y, R0.w, R0;\n" "MUL result.color, R0.x, R0.z;\n" "END\n" ; @@ -201,27 +200,27 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_MASK_ELLIPSE_AA = "MAD R0.xyz, R0.x, c[0], R1;\n" "ADD R0.xyz, R0, c[2];\n" "RCP R2.z, R0.z;\n" - "MUL R1.zw, R0.xyxy, R2.z;\n" - "MUL R2.xy, R1.zwzw, fragment.texcoord[0];\n" - "MOV R1.x, c[0].z;\n" - "MOV R1.y, c[1].z;\n" - "MOV R0.xy, c[0];\n" - "MOV R0.zw, c[1].xyxy;\n" - "MAD R0, R1.zzww, -R1.xyxy, R0.xzyw;\n" + "MUL R0.zw, R0.xyxy, R2.z;\n" + "MUL R2.xy, R0.zwzw, fragment.texcoord[0];\n" + "MOV R1.xy, c[0];\n" + "MOV R1.zw, c[1].xyxy;\n" + "MOV R0.x, c[0].z;\n" + "MOV R0.y, c[1].z;\n" + "MAD R0, R0.zzww, -R0.xyxy, R1.xzyw;\n" "MUL R1.xy, R2, fragment.texcoord[0];\n" "MUL R0, R2.z, R0;\n" "MUL R1.xy, R1, c[4].x;\n" "MUL R1.zw, R1.xyxy, R0.xyxz;\n" - "MUL R0.xy, R1, R0.ywzw;\n" - "ADD R0.w, R0.x, R0.y;\n" - "MUL R0.xy, R2, R2;\n" - "ADD R0.x, R0, R0.y;\n" - "ADD R0.z, R1, R1.w;\n" - "MUL R0.zw, R0, R0;\n" + "MUL R0.zw, R1.xyxy, R0.xyyw;\n" "ADD R0.y, R0.z, R0.w;\n" - "RSQ R0.y, R0.y;\n" - "ADD R0.x, -R0, c[4].y;\n" - "MAD_SAT R0.x, R0.y, R0, -c[4].z;\n" + "ADD R0.x, R1.z, R1.w;\n" + "MUL R0.xy, R0, R0;\n" + "ADD R0.x, R0, R0.y;\n" + "MUL R0.zw, R2.xyxy, R2.xyxy;\n" + "ADD R0.z, R0, R0.w;\n" + "ADD R0.y, -R0.z, c[4];\n" + "RSQ R0.x, R0.x;\n" + "MAD_SAT R0.x, R0, R0.y, -c[4].z;\n" "MUL R0.y, -R0.x, c[4].w;\n" "ADD R0.y, R0, c[5].x;\n" "MUL R0.x, R0, R0;\n" @@ -408,13 +407,13 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE "TEMP R3;\n" "MUL R0.xy, fragment.position, c[1];\n" "TEX R0, R0, texture[0], 2D;\n" - "ADD R1.y, -fragment.color.primary.w, c[4].x;\n" - "MAX R1.x, fragment.color.primary.w, c[4].y;\n" - "MUL R2.xyz, R0, R1.y;\n" + "ADD R1.x, -fragment.color.primary.w, c[4];\n" + "MAX R1.y, fragment.color.primary.w, c[4];\n" + "MUL R2.xyz, R0, R1.x;\n" "ADD R1.w, -R0, c[4].x;\n" "MAD R3.xyz, fragment.color.primary, R1.w, R2;\n" - "RCP R1.x, R1.x;\n" - "MAD R1.xyz, -fragment.color.primary, R1.x, c[4].x;\n" + "RCP R1.y, R1.y;\n" + "MAD R1.xyz, -fragment.color.primary, R1.y, c[4].x;\n" "MAX R1.xyz, R1, c[4].y;\n" "MUL R2.xyz, fragment.color.primary.w, R0;\n" "MUL R1.w, fragment.color.primary, R0;\n" @@ -520,8 +519,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT = "!!ARBfp1.0\n" "PARAM c[6] = { program.local[0..3],\n" - " { 1, 9.9999997e-006, 2, 3 },\n" - " { 8 } };\n" + " { 1, 2, 9.9999997e-006, 8 },\n" + " { 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -530,39 +529,39 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE "TEMP R5;\n" "MUL R0.xy, fragment.position, c[1];\n" "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.x, R0.w, c[4].y;\n" + "MAX R1.x, R0.w, c[4].z;\n" "RCP R1.w, R1.x;\n" - "MUL R2.xyz, R0, R1.w;\n" - "MUL R1.xyz, -R2, c[5].x;\n" - "RSQ R2.w, R2.x;\n" - "ADD R4.xyz, R1, c[4].w;\n" + "MUL R1.xyz, R0, R1.w;\n" + "MUL R4.xyz, -R1, c[4].w;\n" + "RSQ R2.x, R1.x;\n" + "RSQ R2.z, R1.z;\n" + "RSQ R2.y, R1.y;\n" "MAD R1.xyz, -R0, R1.w, c[4].x;\n" - "RSQ R2.z, R2.z;\n" - "RSQ R2.y, R2.y;\n" - "RCP R2.x, R2.w;\n" + "RCP R2.x, R2.x;\n" "RCP R2.z, R2.z;\n" "RCP R2.y, R2.y;\n" - "MAD R5.xyz, R0.w, R2, -R0;\n" - "MAD R2.xyz, fragment.color.primary, c[4].z, -fragment.color.primary.w;\n" - "MUL R3.xyz, R1, R2;\n" - "MAD R3.xyz, -R3, R4, fragment.color.primary.w;\n" - "MUL R4.xyz, R5, R2;\n" + "MAD R3.xyz, R0.w, R2, -R0;\n" + "MAD R2.xyz, fragment.color.primary, c[4].y, -fragment.color.primary.w;\n" + "MUL R3.xyz, R2, R3;\n" + "ADD R5.xyz, R4, c[5].x;\n" + "MUL R4.xyz, R1, R2;\n" "MAD R1.xyz, -R1, R2, fragment.color.primary.w;\n" - "MUL R3.xyz, R0, R3;\n" - "MAD R4.xyz, fragment.color.primary.w, R0, R4;\n" - "ADD R5.xyz, R4, -R3;\n" - "MUL R4.xyz, R0, c[5].x;\n" - "SGE R2.xyz, R4, R0.w;\n" - "MAD R2.xyz, R2, R5, R3;\n" + "MUL R2.xyz, fragment.color.primary, c[4].y;\n" + "MAD R5.xyz, -R4, R5, fragment.color.primary.w;\n" + "MAD R3.xyz, fragment.color.primary.w, R0, R3;\n" + "MAD R4.xyz, -R0, R5, R3;\n" + "MUL R3.xyz, R0, c[4].w;\n" + "MUL R5.xyz, R0, R5;\n" + "SGE R3.xyz, R3, R0.w;\n" + "MAD R3.xyz, R3, R4, R5;\n" + "MAD R3.xyz, -R0, R1, R3;\n" "MUL R1.xyz, R0, R1;\n" - "MUL R3.xyz, fragment.color.primary, c[4].z;\n" - "ADD R2.xyz, R2, -R1;\n" - "SGE R3.xyz, R3, fragment.color.primary.w;\n" - "MAD R1.xyz, R3, R2, R1;\n" - "ADD R1.w, -R0, c[4].x;\n" - "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n" - "ADD R1.w, -fragment.color.primary, c[4].x;\n" - "MAD R2.xyz, R0, R1.w, R1;\n" + "SGE R2.xyz, R2, fragment.color.primary.w;\n" + "MAD R2.xyz, R2, R3, R1;\n" + "ADD R1.x, -R0.w, c[4];\n" + "MAD R2.xyz, fragment.color.primary, R1.x, R2;\n" + "ADD R1.x, -fragment.color.primary.w, c[4];\n" + "MAD R2.xyz, R0, R1.x, R2;\n" "ADD R1.z, fragment.color.primary.w, R0.w;\n" "MAD R2.w, -fragment.color.primary, R0, R1.z;\n" "ADD R1.xy, fragment.position, c[2];\n" @@ -862,8 +861,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT_NOMASK = "!!ARBfp1.0\n" "PARAM c[3] = { program.local[0],\n" - " { 1, 9.9999997e-006, 2, 3 },\n" - " { 8 } };\n" + " { 1, 2, 9.9999997e-006, 8 },\n" + " { 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -872,41 +871,41 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE "TEMP R5;\n" "MUL R0.xy, fragment.position, c[0];\n" "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.x, R0.w, c[1].y;\n" + "MAX R1.x, R0.w, c[1].z;\n" "RCP R1.w, R1.x;\n" - "MUL R2.xyz, R0, R1.w;\n" - "MUL R1.xyz, -R2, c[2].x;\n" - "ADD R4.xyz, R1, c[1].w;\n" - "MAD R1.xyz, -R0, R1.w, c[1].x;\n" - "RSQ R2.w, R2.x;\n" - "RSQ R2.z, R2.z;\n" - "RSQ R2.y, R2.y;\n" - "RCP R2.x, R2.w;\n" + "MUL R1.xyz, R0, R1.w;\n" + "MUL R4.xyz, -R1, c[1].w;\n" + "RSQ R2.x, R1.x;\n" + "RSQ R2.z, R1.z;\n" + "RSQ R2.y, R1.y;\n" + "RCP R2.x, R2.x;\n" "RCP R2.z, R2.z;\n" "RCP R2.y, R2.y;\n" - "MAD R5.xyz, R0.w, R2, -R0;\n" - "MAD R2.xyz, fragment.color.primary, c[1].z, -fragment.color.primary.w;\n" - "MUL R3.xyz, R1, R2;\n" - "MAD R3.xyz, -R3, R4, fragment.color.primary.w;\n" - "MUL R4.xyz, R5, R2;\n" + "MAD R3.xyz, R0.w, R2, -R0;\n" + "MAD R2.xyz, fragment.color.primary, c[1].y, -fragment.color.primary.w;\n" + "MUL R3.xyz, R2, R3;\n" + "MAD R3.xyz, fragment.color.primary.w, R0, R3;\n" + "MAD R1.xyz, -R0, R1.w, c[1].x;\n" + "ADD R5.xyz, R4, c[2].x;\n" + "MUL R4.xyz, R1, R2;\n" "MAD R1.xyz, -R1, R2, fragment.color.primary.w;\n" - "MUL R3.xyz, R0, R3;\n" - "MAD R4.xyz, fragment.color.primary.w, R0, R4;\n" - "ADD R5.xyz, R4, -R3;\n" - "MUL R4.xyz, R0, c[2].x;\n" - "SGE R2.xyz, R4, R0.w;\n" - "MAD R2.xyz, R2, R5, R3;\n" + "MAD R5.xyz, -R4, R5, fragment.color.primary.w;\n" + "MAD R4.xyz, -R0, R5, R3;\n" + "MUL R3.xyz, R0, c[1].w;\n" + "MUL R2.xyz, fragment.color.primary, c[1].y;\n" + "MUL R5.xyz, R0, R5;\n" + "SGE R3.xyz, R3, R0.w;\n" + "MAD R3.xyz, R3, R4, R5;\n" + "MAD R3.xyz, -R0, R1, R3;\n" "MUL R1.xyz, R0, R1;\n" - "MUL R3.xyz, fragment.color.primary, c[1].z;\n" - "ADD R2.xyz, R2, -R1;\n" - "SGE R3.xyz, R3, fragment.color.primary.w;\n" - "MAD R1.xyz, R3, R2, R1;\n" - "ADD R1.w, -R0, c[1].x;\n" - "MAD R1.xyz, fragment.color.primary, R1.w, R1;\n" - "ADD R1.w, fragment.color.primary, R0;\n" - "ADD R2.x, -fragment.color.primary.w, c[1];\n" - "MAD result.color.xyz, R0, R2.x, R1;\n" - "MAD result.color.w, -fragment.color.primary, R0, R1;\n" + "SGE R2.xyz, R2, fragment.color.primary.w;\n" + "MAD R2.xyz, R2, R3, R1;\n" + "ADD R1.x, -R0.w, c[1];\n" + "MAD R2.xyz, fragment.color.primary, R1.x, R2;\n" + "ADD R1.x, fragment.color.primary.w, R0.w;\n" + "ADD R1.y, -fragment.color.primary.w, c[1].x;\n" + "MAD result.color.xyz, R0, R1.y, R2;\n" + "MAD result.color.w, -fragment.color.primary, R0, R1.x;\n" "END\n" ; @@ -1086,18 +1085,18 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "ADD R0.z, R0, R0.w;\n" "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" + "MUL R0.y, R0.x, c[9].x;\n" + "MOV R0.x, c[9];\n" "MUL R0.z, -R0, c[1].x;\n" + "MUL R0.z, R0, c[9].y;\n" + "MAD R0.z, R0.y, R0.y, -R0;\n" "ADD R3.xy, fragment.position, c[7];\n" - "MUL R0.y, R0.z, c[9];\n" - "MUL R0.x, R0, c[9];\n" - "MAD R0.z, R0.x, R0.x, -R0.y;\n" - "MOV R0.y, c[9].x;\n" + "MUL R0.w, R0.x, c[1].x;\n" "RSQ R0.z, R0.z;\n" - "RCP R0.z, R0.z;\n" - "MUL R0.y, R0, c[1].x;\n" - "ADD R0.x, -R0, R0.z;\n" - "RCP R0.y, R0.y;\n" - "MUL R0.z, R0.x, R0.y;\n" + "RCP R0.x, R0.z;\n" + "RCP R0.z, R0.w;\n" + "ADD R0.x, -R0.y, R0;\n" + "MUL R0.z, R0.x, R0;\n" "TEX R1, R0.z, texture[2], 1D;\n" "MUL R0.xy, fragment.position, c[6];\n" "TEX R0, R0, texture[0], 2D;\n" @@ -1126,24 +1125,24 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" + "MUL R0.y, R0.x, c[9].x;\n" + "MOV R0.x, c[9];\n" "MUL R0.z, -R0, c[1].x;\n" + "MUL R0.z, R0, c[9].y;\n" + "MAD R0.z, R0.y, R0.y, -R0;\n" "MUL R1.xy, fragment.position, c[6];\n" "TEX R1, R1, texture[0], 2D;\n" - "MUL R0.y, R0.z, c[9];\n" - "MUL R0.x, R0, c[9];\n" - "MAD R0.z, R0.x, R0.x, -R0.y;\n" - "MOV R0.y, c[9].x;\n" + "MUL R0.w, R0.x, c[1].x;\n" "RSQ R0.z, R0.z;\n" - "RCP R0.z, R0.z;\n" - "MUL R0.y, R0, c[1].x;\n" - "ADD R0.x, -R0, R0.z;\n" - "RCP R0.y, R0.y;\n" - "MUL R0.x, R0, R0.y;\n" - "TEX R0, R0, texture[2], 1D;\n" + "RCP R0.x, R0.z;\n" "ADD R2.w, -R1, c[9].z;\n" + "RCP R0.z, R0.w;\n" + "ADD R0.x, -R0.y, R0;\n" + "MUL R0.x, R0, R0.z;\n" + "TEX R0, R0, texture[2], 1D;\n" "ADD R3.xyz, R0.w, -R0;\n" "ADD R2.xyz, R1.w, -R1;\n" "MUL R2.xyz, R2, R3;\n" @@ -1284,20 +1283,20 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" + "MUL R0.y, R0.x, c[9].x;\n" + "MOV R0.x, c[9];\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[9];\n" - "MUL R0.x, R0, c[9];\n" - "MAD R0.z, R0.x, R0.x, -R0.y;\n" - "MOV R0.y, c[9].x;\n" + "MUL R0.z, R0, c[9].y;\n" + "MAD R0.z, R0.y, R0.y, -R0;\n" + "MUL R0.w, R0.x, c[1].x;\n" "RSQ R0.z, R0.z;\n" - "RCP R0.z, R0.z;\n" - "MUL R0.y, R0, c[1].x;\n" - "ADD R0.x, -R0, R0.z;\n" - "RCP R0.y, R0.y;\n" - "MUL R0.x, R0, R0.y;\n" + "RCP R0.x, R0.z;\n" + "RCP R0.z, R0.w;\n" + "ADD R0.x, -R0.y, R0;\n" + "MUL R0.x, R0, R0.z;\n" "TEX R0, R0, texture[2], 1D;\n" "MAX R1.x, R0.w, c[9].w;\n" "RCP R1.x, R1.x;\n" @@ -1351,17 +1350,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[9];\n" - "MUL R0.x, R0, c[9];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "RSQ R0.z, R0.y;\n" + "MUL R0.y, R0.x, c[9].x;\n" + "MUL R0.z, R0, c[9].y;\n" + "MAD R0.x, R0.y, R0.y, -R0.z;\n" + "RSQ R0.z, R0.x;\n" + "MOV R0.x, c[9];\n" + "MUL R0.w, R0.x, c[1].x;\n" "RCP R0.z, R0.z;\n" - "ADD R0.x, -R0, R0.z;\n" + "ADD R0.x, -R0.y, R0.z;\n" + "RCP R0.y, R0.w;\n" "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n" "TEX R1, R0.zwzw, texture[0], 2D;\n" - "MOV R0.y, c[9].x;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.y, R0.y;\n" "MUL R0.x, R0, R0.y;\n" "TEX R0, R0, texture[2], 1D;\n" "MUL R2.xyz, R0.w, R1;\n" @@ -1409,24 +1408,24 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" + "MUL R0.y, R0.x, c[9].x;\n" + "MOV R0.x, c[9];\n" "MUL R0.z, -R0, c[1].x;\n" + "MUL R0.z, R0, c[9].y;\n" + "MAD R0.z, R0.y, R0.y, -R0;\n" "MUL R1.xy, fragment.position, c[6];\n" "TEX R1, R1, texture[0], 2D;\n" - "MUL R0.y, R0.z, c[9];\n" - "MUL R0.x, R0, c[9];\n" - "MAD R0.z, R0.x, R0.x, -R0.y;\n" - "MOV R0.y, c[9].x;\n" + "MUL R0.w, R0.x, c[1].x;\n" "RSQ R0.z, R0.z;\n" - "RCP R0.z, R0.z;\n" - "MUL R0.y, R0, c[1].x;\n" - "ADD R0.x, -R0, R0.z;\n" - "RCP R0.y, R0.y;\n" - "MUL R0.x, R0, R0.y;\n" - "TEX R0, R0, texture[2], 1D;\n" + "RCP R0.x, R0.z;\n" "ADD R2.w, -R1, c[9].z;\n" + "RCP R0.z, R0.w;\n" + "ADD R0.x, -R0.y, R0;\n" + "MUL R0.x, R0, R0.z;\n" + "TEX R0, R0, texture[2], 1D;\n" "ADD R3.xyz, R0.w, -R0;\n" "ADD R2.xyz, R1.w, -R1;\n" "MUL R2.xyz, R2, R3;\n" @@ -1458,7 +1457,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..8],\n" " { 2, 4, 1, 9.9999997e-006 },\n" - " { 3, 8 } };\n" + " { 8, 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -1470,65 +1469,65 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "MAD R0.xyz, fragment.position.x, c[2], R0;\n" "ADD R0.xyz, R0, c[4];\n" "RCP R0.z, R0.z;\n" + "MUL R1.xy, fragment.position, c[6];\n" + "TEX R1, R1, texture[0], 2D;\n" + "MAX R0.w, R1, c[9];\n" + "RCP R2.w, R0.w;\n" + "MUL R5.xyz, R1, R2.w;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" + "MUL R0.y, R0.x, c[9].x;\n" + "MOV R0.x, c[9];\n" + "RSQ R2.x, R5.x;\n" + "RSQ R2.z, R5.z;\n" + "RSQ R2.y, R5.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[9];\n" - "MUL R0.x, R0, c[9];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "MOV R0.z, c[9].x;\n" - "MUL R1.y, R0.z, c[1].x;\n" - "RSQ R0.y, R0.y;\n" - "RCP R0.y, R0.y;\n" - "ADD R1.x, -R0, R0.y;\n" - "RCP R1.y, R1.y;\n" - "MUL R0.xy, fragment.position, c[6];\n" - "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.z, R0.w, c[9].w;\n" - "RCP R2.w, R1.z;\n" - "MUL R2.xyz, R0, R2.w;\n" - "MAD R6.xyz, -R2, c[10].y, c[10].x;\n" - "MAD R3.xyz, -R0, R2.w, c[9].z;\n" - "RSQ R2.w, R2.x;\n" - "RCP R2.x, R2.w;\n" - "MUL R1.x, R1, R1.y;\n" - "TEX R1, R1, texture[2], 1D;\n" - "MAD R4.xyz, R1, c[9].x, -R1.w;\n" - "MUL R5.xyz, R3, R4;\n" - "MAD R5.xyz, -R5, R6, R1.w;\n" - "MAD R3.xyz, -R3, R4, R1.w;\n" - "RSQ R2.z, R2.z;\n" - "RSQ R2.y, R2.y;\n" - "MUL R5.xyz, R0, R5;\n" - "MUL R3.xyz, R0, R3;\n" - "ADD R2.w, -R0, c[9].z;\n" + "MUL R0.z, R0, c[9].y;\n" + "MAD R0.z, R0.y, R0.y, -R0;\n" + "MUL R0.w, R0.x, c[1].x;\n" + "RSQ R0.z, R0.z;\n" + "RCP R0.x, R0.z;\n" + "RCP R0.z, R0.w;\n" + "ADD R0.x, -R0.y, R0;\n" + "MUL R0.x, R0, R0.z;\n" + "TEX R0, R0, texture[2], 1D;\n" + "MAD R3.xyz, R0, c[9].x, -R0.w;\n" + "MAD R6.xyz, -R5, c[10].x, c[10].y;\n" + "RCP R2.x, R2.x;\n" "RCP R2.z, R2.z;\n" "RCP R2.y, R2.y;\n" - "MAD R2.xyz, R0.w, R2, -R0;\n" - "MUL R2.xyz, R2, R4;\n" - "MAD R2.xyz, R1.w, R0, R2;\n" - "ADD R6.xyz, R2, -R5;\n" - "MUL R4.xyz, R1, c[9].x;\n" - "MUL R2.xyz, R0, c[10].y;\n" - "SGE R2.xyz, R2, R0.w;\n" - "MAD R2.xyz, R2, R6, R5;\n" + "MAD R2.xyz, R1.w, R2, -R1;\n" + "MUL R2.xyz, R3, R2;\n" + "MAD R4.xyz, R0.w, R1, R2;\n" + "MAD R2.xyz, -R1, R2.w, c[9].z;\n" + "MUL R5.xyz, R2, R3;\n" + "MAD R6.xyz, -R5, R6, R0.w;\n" + "MAD R5.xyz, -R1, R6, R4;\n" + "MAD R2.xyz, -R2, R3, R0.w;\n" + "MUL R3.xyz, R0, c[9].x;\n" + "MUL R4.xyz, R1, c[10].x;\n" + "SGE R3.xyz, R3, R0.w;\n" + "ADD R2.w, -R1, c[9].z;\n" + "MUL R6.xyz, R1, R6;\n" "SGE R4.xyz, R4, R1.w;\n" - "ADD R2.xyz, R2, -R3;\n" - "MAD R2.xyz, R4, R2, R3;\n" - "MAD R1.xyz, R1, R2.w, R2;\n" - "ADD R2.x, -R1.w, c[9].z;\n" - "MAD R2.xyz, R0, R2.x, R1;\n" - "ADD R1.z, R1.w, R0.w;\n" - "MAD R2.w, -R1, R0, R1.z;\n" - "ADD R1.xy, fragment.position, c[7];\n" - "MUL R1.xy, R1, c[5];\n" - "TEX R1, R1, texture[1], 2D;\n" - "ADD R2, R2, -R0;\n" - "DP4 R1.x, R1, c[8];\n" - "MAD result.color, R1.x, R2, R0;\n" + "MAD R4.xyz, R4, R5, R6;\n" + "MAD R4.xyz, -R1, R2, R4;\n" + "MUL R2.xyz, R1, R2;\n" + "MAD R2.xyz, R3, R4, R2;\n" + "MAD R2.xyz, R0, R2.w, R2;\n" + "ADD R0.x, -R0.w, c[9].z;\n" + "MAD R2.xyz, R1, R0.x, R2;\n" + "ADD R0.z, R0.w, R1.w;\n" + "MAD R2.w, -R0, R1, R0.z;\n" + "ADD R0.xy, fragment.position, c[7];\n" + "MUL R0.xy, R0, c[5];\n" + "TEX R0, R0, texture[1], 2D;\n" + "ADD R2, R2, -R1;\n" + "DP4 R0.x, R0, c[8];\n" + "MAD result.color, R0.x, R2, R1;\n" "END\n" ; @@ -1643,23 +1642,23 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[8];\n" - "MUL R0.x, R0, c[8];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "RSQ R0.y, R0.y;\n" - "RCP R0.z, R0.y;\n" - "ADD R0.x, -R0, R0.z;\n" + "MUL R0.y, R0.x, c[8].x;\n" + "MUL R0.z, R0, c[8].y;\n" + "MAD R0.x, R0.y, R0.y, -R0.z;\n" + "RSQ R0.x, R0.x;\n" + "RCP R0.z, R0.x;\n" + "ADD R0.y, -R0, R0.z;\n" "MUL R0.zw, fragment.position.xyxy, c[7].xyxy;\n" "TEX R1, R0.zwzw, texture[0], 2D;\n" "MUL R2.xyz, R1, c[5].y;\n" - "MOV R0.y, c[8].x;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.y, R0.y;\n" - "MUL R0.x, R0, R0.y;\n" + "MOV R0.x, c[8];\n" + "MUL R0.x, R0, c[1];\n" + "RCP R0.x, R0.x;\n" + "MUL R0.x, R0.y, R0;\n" "TEX R0, R0, texture[1], 1D;\n" "MUL R3.xyz, R0.w, R2;\n" "MUL R2.xyz, R0, c[5].x;\n" @@ -1690,22 +1689,22 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "RSQ R0.y, R0.y;\n" - "RCP R0.z, R0.y;\n" - "ADD R0.x, -R0, R0.z;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.x, R0.y, R0.y, -R0.z;\n" + "RSQ R0.x, R0.x;\n" + "RCP R0.z, R0.x;\n" + "ADD R0.y, -R0, R0.z;\n" "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" "TEX R1, R0.zwzw, texture[0], 2D;\n" - "MOV R0.y, c[6].x;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.y, R0.y;\n" - "MUL R0.x, R0, R0.y;\n" + "MOV R0.x, c[6];\n" + "MUL R0.x, R0, c[1];\n" + "RCP R0.x, R0.x;\n" + "MUL R0.x, R0.y, R0;\n" "TEX R0, R0, texture[1], 1D;\n" "ADD R2.x, -R1.w, c[6].z;\n" "MUL R2.xyz, R0, R2.x;\n" @@ -1734,16 +1733,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "RSQ R0.z, R0.y;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.x, R0.y, R0.y, -R0.z;\n" + "RSQ R0.z, R0.x;\n" + "MOV R0.x, c[6];\n" + "MUL R0.w, R0.x, c[1].x;\n" "RCP R0.z, R0.z;\n" - "ADD R0.x, -R0, R0.z;\n" + "ADD R0.x, -R0.y, R0.z;\n" + "RCP R0.y, R0.w;\n" "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" - "MOV R0.y, c[6].x;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.y, R0.y;\n" "TEX R1, R0.zwzw, texture[0], 2D;\n" "MUL R0.x, R0, R0.y;\n" "TEX R0, R0, texture[1], 1D;\n" @@ -1766,27 +1765,27 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MOV R0.x, c[6];\n" "MUL R0.z, -R0, c[1].x;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.z, R0.y, R0.y, -R0;\n" "MUL R1.xy, fragment.position, c[5];\n" "TEX R1, R1, texture[0], 2D;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.z, R0.x, R0.x, -R0.y;\n" - "MOV R0.y, c[6].x;\n" + "MUL R0.w, R0.x, c[1].x;\n" "RSQ R0.z, R0.z;\n" - "RCP R0.z, R0.z;\n" - "MUL R0.y, R0, c[1].x;\n" - "ADD R0.x, -R0, R0.z;\n" - "RCP R0.y, R0.y;\n" - "MUL R0.x, R0, R0.y;\n" + "RCP R0.x, R0.z;\n" + "ADD R2.w, -R1, c[6].z;\n" + "RCP R0.z, R0.w;\n" + "ADD R0.x, -R0.y, R0;\n" + "MUL R0.x, R0, R0.z;\n" "TEX R0, R0, texture[1], 1D;\n" "ADD R3.xyz, R0.w, -R0;\n" "ADD R2.xyz, R1.w, -R1;\n" "MUL R2.xyz, R2, R3;\n" - "ADD R2.w, -R1, c[6].z;\n" "MUL R2.xyz, R2, c[6].x;\n" "MAD R2.xyz, R0.w, R1.w, -R2;\n" "MAD R2.xyz, R0, R2.w, R2;\n" @@ -1823,17 +1822,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "RSQ R0.z, R0.y;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.x, R0.y, R0.y, -R0.z;\n" + "RSQ R0.z, R0.x;\n" + "MOV R0.x, c[6];\n" + "MUL R0.w, R0.x, c[1].x;\n" "RCP R0.z, R0.z;\n" - "ADD R0.x, -R0, R0.z;\n" + "ADD R0.x, -R0.y, R0.z;\n" + "RCP R0.y, R0.w;\n" "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" "TEX R1, R0.zwzw, texture[0], 2D;\n" - "MOV R0.y, c[6].x;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.y, R0.y;\n" "MUL R0.x, R0, R0.y;\n" "TEX R0, R0, texture[1], 1D;\n" "MUL R2.xyz, R0, R1.w;\n" @@ -1866,17 +1865,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "RSQ R0.z, R0.y;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.x, R0.y, R0.y, -R0.z;\n" + "RSQ R0.z, R0.x;\n" + "MOV R0.x, c[6];\n" + "MUL R0.w, R0.x, c[1].x;\n" "RCP R0.z, R0.z;\n" - "ADD R0.x, -R0, R0.z;\n" + "ADD R0.x, -R0.y, R0.z;\n" + "RCP R0.y, R0.w;\n" "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" "TEX R1, R0.zwzw, texture[0], 2D;\n" - "MOV R0.y, c[6].x;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.y, R0.y;\n" "MUL R0.x, R0, R0.y;\n" "TEX R0, R0, texture[1], 1D;\n" "MUL R2.xyz, R0, R1.w;\n" @@ -1905,20 +1904,20 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MOV R0.x, c[6];\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.z, R0.x, R0.x, -R0.y;\n" - "MOV R0.y, c[6].x;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.z, R0.y, R0.y, -R0;\n" + "MUL R0.w, R0.x, c[1].x;\n" "RSQ R0.z, R0.z;\n" - "RCP R0.z, R0.z;\n" - "MUL R0.y, R0, c[1].x;\n" - "ADD R0.x, -R0, R0.z;\n" - "RCP R0.y, R0.y;\n" - "MUL R0.x, R0, R0.y;\n" + "RCP R0.x, R0.z;\n" + "RCP R0.z, R0.w;\n" + "ADD R0.x, -R0.y, R0;\n" + "MUL R0.x, R0, R0.z;\n" "TEX R0, R0, texture[1], 1D;\n" "MAX R1.x, R0.w, c[6].w;\n" "RCP R1.x, R1.x;\n" @@ -1966,17 +1965,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "RSQ R0.z, R0.y;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.x, R0.y, R0.y, -R0.z;\n" + "RSQ R0.z, R0.x;\n" + "MOV R0.x, c[6];\n" + "MUL R0.w, R0.x, c[1].x;\n" "RCP R0.z, R0.z;\n" - "ADD R0.x, -R0, R0.z;\n" + "ADD R0.x, -R0.y, R0.z;\n" + "RCP R0.y, R0.w;\n" "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" "TEX R1, R0.zwzw, texture[0], 2D;\n" - "MOV R0.y, c[6].x;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.y, R0.y;\n" "MUL R0.x, R0, R0.y;\n" "TEX R0, R0, texture[1], 1D;\n" "MUL R2.xyz, R0.w, R1;\n" @@ -2018,24 +2017,24 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MOV R0.x, c[6];\n" "MUL R0.z, -R0, c[1].x;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.z, R0.y, R0.y, -R0;\n" "MUL R1.xy, fragment.position, c[5];\n" "TEX R1, R1, texture[0], 2D;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.z, R0.x, R0.x, -R0.y;\n" - "MOV R0.y, c[6].x;\n" + "MUL R0.w, R0.x, c[1].x;\n" "RSQ R0.z, R0.z;\n" - "RCP R0.z, R0.z;\n" - "MUL R0.y, R0, c[1].x;\n" - "ADD R0.x, -R0, R0.z;\n" - "RCP R0.y, R0.y;\n" - "MUL R0.x, R0, R0.y;\n" - "TEX R0, R0, texture[1], 1D;\n" + "RCP R0.x, R0.z;\n" "ADD R2.w, -R1, c[6].z;\n" + "RCP R0.z, R0.w;\n" + "ADD R0.x, -R0.y, R0;\n" + "MUL R0.x, R0, R0.z;\n" + "TEX R0, R0, texture[1], 1D;\n" "ADD R3.xyz, R0.w, -R0;\n" "ADD R2.xyz, R1.w, -R1;\n" "MUL R2.xyz, R2, R3;\n" @@ -2061,7 +2060,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..5],\n" " { 2, 4, 1, 9.9999997e-006 },\n" - " { 3, 8 } };\n" + " { 8, 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2073,59 +2072,59 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "MAD R0.xyz, fragment.position.x, c[2], R0;\n" "ADD R0.xyz, R0, c[4];\n" "RCP R0.z, R0.z;\n" + "MUL R1.xy, fragment.position, c[5];\n" + "TEX R1, R1, texture[0], 2D;\n" + "MAX R0.w, R1, c[6];\n" + "RCP R2.w, R0.w;\n" + "MUL R5.xyz, R1, R2.w;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MOV R0.x, c[6];\n" + "RSQ R2.x, R5.x;\n" + "RSQ R2.z, R5.z;\n" + "RSQ R2.y, R5.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" - "TEX R1, R0.zwzw, texture[0], 2D;\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "MAX R0.z, R1.w, c[6].w;\n" - "RCP R2.w, R0.z;\n" - "MUL R2.xyz, R1, R2.w;\n" - "MAD R6.xyz, -R2, c[7].y, c[7].x;\n" - "MAD R3.xyz, -R1, R2.w, c[6].z;\n" - "RSQ R2.w, R2.x;\n" - "RCP R2.x, R2.w;\n" - "RSQ R0.y, R0.y;\n" - "RCP R0.y, R0.y;\n" - "ADD R0.x, -R0, R0.y;\n" - "MOV R0.y, c[6].x;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.y, R0.y;\n" - "MUL R0.x, R0, R0.y;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.z, R0.y, R0.y, -R0;\n" + "MUL R0.w, R0.x, c[1].x;\n" + "RSQ R0.z, R0.z;\n" + "RCP R0.x, R0.z;\n" + "RCP R0.z, R0.w;\n" + "ADD R0.x, -R0.y, R0;\n" + "MUL R0.x, R0, R0.z;\n" "TEX R0, R0, texture[1], 1D;\n" - "MAD R4.xyz, R0, c[6].x, -R0.w;\n" - "MUL R5.xyz, R3, R4;\n" - "MAD R5.xyz, -R5, R6, R0.w;\n" - "MAD R3.xyz, -R3, R4, R0.w;\n" - "RSQ R2.z, R2.z;\n" - "RSQ R2.y, R2.y;\n" - "MUL R5.xyz, R1, R5;\n" - "MUL R3.xyz, R1, R3;\n" + "MAD R3.xyz, R0, c[6].x, -R0.w;\n" + "MAD R6.xyz, -R5, c[7].x, c[7].y;\n" + "RCP R2.x, R2.x;\n" "RCP R2.z, R2.z;\n" "RCP R2.y, R2.y;\n" "MAD R2.xyz, R1.w, R2, -R1;\n" - "MUL R2.xyz, R2, R4;\n" - "MAD R2.xyz, R0.w, R1, R2;\n" - "ADD R6.xyz, R2, -R5;\n" - "MUL R4.xyz, R0, c[6].x;\n" - "MUL R2.xyz, R1, c[7].y;\n" - "SGE R2.xyz, R2, R1.w;\n" - "MAD R2.xyz, R2, R6, R5;\n" - "ADD R2.xyz, R2, -R3;\n" - "SGE R4.xyz, R4, R0.w;\n" - "MAD R2.xyz, R4, R2, R3;\n" + "MUL R2.xyz, R3, R2;\n" + "MAD R4.xyz, R0.w, R1, R2;\n" + "MAD R2.xyz, -R1, R2.w, c[6].z;\n" + "MUL R5.xyz, R2, R3;\n" + "MAD R2.xyz, -R2, R3, R0.w;\n" + "MAD R6.xyz, -R5, R6, R0.w;\n" + "MAD R5.xyz, -R1, R6, R4;\n" + "MUL R3.xyz, R0, c[6].x;\n" + "MUL R4.xyz, R1, c[7].x;\n" + "MUL R6.xyz, R1, R6;\n" + "SGE R4.xyz, R4, R1.w;\n" + "MAD R4.xyz, R4, R5, R6;\n" + "MAD R4.xyz, -R1, R2, R4;\n" + "MUL R2.xyz, R1, R2;\n" + "SGE R3.xyz, R3, R0.w;\n" + "MAD R2.xyz, R3, R4, R2;\n" "ADD R2.w, -R1, c[6].z;\n" - "MAD R0.xyz, R0, R2.w, R2;\n" - "ADD R2.x, R0.w, R1.w;\n" - "ADD R2.y, -R0.w, c[6].z;\n" - "MAD result.color.xyz, R1, R2.y, R0;\n" - "MAD result.color.w, -R0, R1, R2.x;\n" + "MAD R2.xyz, R0, R2.w, R2;\n" + "ADD R0.x, R0.w, R1.w;\n" + "ADD R0.y, -R0.w, c[6].z;\n" + "MAD result.color.xyz, R1, R0.y, R2;\n" + "MAD result.color.w, -R0, R1, R0.x;\n" "END\n" ; @@ -2147,16 +2146,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "RSQ R0.z, R0.y;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.x, R0.y, R0.y, -R0.z;\n" + "RSQ R0.z, R0.x;\n" + "MOV R0.x, c[6];\n" + "MUL R0.w, R0.x, c[1].x;\n" "RCP R0.z, R0.z;\n" - "ADD R0.x, -R0, R0.z;\n" + "ADD R0.x, -R0.y, R0.z;\n" + "RCP R0.y, R0.w;\n" "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" - "MOV R0.y, c[6].x;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.y, R0.y;\n" "TEX R1, R0.zwzw, texture[0], 2D;\n" "MUL R0.x, R0, R0.y;\n" "TEX R0, R0, texture[1], 1D;\n" @@ -2188,17 +2187,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" - "MUL R0.y, R0.z, c[6];\n" - "MUL R0.x, R0, c[6];\n" - "MAD R0.y, R0.x, R0.x, -R0;\n" - "RSQ R0.z, R0.y;\n" + "MUL R0.y, R0.x, c[6].x;\n" + "MUL R0.z, R0, c[6].y;\n" + "MAD R0.x, R0.y, R0.y, -R0.z;\n" + "RSQ R0.z, R0.x;\n" + "MOV R0.x, c[6];\n" + "MUL R0.w, R0.x, c[1].x;\n" "RCP R0.z, R0.z;\n" - "ADD R0.x, -R0, R0.z;\n" + "ADD R0.x, -R0.y, R0.z;\n" + "RCP R0.y, R0.w;\n" "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" "TEX R1, R0.zwzw, texture[0], 2D;\n" - "MOV R0.y, c[6].x;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.y, R0.y;\n" "MUL R0.x, R0, R0.y;\n" "TEX R0, R0, texture[1], 1D;\n" "MUL R2.xyz, R0.w, R1;\n" @@ -2226,8 +2225,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" - "MUL R0.xy, R0, c[0];\n" "ADD R0.z, R0, R0.w;\n" + "MUL R0.xy, R0, c[0];\n" "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" "MUL R0.y, R0.z, c[8];\n" @@ -2236,12 +2235,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "RSQ R0.y, R0.y;\n" "RCP R0.y, R0.y;\n" "ADD R1.x, -R0, R0.y;\n" - "MOV R0.z, c[8].x;\n" - "MUL R0.z, R0, c[1].x;\n" - "RCP R1.y, R0.z;\n" - "ADD R0.xy, fragment.position, c[6];\n" - "MUL R0.xy, R0, c[5];\n" - "TEX R0, R0, texture[0], 2D;\n" + "MOV R0.x, c[8];\n" + "MUL R0.x, R0, c[1];\n" + "RCP R1.y, R0.x;\n" + "ADD R0.zw, fragment.position.xyxy, c[6].xyxy;\n" + "MUL R0.zw, R0, c[5].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1.x, R1, R1.y;\n" "DP4 R1.y, R0, c[7];\n" "TEX R0, R1, texture[1], 1D;\n" @@ -2261,19 +2260,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD "MUL R0.xy, R0, R0.z;\n" "MUL R0.zw, R0.xyxy, R0.xyxy;\n" "MUL R0.xy, R0, c[0];\n" - "ADD R0.x, R0, R0.y;\n" "ADD R0.z, R0, R0.w;\n" + "ADD R0.x, R0, R0.y;\n" "MUL R0.z, -R0, c[1].x;\n" "MUL R0.y, R0.z, c[5];\n" "MUL R0.x, R0, c[5];\n" "MAD R0.z, R0.x, R0.x, -R0.y;\n" "MOV R0.y, c[5].x;\n" "RSQ R0.z, R0.z;\n" - "MUL R0.y, R0, c[1].x;\n" - "RCP R0.z, R0.z;\n" - "RCP R0.y, R0.y;\n" - "ADD R0.x, -R0, R0.z;\n" - "MUL R0.x, R0, R0.y;\n" + "MUL R0.w, R0.y, c[1].x;\n" + "RCP R0.y, R0.z;\n" + "RCP R0.z, R0.w;\n" + "ADD R0.x, -R0, R0.y;\n" + "MUL R0.x, R0, R0.z;\n" "TEX result.color, R0, texture[0], 1D;\n" "END\n" ; @@ -2281,9 +2280,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF = "!!ARBfp1.0\n" "PARAM c[13] = { program.local[0..9],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 1 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2350,9 +2349,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_MULTIPLY = "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..7],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 1 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2411,9 +2410,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SCREEN = "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..7],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2468,9 +2467,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_OVERLAY = "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..7],\n" - " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n" - " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n" - " { 3.1415927, 0.15915494, 2, 1 } };\n" + " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n" + " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n" + " { 3.141593, 0.15915494, 2, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2543,9 +2542,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DARKEN = "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..7],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 1 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2607,9 +2606,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_LIGHTEN = "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..7],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 1 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2671,9 +2670,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORDODGE = "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..7],\n" - " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n" - " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n" - " { 3.1415927, 0.15915494, 1, 1e-006 } };\n" + " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n" + " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n" + " { 3.141593, 0.15915494, 1, 1e-006 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2748,9 +2747,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORBURN = "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..7],\n" - " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n" - " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n" - " { 3.1415927, 0.15915494, 1, 9.9999997e-006 } };\n" + " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n" + " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n" + " { 3.141593, 0.15915494, 1, 9.9999997e-006 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2762,16 +2761,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "ABS R0.z, R0.x;\n" - "ABS R0.w, R0.y;\n" - "ADD R0.w, R0, -R0.z;\n" + "ABS R0.w, R0.x;\n" + "ABS R0.z, R0.y;\n" + "ADD R0.z, R0, -R0.w;\n" "ADD R1.x, R0.y, c[8];\n" - "ABS R0.w, R0;\n" - "CMP R0.y, -R0.w, R0, R1.x;\n" - "ABS R0.w, -R0.y;\n" - "MAX R1.x, R0.z, R0.w;\n" + "ABS R0.z, R0;\n" + "CMP R0.y, -R0.z, R0, R1.x;\n" + "ABS R0.z, -R0.y;\n" + "MAX R1.x, R0.w, R0.z;\n" "RCP R1.y, R1.x;\n" - "MIN R1.x, R0.z, R0.w;\n" + "MIN R1.x, R0.w, R0.z;\n" "MUL R1.x, R1, R1.y;\n" "MUL R1.y, R1.x, R1.x;\n" "MAD R1.z, R1.y, c[8].y, c[8];\n" @@ -2780,8 +2779,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO "MAD R1.z, R1, R1.y, -c[9].y;\n" "MAD R1.y, R1.z, R1, c[9].z;\n" "MUL R1.x, R1.y, R1;\n" - "ADD R0.z, -R0, R0.w;\n" "ADD R1.y, -R1.x, c[9].w;\n" + "ADD R0.z, -R0.w, R0;\n" "CMP R0.z, -R0, R1.y, R1.x;\n" "ADD R0.w, -R0.z, c[10].x;\n" "CMP R0.x, R0, R0.w, R0.z;\n" @@ -2826,9 +2825,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_HARDLIGHT = "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..7],\n" - " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n" - " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n" - " { 3.1415927, 0.15915494, 2, 1 } };\n" + " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n" + " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n" + " { 3.141593, 0.15915494, 2, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2901,10 +2900,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT = "!!ARBfp1.0\n" "PARAM c[12] = { program.local[0..7],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 1, 9.9999997e-006 },\n" - " { 2, 3, 8 } };\n" + " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n" + " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n" + " { 3.141593, 0.15915494, 1, 2 },\n" + " { 9.9999997e-006, 8, 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -2917,86 +2916,86 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "ABS R0.z, R0.x;\n" - "ABS R0.w, R0.y;\n" - "ADD R0.w, R0, -R0.z;\n" - "ADD R1.x, R0.y, c[8].y;\n" - "ABS R0.w, R0;\n" - "CMP R0.y, -R0.w, R0, R1.x;\n" - "ABS R0.w, -R0.y;\n" - "MAX R1.x, R0.z, R0.w;\n" + "ABS R0.w, R0.x;\n" + "ABS R0.z, R0.y;\n" + "ADD R0.z, R0, -R0.w;\n" + "ADD R1.x, R0.y, c[8];\n" + "ABS R0.z, R0;\n" + "CMP R0.y, -R0.z, R0, R1.x;\n" + "ABS R0.z, -R0.y;\n" + "MAX R1.x, R0.w, R0.z;\n" "RCP R1.y, R1.x;\n" - "MIN R1.x, R0.z, R0.w;\n" + "MIN R1.x, R0.w, R0.z;\n" "MUL R1.x, R1, R1.y;\n" "MUL R1.y, R1.x, R1.x;\n" - "MAD R1.z, R1.y, c[9].x, c[9].y;\n" - "MAD R1.z, R1, R1.y, -c[9];\n" - "MAD R1.z, R1, R1.y, c[9].w;\n" - "MAD R1.z, R1, R1.y, -c[10].x;\n" - "MAD R1.y, R1.z, R1, c[10];\n" + "MAD R1.z, R1.y, c[8].y, c[8];\n" + "MAD R1.z, R1, R1.y, -c[8].w;\n" + "MAD R1.z, R1, R1.y, c[9].x;\n" + "MAD R1.z, R1, R1.y, -c[9].y;\n" + "MAD R1.y, R1.z, R1, c[9].z;\n" "MUL R1.x, R1.y, R1;\n" - "ADD R1.y, -R1.x, c[8].w;\n" - "ADD R0.z, -R0, R0.w;\n" + "ADD R1.y, -R1.x, c[9].w;\n" + "ADD R0.z, -R0.w, R0;\n" "CMP R0.z, -R0, R1.y, R1.x;\n" - "ADD R0.w, -R0.z, c[8].z;\n" + "ADD R0.w, -R0.z, c[10].x;\n" "CMP R0.x, R0, R0.w, R0.z;\n" + "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" "CMP R0.x, -R0.y, -R0, R0;\n" + "TEX R1, R0.zwzw, texture[0], 2D;\n" + "MAX R0.y, R1.w, c[11].x;\n" + "RCP R2.w, R0.y;\n" + "MUL R5.xyz, R1, R2.w;\n" + "RSQ R2.x, R5.x;\n" + "RSQ R2.z, R5.z;\n" + "RSQ R2.y, R5.y;\n" "ADD R0.x, R0, c[0];\n" - "MUL R1.x, R0, c[8];\n" - "FLR R1.y, R1.x;\n" - "MUL R0.xy, fragment.position, c[5];\n" - "TEX R0, R0, texture[0], 2D;\n" - "MAX R2.x, R0.w, c[10].w;\n" - "RCP R2.w, R2.x;\n" - "MUL R2.xyz, R0, R2.w;\n" - "MAD R6.xyz, -R2, c[11].z, c[11].y;\n" - "MAD R3.xyz, -R0, R2.w, c[10].z;\n" - "RSQ R2.w, R2.x;\n" - "RCP R2.x, R2.w;\n" - "ADD R1.x, R1, -R1.y;\n" - "TEX R1, R1, texture[2], 1D;\n" - "MAD R4.xyz, R1, c[11].x, -R1.w;\n" - "MUL R5.xyz, R3, R4;\n" - "MAD R5.xyz, -R5, R6, R1.w;\n" - "MAD R3.xyz, -R3, R4, R1.w;\n" - "RSQ R2.z, R2.z;\n" - "RSQ R2.y, R2.y;\n" - "MUL R5.xyz, R0, R5;\n" - "MUL R3.xyz, R0, R3;\n" - "ADD R2.w, -R0, c[10].z;\n" + "MUL R0.x, R0, c[10].y;\n" + "FLR R0.y, R0.x;\n" + "ADD R0.x, R0, -R0.y;\n" + "TEX R0, R0, texture[2], 1D;\n" + "MAD R3.xyz, R0, c[10].w, -R0.w;\n" + "MAD R6.xyz, -R5, c[11].y, c[11].z;\n" + "RCP R2.x, R2.x;\n" "RCP R2.z, R2.z;\n" "RCP R2.y, R2.y;\n" - "MAD R2.xyz, R0.w, R2, -R0;\n" - "MUL R2.xyz, R2, R4;\n" - "MAD R2.xyz, R1.w, R0, R2;\n" - "ADD R6.xyz, R2, -R5;\n" - "MUL R4.xyz, R1, c[11].x;\n" - "MUL R2.xyz, R0, c[11].z;\n" - "SGE R2.xyz, R2, R0.w;\n" - "MAD R2.xyz, R2, R6, R5;\n" + "MAD R2.xyz, R1.w, R2, -R1;\n" + "MUL R2.xyz, R3, R2;\n" + "MAD R4.xyz, R0.w, R1, R2;\n" + "MAD R2.xyz, -R1, R2.w, c[10].z;\n" + "MUL R5.xyz, R2, R3;\n" + "MAD R6.xyz, -R5, R6, R0.w;\n" + "MAD R5.xyz, -R1, R6, R4;\n" + "MAD R2.xyz, -R2, R3, R0.w;\n" + "MUL R3.xyz, R0, c[10].w;\n" + "MUL R4.xyz, R1, c[11].y;\n" + "SGE R3.xyz, R3, R0.w;\n" + "ADD R2.w, -R1, c[10].z;\n" + "MUL R6.xyz, R1, R6;\n" "SGE R4.xyz, R4, R1.w;\n" - "ADD R2.xyz, R2, -R3;\n" - "MAD R2.xyz, R4, R2, R3;\n" - "MAD R1.xyz, R1, R2.w, R2;\n" - "ADD R2.x, -R1.w, c[10].z;\n" - "MAD R2.xyz, R0, R2.x, R1;\n" - "ADD R1.z, R1.w, R0.w;\n" - "MAD R2.w, -R1, R0, R1.z;\n" - "ADD R1.xy, fragment.position, c[6];\n" - "MUL R1.xy, R1, c[4];\n" - "TEX R1, R1, texture[1], 2D;\n" - "ADD R2, R2, -R0;\n" - "DP4 R1.x, R1, c[7];\n" - "MAD result.color, R1.x, R2, R0;\n" + "MAD R4.xyz, R4, R5, R6;\n" + "MAD R4.xyz, -R1, R2, R4;\n" + "MUL R2.xyz, R1, R2;\n" + "MAD R2.xyz, R3, R4, R2;\n" + "MAD R2.xyz, R0, R2.w, R2;\n" + "ADD R0.x, -R0.w, c[10].z;\n" + "MAD R2.xyz, R1, R0.x, R2;\n" + "ADD R0.z, R0.w, R1.w;\n" + "MAD R2.w, -R0, R1, R0.z;\n" + "ADD R0.xy, fragment.position, c[6];\n" + "MUL R0.xy, R0, c[4];\n" + "TEX R0, R0, texture[1], 2D;\n" + "ADD R2, R2, -R1;\n" + "DP4 R0.x, R0, c[7];\n" + "MAD result.color, R0.x, R2, R1;\n" "END\n" ; static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DIFFERENCE = "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..7],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 2 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 2 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3056,9 +3055,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_EXCLUSION = "!!ARBfp1.0\n" "PARAM c[11] = { program.local[0..7],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 2, 1 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 2, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3121,9 +3120,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SIMPLE_PORTER_DUFF_NOMASK = "!!ARBfp1.0\n" "PARAM c[10] = { program.local[0..6],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 1 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3184,9 +3183,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_MULTIPLY_NOMASK = "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..4],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 1 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3239,9 +3238,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SCREEN_NOMASK = "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..4],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3289,9 +3288,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_OVERLAY_NOMASK = "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..4],\n" - " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n" - " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n" - " { 3.1415927, 0.15915494, 2, 1 } };\n" + " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n" + " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n" + " { 3.141593, 0.15915494, 2, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3357,9 +3356,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DARKEN_NOMASK = "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..4],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 1 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3415,9 +3414,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_LIGHTEN_NOMASK = "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..4],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 1 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3473,9 +3472,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORDODGE_NOMASK = "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..4],\n" - " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n" - " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n" - " { 3.1415927, 0.15915494, 1, 1e-006 } };\n" + " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n" + " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n" + " { 3.141593, 0.15915494, 1, 1e-006 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3543,9 +3542,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_COLORBURN_NOMASK = "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..4],\n" - " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n" - " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n" - " { 3.1415927, 0.15915494, 1, 9.9999997e-006 } };\n" + " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n" + " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n" + " { 3.141593, 0.15915494, 1, 9.9999997e-006 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3557,16 +3556,16 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "ABS R0.z, R0.x;\n" - "ABS R0.w, R0.y;\n" - "ADD R0.w, R0, -R0.z;\n" + "ABS R0.w, R0.x;\n" + "ABS R0.z, R0.y;\n" + "ADD R0.z, R0, -R0.w;\n" "ADD R1.x, R0.y, c[5];\n" - "ABS R0.w, R0;\n" - "CMP R0.y, -R0.w, R0, R1.x;\n" - "ABS R0.w, -R0.y;\n" - "MAX R1.x, R0.z, R0.w;\n" + "ABS R0.z, R0;\n" + "CMP R0.y, -R0.z, R0, R1.x;\n" + "ABS R0.z, -R0.y;\n" + "MAX R1.x, R0.w, R0.z;\n" "RCP R1.y, R1.x;\n" - "MIN R1.x, R0.z, R0.w;\n" + "MIN R1.x, R0.w, R0.z;\n" "MUL R1.x, R1, R1.y;\n" "MUL R1.y, R1.x, R1.x;\n" "MAD R1.z, R1.y, c[5].y, c[5];\n" @@ -3575,8 +3574,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO "MAD R1.z, R1, R1.y, -c[6].y;\n" "MAD R1.y, R1.z, R1, c[6].z;\n" "MUL R1.x, R1.y, R1;\n" - "ADD R0.z, -R0, R0.w;\n" "ADD R1.y, -R1.x, c[6].w;\n" + "ADD R0.z, -R0.w, R0;\n" "CMP R0.z, -R0, R1.y, R1.x;\n" "ADD R0.w, -R0.z, c[7].x;\n" "CMP R0.x, R0, R0.w, R0.z;\n" @@ -3615,9 +3614,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_HARDLIGHT_NOMASK = "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..4],\n" - " { 0.0020000001, -0.01348047, 0.057477314, 0.12123907 },\n" - " { 0.19563593, 0.33299461, 0.99999565, 1.5707964 },\n" - " { 3.1415927, 0.15915494, 2, 1 } };\n" + " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n" + " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n" + " { 3.141593, 0.15915494, 2, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3684,10 +3683,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT_NOMASK = "!!ARBfp1.0\n" "PARAM c[9] = { program.local[0..4],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 1, 9.9999997e-006 },\n" - " { 2, 3, 8 } };\n" + " { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n" + " { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n" + " { 3.141593, 0.15915494, 1, 2 },\n" + " { 9.9999997e-006, 8, 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3700,80 +3699,80 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "ABS R0.z, R0.x;\n" - "ABS R0.w, R0.y;\n" - "ADD R0.w, R0, -R0.z;\n" - "ADD R1.x, R0.y, c[5].y;\n" - "ABS R0.w, R0;\n" - "CMP R0.y, -R0.w, R0, R1.x;\n" - "ABS R0.w, -R0.y;\n" - "MAX R1.x, R0.z, R0.w;\n" + "ABS R0.w, R0.x;\n" + "ABS R0.z, R0.y;\n" + "ADD R0.z, R0, -R0.w;\n" + "ADD R1.x, R0.y, c[5];\n" + "ABS R0.z, R0;\n" + "CMP R0.y, -R0.z, R0, R1.x;\n" + "ABS R0.z, -R0.y;\n" + "MAX R1.x, R0.w, R0.z;\n" "RCP R1.y, R1.x;\n" - "MIN R1.x, R0.z, R0.w;\n" + "MIN R1.x, R0.w, R0.z;\n" "MUL R1.x, R1, R1.y;\n" "MUL R1.y, R1.x, R1.x;\n" - "MAD R1.z, R1.y, c[6].x, c[6].y;\n" - "MAD R1.z, R1, R1.y, -c[6];\n" - "MAD R1.z, R1, R1.y, c[6].w;\n" - "MAD R1.z, R1, R1.y, -c[7].x;\n" - "MAD R1.y, R1.z, R1, c[7];\n" + "MAD R1.z, R1.y, c[5].y, c[5];\n" + "MAD R1.z, R1, R1.y, -c[5].w;\n" + "MAD R1.z, R1, R1.y, c[6].x;\n" + "MAD R1.z, R1, R1.y, -c[6].y;\n" + "MAD R1.y, R1.z, R1, c[6].z;\n" "MUL R1.x, R1.y, R1;\n" - "ADD R0.z, -R0, R0.w;\n" - "ADD R1.y, -R1.x, c[5].w;\n" + "ADD R1.y, -R1.x, c[6].w;\n" + "ADD R0.z, -R0.w, R0;\n" "CMP R0.z, -R0, R1.y, R1.x;\n" - "ADD R0.w, -R0.z, c[5].z;\n" + "ADD R0.w, -R0.z, c[7].x;\n" "CMP R0.x, R0, R0.w, R0.z;\n" - "CMP R0.x, -R0.y, -R0, R0;\n" "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" + "CMP R0.x, -R0.y, -R0, R0;\n" "TEX R1, R0.zwzw, texture[0], 2D;\n" - "MAX R2.x, R1.w, c[7].w;\n" - "RCP R2.w, R2.x;\n" - "MUL R2.xyz, R1, R2.w;\n" - "MAD R6.xyz, -R2, c[8].z, c[8].y;\n" - "MAD R3.xyz, -R1, R2.w, c[7].z;\n" - "RSQ R2.w, R2.x;\n" - "RCP R2.x, R2.w;\n" + "MAX R0.y, R1.w, c[8].x;\n" + "RCP R2.w, R0.y;\n" + "MUL R5.xyz, R1, R2.w;\n" + "RSQ R2.x, R5.x;\n" + "RSQ R2.z, R5.z;\n" + "RSQ R2.y, R5.y;\n" "ADD R0.x, R0, c[0];\n" - "MUL R0.x, R0, c[5];\n" + "MUL R0.x, R0, c[7].y;\n" "FLR R0.y, R0.x;\n" "ADD R0.x, R0, -R0.y;\n" "TEX R0, R0, texture[1], 1D;\n" - "MAD R4.xyz, R0, c[8].x, -R0.w;\n" - "MUL R5.xyz, R3, R4;\n" - "MAD R5.xyz, -R5, R6, R0.w;\n" - "MAD R3.xyz, -R3, R4, R0.w;\n" - "RSQ R2.z, R2.z;\n" - "RSQ R2.y, R2.y;\n" - "MUL R5.xyz, R1, R5;\n" - "MUL R3.xyz, R1, R3;\n" + "MAD R3.xyz, R0, c[7].w, -R0.w;\n" + "MAD R6.xyz, -R5, c[8].y, c[8].z;\n" + "RCP R2.x, R2.x;\n" "RCP R2.z, R2.z;\n" "RCP R2.y, R2.y;\n" "MAD R2.xyz, R1.w, R2, -R1;\n" - "MUL R2.xyz, R2, R4;\n" - "MAD R2.xyz, R0.w, R1, R2;\n" - "ADD R6.xyz, R2, -R5;\n" - "MUL R4.xyz, R0, c[8].x;\n" - "MUL R2.xyz, R1, c[8].z;\n" - "SGE R2.xyz, R2, R1.w;\n" - "MAD R2.xyz, R2, R6, R5;\n" - "ADD R2.xyz, R2, -R3;\n" - "SGE R4.xyz, R4, R0.w;\n" - "MAD R2.xyz, R4, R2, R3;\n" + "MUL R2.xyz, R3, R2;\n" + "MAD R4.xyz, R0.w, R1, R2;\n" + "MAD R2.xyz, -R1, R2.w, c[7].z;\n" + "MUL R5.xyz, R2, R3;\n" + "MAD R2.xyz, -R2, R3, R0.w;\n" + "MAD R6.xyz, -R5, R6, R0.w;\n" + "MAD R5.xyz, -R1, R6, R4;\n" + "MUL R3.xyz, R0, c[7].w;\n" + "MUL R4.xyz, R1, c[8].y;\n" + "MUL R6.xyz, R1, R6;\n" + "SGE R4.xyz, R4, R1.w;\n" + "MAD R4.xyz, R4, R5, R6;\n" + "MAD R4.xyz, -R1, R2, R4;\n" + "MUL R2.xyz, R1, R2;\n" + "SGE R3.xyz, R3, R0.w;\n" + "MAD R2.xyz, R3, R4, R2;\n" "ADD R2.w, -R1, c[7].z;\n" - "MAD R0.xyz, R0, R2.w, R2;\n" - "ADD R2.x, R0.w, R1.w;\n" - "ADD R2.y, -R0.w, c[7].z;\n" - "MAD result.color.xyz, R1, R2.y, R0;\n" - "MAD result.color.w, -R0, R1, R2.x;\n" + "MAD R2.xyz, R0, R2.w, R2;\n" + "ADD R0.x, R0.w, R1.w;\n" + "ADD R0.y, -R0.w, c[7].z;\n" + "MAD result.color.xyz, R1, R0.y, R2;\n" + "MAD result.color.w, -R0, R1, R0.x;\n" "END\n" ; static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_DIFFERENCE_NOMASK = "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..4],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 2 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 2 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3827,9 +3826,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_EXCLUSION_NOMASK = "!!ARBfp1.0\n" "PARAM c[8] = { program.local[0..4],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565, 2, 1 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559, 2, 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -3886,9 +3885,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODE_BLEND_MODE_MASK = "!!ARBfp1.0\n" "PARAM c[10] = { program.local[0..6],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559 } };\n" "TEMP R0;\n" "TEMP R1;\n" "MUL R0.xyz, fragment.position.y, c[2];\n" @@ -3920,11 +3919,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO "ADD R0.w, -R0.z, c[7].z;\n" "CMP R0.x, R0, R0.w, R0.z;\n" "CMP R0.x, -R0.y, -R0, R0;\n" - "ADD R0.z, R0.x, c[0].x;\n" - "MUL R1.x, R0.z, c[7];\n" + "ADD R0.x, R0, c[0];\n" + "MUL R1.x, R0, c[7];\n" "FLR R1.y, R1.x;\n" - "ADD R0.xy, fragment.position, c[5];\n" - "MUL R0.xy, R0, c[4];\n" + "ADD R0.zw, fragment.position.xyxy, c[5].xyxy;\n" + "MUL R0.xy, R0.zwzw, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" "ADD R1.x, R1, -R1.y;\n" "DP4 R1.y, R0, c[6];\n" @@ -3936,9 +3935,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODE_BLEND_MODE_NOMASK = "!!ARBfp1.0\n" "PARAM c[7] = { program.local[0..3],\n" - " { 0.15915494, 0.0020000001, 3.1415927, 1.5707964 },\n" - " { -0.01348047, 0.057477314, 0.12123907, 0.19563593 },\n" - " { 0.33299461, 0.99999565 } };\n" + " { 0.15915494, 0.0020000001, 3.141593, 1.570796 },\n" + " { -0.01348047, 0.05747731, 0.1212391, 0.1956359 },\n" + " { 0.33299461, 0.99999559 } };\n" "TEMP R0;\n" "TEMP R1;\n" "MUL R0.xyz, fragment.position.y, c[2];\n" @@ -4357,8 +4356,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT = "!!ARBfp1.0\n" "PARAM c[10] = { program.local[0..7],\n" - " { 1, 9.9999997e-006, 2, 3 },\n" - " { 8 } };\n" + " { 1, 2, 9.9999997e-006, 8 },\n" + " { 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -4366,58 +4365,58 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD "TEMP R4;\n" "TEMP R5;\n" "TEMP R6;\n" - "MUL R2.xyz, fragment.position.y, c[2];\n" - "MAD R3.xyz, fragment.position.x, c[1], R2;\n" "MUL R0.xy, fragment.position, c[5];\n" - "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.x, R0.w, c[8].y;\n" - "RCP R2.w, R1.x;\n" - "MUL R1.xyz, R0, R2.w;\n" - "RSQ R1.w, R1.x;\n" - "RSQ R2.y, R1.y;\n" - "ADD R3.xyz, R3, c[3];\n" - "RCP R2.x, R1.w;\n" - "RCP R1.w, R3.z;\n" - "MUL R3.xy, R3, R1.w;\n" - "RSQ R1.w, R1.z;\n" - "RCP R2.z, R1.w;\n" - "RCP R2.y, R2.y;\n" - "MAD R6.xyz, R0.w, R2, -R0;\n" - "MUL R2.xyz, -R1, c[9].x;\n" - "ADD R5.xyz, R2, c[8].w;\n" - "MAD R2.xyz, -R0, R2.w, c[8].x;\n" - "MUL R3.xy, R3, c[0];\n" - "ADD R1.w, R3.x, R3.y;\n" - "MUL R1.w, R1, c[0].z;\n" - "TEX R1, R1.w, texture[2], 1D;\n" - "MAD R3.xyz, R1, c[8].z, -R1.w;\n" - "MUL R4.xyz, R2, R3;\n" - "MAD R4.xyz, -R4, R5, R1.w;\n" - "MAD R2.xyz, -R2, R3, R1.w;\n" - "MUL R5.xyz, R6, R3;\n" - "MUL R4.xyz, R0, R4;\n" - "MAD R5.xyz, R1.w, R0, R5;\n" - "ADD R6.xyz, R5, -R4;\n" - "MUL R5.xyz, R0, c[9].x;\n" - "SGE R3.xyz, R5, R0.w;\n" - "MAD R3.xyz, R3, R6, R4;\n" - "MUL R2.xyz, R0, R2;\n" - "MUL R4.xyz, R1, c[8].z;\n" + "TEX R1, R0, texture[0], 2D;\n" + "MAX R0.w, R1, c[8].z;\n" + "RCP R2.w, R0.w;\n" + "MUL R2.xyz, R1, R2.w;\n" + "RSQ R0.w, R2.x;\n" + "MUL R5.xyz, -R2, c[8].w;\n" + "MUL R0.xyz, fragment.position.y, c[2];\n" + "MAD R0.xyz, fragment.position.x, c[1], R0;\n" + "ADD R0.xyz, R0, c[3];\n" + "RCP R0.z, R0.z;\n" + "MUL R0.xy, R0, R0.z;\n" + "MUL R0.xy, R0, c[0];\n" + "ADD R0.x, R0, R0.y;\n" + "RSQ R0.z, R2.y;\n" + "RSQ R0.y, R2.z;\n" + "MAD R2.xyz, -R1, R2.w, c[8].x;\n" + "RCP R3.x, R0.w;\n" + "RCP R3.y, R0.z;\n" + "RCP R3.z, R0.y;\n" + "MUL R0.x, R0, c[0].z;\n" + "TEX R0, R0, texture[2], 1D;\n" + "MAD R4.xyz, R1.w, R3, -R1;\n" + "MAD R3.xyz, R0, c[8].y, -R0.w;\n" + "MUL R4.xyz, R3, R4;\n" + "ADD R6.xyz, R5, c[9].x;\n" + "MUL R5.xyz, R2, R3;\n" + "MAD R2.xyz, -R2, R3, R0.w;\n" + "MUL R3.xyz, R0, c[8].y;\n" + "MAD R6.xyz, -R5, R6, R0.w;\n" + "MAD R4.xyz, R0.w, R1, R4;\n" + "MAD R5.xyz, -R1, R6, R4;\n" + "MUL R4.xyz, R1, c[8].w;\n" + "SGE R3.xyz, R3, R0.w;\n" + "ADD R2.w, -R1, c[8].x;\n" + "MUL R6.xyz, R1, R6;\n" "SGE R4.xyz, R4, R1.w;\n" - "ADD R3.xyz, R3, -R2;\n" - "MAD R2.xyz, R4, R3, R2;\n" - "ADD R2.w, -R0, c[8].x;\n" - "MAD R1.xyz, R1, R2.w, R2;\n" - "ADD R2.x, -R1.w, c[8];\n" - "MAD R2.xyz, R0, R2.x, R1;\n" - "ADD R1.z, R1.w, R0.w;\n" - "MAD R2.w, -R1, R0, R1.z;\n" - "ADD R1.xy, fragment.position, c[6];\n" - "MUL R1.xy, R1, c[4];\n" - "TEX R1, R1, texture[1], 2D;\n" - "ADD R2, R2, -R0;\n" - "DP4 R1.x, R1, c[7];\n" - "MAD result.color, R1.x, R2, R0;\n" + "MAD R4.xyz, R4, R5, R6;\n" + "MAD R4.xyz, -R1, R2, R4;\n" + "MUL R2.xyz, R1, R2;\n" + "MAD R2.xyz, R3, R4, R2;\n" + "MAD R2.xyz, R0, R2.w, R2;\n" + "ADD R0.x, -R0.w, c[8];\n" + "MAD R2.xyz, R1, R0.x, R2;\n" + "ADD R0.z, R0.w, R1.w;\n" + "MAD R2.w, -R0, R1, R0.z;\n" + "ADD R0.xy, fragment.position, c[6];\n" + "MUL R0.xy, R0, c[4];\n" + "TEX R0, R0, texture[1], 2D;\n" + "ADD R2, R2, -R1;\n" + "DP4 R0.x, R0, c[7];\n" + "MAD result.color, R0.x, R2, R1;\n" "END\n" ; @@ -4816,8 +4815,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT_NOMASK = "!!ARBfp1.0\n" "PARAM c[7] = { program.local[0..4],\n" - " { 1, 9.9999997e-006, 2, 3 },\n" - " { 8 } };\n" + " { 1, 2, 9.9999997e-006, 8 },\n" + " { 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -4825,52 +4824,52 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD "TEMP R4;\n" "TEMP R5;\n" "TEMP R6;\n" - "MUL R2.xyz, fragment.position.y, c[2];\n" - "MAD R3.xyz, fragment.position.x, c[1], R2;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R1, R0, texture[0], 2D;\n" - "MAX R0.x, R1.w, c[5].y;\n" - "RCP R2.w, R0.x;\n" - "MUL R0.xyz, R1, R2.w;\n" - "RSQ R0.w, R0.x;\n" - "RSQ R2.y, R0.y;\n" - "ADD R3.xyz, R3, c[3];\n" - "RCP R2.x, R0.w;\n" - "RCP R0.w, R3.z;\n" - "MUL R3.xy, R3, R0.w;\n" - "RSQ R0.w, R0.z;\n" - "RCP R2.z, R0.w;\n" - "RCP R2.y, R2.y;\n" - "MAD R6.xyz, R1.w, R2, -R1;\n" - "MUL R2.xyz, -R0, c[6].x;\n" - "ADD R5.xyz, R2, c[5].w;\n" + "MAX R0.w, R1, c[5].z;\n" + "RCP R2.w, R0.w;\n" + "MUL R2.xyz, R1, R2.w;\n" + "RSQ R0.w, R2.x;\n" + "MUL R5.xyz, -R2, c[5].w;\n" + "MUL R0.xyz, fragment.position.y, c[2];\n" + "MAD R0.xyz, fragment.position.x, c[1], R0;\n" + "ADD R0.xyz, R0, c[3];\n" + "RCP R0.z, R0.z;\n" + "MUL R0.xy, R0, R0.z;\n" + "MUL R0.xy, R0, c[0];\n" + "ADD R0.x, R0, R0.y;\n" + "RSQ R0.z, R2.y;\n" + "RSQ R0.y, R2.z;\n" "MAD R2.xyz, -R1, R2.w, c[5].x;\n" - "MUL R3.xy, R3, c[0];\n" - "ADD R0.w, R3.x, R3.y;\n" - "MUL R0.w, R0, c[0].z;\n" - "TEX R0, R0.w, texture[1], 1D;\n" - "MAD R3.xyz, R0, c[5].z, -R0.w;\n" - "MUL R4.xyz, R2, R3;\n" - "MAD R4.xyz, -R4, R5, R0.w;\n" - "MUL R5.xyz, R6, R3;\n" + "RCP R3.x, R0.w;\n" + "RCP R3.y, R0.z;\n" + "RCP R3.z, R0.y;\n" + "MUL R0.x, R0, c[0].z;\n" + "TEX R0, R0, texture[1], 1D;\n" + "MAD R4.xyz, R1.w, R3, -R1;\n" + "MAD R3.xyz, R0, c[5].y, -R0.w;\n" + "MUL R4.xyz, R3, R4;\n" + "ADD R6.xyz, R5, c[6].x;\n" + "MUL R5.xyz, R2, R3;\n" "MAD R2.xyz, -R2, R3, R0.w;\n" - "MUL R4.xyz, R1, R4;\n" - "MAD R5.xyz, R0.w, R1, R5;\n" - "ADD R6.xyz, R5, -R4;\n" - "MUL R5.xyz, R1, c[6].x;\n" - "SGE R3.xyz, R5, R1.w;\n" - "MAD R3.xyz, R3, R6, R4;\n" + "MUL R3.xyz, R0, c[5].y;\n" + "MAD R6.xyz, -R5, R6, R0.w;\n" + "MAD R4.xyz, R0.w, R1, R4;\n" + "MAD R5.xyz, -R1, R6, R4;\n" + "MUL R4.xyz, R1, c[5].w;\n" + "MUL R6.xyz, R1, R6;\n" + "SGE R4.xyz, R4, R1.w;\n" + "MAD R4.xyz, R4, R5, R6;\n" + "MAD R4.xyz, -R1, R2, R4;\n" "MUL R2.xyz, R1, R2;\n" - "MUL R4.xyz, R0, c[5].z;\n" - "ADD R3.xyz, R3, -R2;\n" - "SGE R4.xyz, R4, R0.w;\n" - "MAD R2.xyz, R4, R3, R2;\n" + "SGE R3.xyz, R3, R0.w;\n" + "MAD R2.xyz, R3, R4, R2;\n" "ADD R2.w, -R1, c[5].x;\n" - "MAD R0.xyz, R0, R2.w, R2;\n" - "ADD R2.x, R0.w, R1.w;\n" - "ADD R2.y, -R0.w, c[5].x;\n" - "MAD result.color.xyz, R1, R2.y, R0;\n" - "MAD result.color.w, -R0, R1, R2.x;\n" + "MAD R2.xyz, R0, R2.w, R2;\n" + "ADD R0.x, R0.w, R1.w;\n" + "ADD R0.y, -R0.w, c[5].x;\n" + "MAD result.color.xyz, R1, R0.y, R2;\n" + "MAD result.color.w, -R0, R1, R0.x;\n" "END\n" ; @@ -5334,8 +5333,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT = "!!ARBfp1.0\n" "PARAM c[10] = { program.local[0..7],\n" - " { 1, 9.9999997e-006, 2, 3 },\n" - " { 8 } };\n" + " { 1, 2, 9.9999997e-006, 8 },\n" + " { 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -5344,55 +5343,55 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO "TEMP R5;\n" "TEMP R6;\n" "MUL R0.xy, fragment.position, c[5];\n" - "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.x, R0.w, c[8].y;\n" - "RCP R2.w, R1.x;\n" - "MUL R1.xyz, R0, R2.w;\n" - "RSQ R1.w, R1.x;\n" - "RCP R2.x, R1.w;\n" - "RSQ R1.w, R1.y;\n" - "RSQ R2.z, R1.z;\n" - "MUL R3.xyz, fragment.position.y, c[2];\n" - "MAD R3.xyz, fragment.position.x, c[1], R3;\n" - "ADD R3.xyz, R3, c[3];\n" - "RCP R2.y, R1.w;\n" - "RCP R1.w, R3.z;\n" - "MUL R3.xy, R3, R1.w;\n" - "RCP R2.z, R2.z;\n" - "MAD R6.xyz, R0.w, R2, -R0;\n" - "MUL R2.xyz, -R1, c[9].x;\n" - "ADD R5.xyz, R2, c[8].w;\n" - "MAD R2.xyz, -R0, R2.w, c[8].x;\n" - "MUL R3.xy, R3, c[0];\n" - "TEX R1, R3, texture[2], 2D;\n" - "MAD R3.xyz, R1, c[8].z, -R1.w;\n" - "MUL R4.xyz, R2, R3;\n" - "MAD R4.xyz, -R4, R5, R1.w;\n" - "MAD R2.xyz, -R2, R3, R1.w;\n" - "MUL R5.xyz, R6, R3;\n" - "MUL R4.xyz, R0, R4;\n" - "MAD R5.xyz, R1.w, R0, R5;\n" - "ADD R6.xyz, R5, -R4;\n" - "MUL R5.xyz, R0, c[9].x;\n" - "SGE R3.xyz, R5, R0.w;\n" - "MAD R3.xyz, R3, R6, R4;\n" - "MUL R2.xyz, R0, R2;\n" - "MUL R4.xyz, R1, c[8].z;\n" + "TEX R1, R0, texture[0], 2D;\n" + "MAX R0.x, R1.w, c[8].z;\n" + "RCP R2.w, R0.x;\n" + "MUL R2.xyz, R1, R2.w;\n" + "RSQ R0.w, R2.x;\n" + "RCP R3.x, R0.w;\n" + "RSQ R0.w, R2.y;\n" + "MUL R5.xyz, -R2, c[8].w;\n" + "MUL R0.xyz, fragment.position.y, c[2];\n" + "MAD R0.xyz, fragment.position.x, c[1], R0;\n" + "ADD R0.xyz, R0, c[3];\n" + "RCP R0.z, R0.z;\n" + "MUL R0.xy, R0, R0.z;\n" + "RSQ R0.z, R2.z;\n" + "MAD R2.xyz, -R1, R2.w, c[8].x;\n" + "RCP R3.y, R0.w;\n" + "RCP R3.z, R0.z;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R0, R0, texture[2], 2D;\n" + "MAD R4.xyz, R1.w, R3, -R1;\n" + "MAD R3.xyz, R0, c[8].y, -R0.w;\n" + "MUL R4.xyz, R3, R4;\n" + "ADD R6.xyz, R5, c[9].x;\n" + "MUL R5.xyz, R2, R3;\n" + "MAD R2.xyz, -R2, R3, R0.w;\n" + "MUL R3.xyz, R0, c[8].y;\n" + "MAD R6.xyz, -R5, R6, R0.w;\n" + "MAD R4.xyz, R0.w, R1, R4;\n" + "MAD R5.xyz, -R1, R6, R4;\n" + "MUL R4.xyz, R1, c[8].w;\n" + "SGE R3.xyz, R3, R0.w;\n" + "ADD R2.w, -R1, c[8].x;\n" + "MUL R6.xyz, R1, R6;\n" "SGE R4.xyz, R4, R1.w;\n" - "ADD R3.xyz, R3, -R2;\n" - "MAD R2.xyz, R4, R3, R2;\n" - "ADD R2.w, -R0, c[8].x;\n" - "MAD R1.xyz, R1, R2.w, R2;\n" - "ADD R2.x, -R1.w, c[8];\n" - "MAD R2.xyz, R0, R2.x, R1;\n" - "ADD R1.z, R1.w, R0.w;\n" - "MAD R2.w, -R1, R0, R1.z;\n" - "ADD R1.xy, fragment.position, c[6];\n" - "MUL R1.xy, R1, c[4];\n" - "TEX R1, R1, texture[1], 2D;\n" - "ADD R2, R2, -R0;\n" - "DP4 R1.x, R1, c[7];\n" - "MAD result.color, R1.x, R2, R0;\n" + "MAD R4.xyz, R4, R5, R6;\n" + "MAD R4.xyz, -R1, R2, R4;\n" + "MUL R2.xyz, R1, R2;\n" + "MAD R2.xyz, R3, R4, R2;\n" + "MAD R2.xyz, R0, R2.w, R2;\n" + "ADD R0.x, -R0.w, c[8];\n" + "MAD R2.xyz, R1, R0.x, R2;\n" + "ADD R0.z, R0.w, R1.w;\n" + "MAD R2.w, -R0, R1, R0.z;\n" + "ADD R0.xy, fragment.position, c[6];\n" + "MUL R0.xy, R0, c[4];\n" + "TEX R0, R0, texture[1], 2D;\n" + "ADD R2, R2, -R1;\n" + "DP4 R0.x, R0, c[7];\n" + "MAD result.color, R0.x, R2, R1;\n" "END\n" ; @@ -5476,10 +5475,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO "MUL R0.xyz, fragment.position.y, c[2];\n" "MAD R0.xyz, fragment.position.x, c[1], R0;\n" "ADD R0.xyz, R0, c[3];\n" - "RCP R1.x, R0.z;\n" - "MUL R0.xy, R0, R1.x;\n" - "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n" - "TEX R1, R0.zwzw, texture[0], 2D;\n" + "RCP R0.z, R0.z;\n" + "MUL R0.xy, R0, R0.z;\n" + "MUL R1.xy, fragment.position, c[6];\n" + "TEX R1, R1, texture[0], 2D;\n" "MUL R2.xyz, R1, c[4].y;\n" "MUL R0.xy, R0, c[0];\n" "TEX R0, R0, texture[1], 2D;\n" @@ -5509,10 +5508,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO "MUL R0.xyz, fragment.position.y, c[2];\n" "MAD R0.xyz, fragment.position.x, c[1], R0;\n" "ADD R0.xyz, R0, c[3];\n" - "RCP R1.x, R0.z;\n" - "MUL R0.xy, R0, R1.x;\n" - "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" - "TEX R1, R0.zwzw, texture[0], 2D;\n" + "RCP R0.z, R0.z;\n" + "MUL R0.xy, R0, R0.z;\n" + "MUL R1.xy, fragment.position, c[4];\n" + "TEX R1, R1, texture[0], 2D;\n" "MUL R0.xy, R0, c[0];\n" "TEX R0, R0, texture[1], 2D;\n" "ADD R2.x, -R1.w, c[5];\n" @@ -5769,8 +5768,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT_NOMASK = "!!ARBfp1.0\n" "PARAM c[7] = { program.local[0..4],\n" - " { 1, 9.9999997e-006, 2, 3 },\n" - " { 8 } };\n" + " { 1, 2, 9.9999997e-006, 8 },\n" + " { 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -5780,48 +5779,48 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO "TEMP R6;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R1, R0, texture[0], 2D;\n" - "MAX R0.x, R1.w, c[5].y;\n" + "MAX R0.x, R1.w, c[5].z;\n" "RCP R2.w, R0.x;\n" - "MUL R0.xyz, R1, R2.w;\n" - "RSQ R0.w, R0.x;\n" - "RCP R2.x, R0.w;\n" - "RSQ R0.w, R0.y;\n" - "RSQ R2.z, R0.z;\n" - "MUL R3.xyz, fragment.position.y, c[2];\n" - "MAD R3.xyz, fragment.position.x, c[1], R3;\n" - "ADD R3.xyz, R3, c[3];\n" - "RCP R2.y, R0.w;\n" - "RCP R0.w, R3.z;\n" - "MUL R3.xy, R3, R0.w;\n" - "RCP R2.z, R2.z;\n" - "MAD R6.xyz, R1.w, R2, -R1;\n" - "MUL R2.xyz, -R0, c[6].x;\n" - "ADD R5.xyz, R2, c[5].w;\n" + "MUL R2.xyz, R1, R2.w;\n" + "RSQ R0.w, R2.x;\n" + "RCP R3.x, R0.w;\n" + "RSQ R0.w, R2.y;\n" + "MUL R5.xyz, -R2, c[5].w;\n" + "MUL R0.xyz, fragment.position.y, c[2];\n" + "MAD R0.xyz, fragment.position.x, c[1], R0;\n" + "ADD R0.xyz, R0, c[3];\n" + "RCP R0.z, R0.z;\n" + "MUL R0.xy, R0, R0.z;\n" + "RSQ R0.z, R2.z;\n" "MAD R2.xyz, -R1, R2.w, c[5].x;\n" - "MUL R3.xy, R3, c[0];\n" - "TEX R0, R3, texture[1], 2D;\n" - "MAD R3.xyz, R0, c[5].z, -R0.w;\n" - "MUL R4.xyz, R2, R3;\n" - "MAD R4.xyz, -R4, R5, R0.w;\n" - "MUL R5.xyz, R6, R3;\n" + "RCP R3.y, R0.w;\n" + "RCP R3.z, R0.z;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R0, R0, texture[1], 2D;\n" + "MAD R4.xyz, R1.w, R3, -R1;\n" + "MAD R3.xyz, R0, c[5].y, -R0.w;\n" + "MUL R4.xyz, R3, R4;\n" + "ADD R6.xyz, R5, c[6].x;\n" + "MUL R5.xyz, R2, R3;\n" "MAD R2.xyz, -R2, R3, R0.w;\n" - "MUL R4.xyz, R1, R4;\n" - "MAD R5.xyz, R0.w, R1, R5;\n" - "ADD R6.xyz, R5, -R4;\n" - "MUL R5.xyz, R1, c[6].x;\n" - "SGE R3.xyz, R5, R1.w;\n" - "MAD R3.xyz, R3, R6, R4;\n" + "MUL R3.xyz, R0, c[5].y;\n" + "MAD R6.xyz, -R5, R6, R0.w;\n" + "MAD R4.xyz, R0.w, R1, R4;\n" + "MAD R5.xyz, -R1, R6, R4;\n" + "MUL R4.xyz, R1, c[5].w;\n" + "MUL R6.xyz, R1, R6;\n" + "SGE R4.xyz, R4, R1.w;\n" + "MAD R4.xyz, R4, R5, R6;\n" + "MAD R4.xyz, -R1, R2, R4;\n" "MUL R2.xyz, R1, R2;\n" - "MUL R4.xyz, R0, c[5].z;\n" - "ADD R3.xyz, R3, -R2;\n" - "SGE R4.xyz, R4, R0.w;\n" - "MAD R2.xyz, R4, R3, R2;\n" + "SGE R3.xyz, R3, R0.w;\n" + "MAD R2.xyz, R3, R4, R2;\n" "ADD R2.w, -R1, c[5].x;\n" - "MAD R0.xyz, R0, R2.w, R2;\n" - "ADD R2.x, R0.w, R1.w;\n" - "ADD R2.y, -R0.w, c[5].x;\n" - "MAD result.color.xyz, R1, R2.y, R0;\n" - "MAD result.color.w, -R0, R1, R2.x;\n" + "MAD R2.xyz, R0, R2.w, R2;\n" + "ADD R0.x, R0.w, R1.w;\n" + "ADD R0.y, -R0.w, c[5].x;\n" + "MAD result.color.xyz, R1, R0.y, R2;\n" + "MAD result.color.w, -R0, R1, R0.x;\n" "END\n" ; @@ -6033,10 +6032,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[2], 2D;\n" - "MUL R1, fragment.color.primary, R1.x;\n" - "MUL R0.xy, fragment.position, c[5];\n" - "TEX R0, R0, texture[0], 2D;\n" + "TEX R0.x, R0, texture[2], 2D;\n" + "MUL R1, fragment.color.primary, R0.x;\n" + "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "ADD R2.w, -R0, c[8].y;\n" "ADD R3.xyz, R1.w, -R1;\n" "ADD R2.xyz, R0.w, -R0;\n" @@ -6201,11 +6200,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[2], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[2], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" - "MUL R0.xy, fragment.position, c[5];\n" - "TEX R0, R0, texture[0], 2D;\n" + "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R2.xyz, R1.w, R0;\n" "MAD R3.xyz, R1, R0.w, R2;\n" "MAD R2.xyz, -R1.w, R0.w, R3;\n" @@ -6251,10 +6250,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[2], 2D;\n" - "MUL R1, fragment.color.primary, R1.x;\n" - "MUL R0.xy, fragment.position, c[5];\n" - "TEX R0, R0, texture[0], 2D;\n" + "TEX R0.x, R0, texture[2], 2D;\n" + "MUL R1, fragment.color.primary, R0.x;\n" + "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "ADD R2.w, -R0, c[8].y;\n" "ADD R3.xyz, R1.w, -R1;\n" "ADD R2.xyz, R0.w, -R0;\n" @@ -6286,8 +6285,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT = "!!ARBfp1.0\n" "PARAM c[10] = { program.local[0..7],\n" - " { 1, 9.9999997e-006, 2, 3 },\n" - " { 8 } };\n" + " { 1, 2, 9.9999997e-006, 8 },\n" + " { 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6297,47 +6296,47 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "TEMP R6;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.x, R0.w, c[8].y;\n" + "MAX R1.x, R0.w, c[8].z;\n" "RCP R2.w, R1.x;\n" - "MUL R1.xyz, R0, R2.w;\n" - "RSQ R1.w, R1.x;\n" - "RCP R2.x, R1.w;\n" - "RSQ R1.w, R1.y;\n" - "RCP R2.y, R1.w;\n" - "MUL R3.xyz, fragment.position.y, c[2];\n" - "MAD R3.xyz, fragment.position.x, c[1], R3;\n" - "ADD R3.xyz, R3, c[3];\n" - "RCP R2.z, R3.z;\n" - "MUL R3.xy, R3, R2.z;\n" - "MUL R3.xy, R3, c[0];\n" - "RSQ R1.w, R1.z;\n" - "RCP R2.z, R1.w;\n" - "MAD R6.xyz, R0.w, R2, -R0;\n" - "MUL R2.xyz, -R1, c[9].x;\n" - "ADD R5.xyz, R2, c[8].w;\n" + "MUL R2.xyz, R0, R2.w;\n" + "RSQ R1.w, R2.x;\n" + "RCP R3.x, R1.w;\n" + "RSQ R1.w, R2.y;\n" + "MUL R5.xyz, -R2, c[8].w;\n" + "MUL R1.xyz, fragment.position.y, c[2];\n" + "MAD R1.xyz, fragment.position.x, c[1], R1;\n" + "ADD R1.xyz, R1, c[3];\n" + "RCP R1.z, R1.z;\n" + "MUL R1.xy, R1, R1.z;\n" + "RSQ R1.z, R2.z;\n" + "MUL R1.xy, R1, c[0];\n" "MAD R2.xyz, -R0, R2.w, c[8].x;\n" - "TEX R3.x, R3, texture[2], 2D;\n" - "MUL R1, fragment.color.primary, R3.x;\n" - "MAD R3.xyz, R1, c[8].z, -R1.w;\n" - "MUL R4.xyz, R2, R3;\n" - "MAD R4.xyz, -R4, R5, R1.w;\n" + "RCP R3.y, R1.w;\n" + "RCP R3.z, R1.z;\n" + "TEX R1.x, R1, texture[2], 2D;\n" + "MUL R1, fragment.color.primary, R1.x;\n" + "MAD R4.xyz, R0.w, R3, -R0;\n" + "MAD R3.xyz, R1, c[8].y, -R1.w;\n" + "MUL R4.xyz, R3, R4;\n" + "ADD R6.xyz, R5, c[9].x;\n" + "MUL R5.xyz, R2, R3;\n" "MAD R2.xyz, -R2, R3, R1.w;\n" - "MUL R5.xyz, R6, R3;\n" - "MUL R4.xyz, R0, R4;\n" - "MAD R5.xyz, R1.w, R0, R5;\n" - "ADD R6.xyz, R5, -R4;\n" - "MUL R5.xyz, R0, c[9].x;\n" - "SGE R3.xyz, R5, R0.w;\n" - "MAD R3.xyz, R3, R6, R4;\n" - "MUL R2.xyz, R0, R2;\n" - "MUL R4.xyz, R1, c[8].z;\n" - "SGE R4.xyz, R4, R1.w;\n" - "ADD R3.xyz, R3, -R2;\n" - "MAD R2.xyz, R4, R3, R2;\n" + "MUL R3.xyz, R1, c[8].y;\n" + "MAD R6.xyz, -R5, R6, R1.w;\n" + "MAD R4.xyz, R1.w, R0, R4;\n" + "MAD R5.xyz, -R0, R6, R4;\n" + "MUL R4.xyz, R0, c[8].w;\n" + "SGE R3.xyz, R3, R1.w;\n" "ADD R2.w, -R0, c[8].x;\n" - "MAD R1.xyz, R1, R2.w, R2;\n" - "ADD R2.x, -R1.w, c[8];\n" - "MAD R2.xyz, R0, R2.x, R1;\n" + "MUL R6.xyz, R0, R6;\n" + "SGE R4.xyz, R4, R0.w;\n" + "MAD R4.xyz, R4, R5, R6;\n" + "MAD R4.xyz, -R0, R2, R4;\n" + "MUL R2.xyz, R0, R2;\n" + "MAD R2.xyz, R3, R4, R2;\n" + "MAD R2.xyz, R1, R2.w, R2;\n" + "ADD R1.x, -R1.w, c[8];\n" + "MAD R2.xyz, R0, R1.x, R2;\n" "ADD R1.z, R1.w, R0.w;\n" "MAD R2.w, -R1, R0, R1.z;\n" "ADD R1.xy, fragment.position, c[6];\n" @@ -6432,10 +6431,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MAD R0.xyz, fragment.position.x, c[1], R0;\n" "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" - "MUL R0.zw, R0.xyxy, R0.z;\n" - "MUL R1.xy, R0.zwzw, c[0];\n" - "MUL R0.xy, fragment.position, c[6];\n" - "TEX R0, R0, texture[0], 2D;\n" + "MUL R0.xy, R0, R0.z;\n" + "MUL R1.xy, R0, c[0];\n" + "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R2.xyz, R0, c[4].y;\n" "TEX R1.x, R1, texture[1], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" @@ -6466,10 +6465,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MAD R0.xyz, fragment.position.x, c[1], R0;\n" "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" - "MUL R0.zw, R0.xyxy, R0.z;\n" - "MUL R1.xy, R0.zwzw, c[0];\n" - "MUL R0.xy, fragment.position, c[4];\n" - "TEX R0, R0, texture[0], 2D;\n" + "MUL R0.xy, R0, R0.z;\n" + "MUL R1.xy, R0, c[0];\n" + "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "TEX R1.x, R1, texture[1], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "ADD R2.x, -R0.w, c[5];\n" @@ -6493,10 +6492,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[1], 2D;\n" - "MUL R0.xy, fragment.position, c[4];\n" - "TEX R0, R0, texture[0], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[1], 2D;\n" + "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "ADD R2, R1, R0;\n" "MAD result.color, -R1, R0, R2;\n" @@ -6517,10 +6516,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[1], 2D;\n" - "MUL R1, fragment.color.primary, R1.x;\n" - "MUL R0.xy, fragment.position, c[4];\n" - "TEX R0, R0, texture[0], 2D;\n" + "TEX R0.x, R0, texture[1], 2D;\n" + "MUL R1, fragment.color.primary, R0.x;\n" + "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "ADD R3.xyz, R1.w, -R1;\n" "ADD R2.xyz, R0.w, -R0;\n" "MUL R2.xyz, R2, R3;\n" @@ -6556,10 +6555,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[1], 2D;\n" - "MUL R0.xy, fragment.position, c[4];\n" - "TEX R0, R0, texture[0], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[1], 2D;\n" + "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R2.xyz, R1, R0.w;\n" "MUL R3.xyz, R1.w, R0;\n" @@ -6586,10 +6585,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[1], 2D;\n" - "MUL R0.xy, fragment.position, c[4];\n" - "TEX R0, R0, texture[0], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[1], 2D;\n" + "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R2.xyz, R1, R0.w;\n" "MUL R3.xyz, R1.w, R0;\n" @@ -6660,11 +6659,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[1], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[1], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" - "MUL R0.xy, fragment.position, c[4];\n" - "TEX R0, R0, texture[0], 2D;\n" + "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R2.xyz, R1.w, R0;\n" "MAD R3.xyz, R1, R0.w, R2;\n" "ADD R2.w, -R0, c[5].x;\n" @@ -6704,10 +6703,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[1], 2D;\n" - "MUL R1, fragment.color.primary, R1.x;\n" - "MUL R0.xy, fragment.position, c[4];\n" - "TEX R0, R0, texture[0], 2D;\n" + "TEX R0.x, R0, texture[1], 2D;\n" + "MUL R1, fragment.color.primary, R0.x;\n" + "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "ADD R2.w, -R0, c[5].y;\n" "ADD R3.xyz, R1.w, -R1;\n" "ADD R2.xyz, R0.w, -R0;\n" @@ -6733,8 +6732,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT_NOMASK = "!!ARBfp1.0\n" "PARAM c[7] = { program.local[0..4],\n" - " { 1, 9.9999997e-006, 2, 3 },\n" - " { 8 } };\n" + " { 1, 2, 9.9999997e-006, 8 },\n" + " { 3 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6744,49 +6743,49 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "TEMP R6;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.x, R0.w, c[5].y;\n" + "MAX R1.x, R0.w, c[5].z;\n" "RCP R2.w, R1.x;\n" - "MUL R1.xyz, R0, R2.w;\n" - "RSQ R1.w, R1.x;\n" - "RCP R2.x, R1.w;\n" - "RSQ R1.w, R1.y;\n" - "RCP R2.y, R1.w;\n" - "MUL R3.xyz, fragment.position.y, c[2];\n" - "MAD R3.xyz, fragment.position.x, c[1], R3;\n" - "ADD R3.xyz, R3, c[3];\n" - "RCP R2.z, R3.z;\n" - "MUL R3.xy, R3, R2.z;\n" - "MUL R3.xy, R3, c[0];\n" - "RSQ R1.w, R1.z;\n" - "RCP R2.z, R1.w;\n" - "MAD R6.xyz, R0.w, R2, -R0;\n" - "MUL R2.xyz, -R1, c[6].x;\n" - "ADD R5.xyz, R2, c[5].w;\n" + "MUL R2.xyz, R0, R2.w;\n" + "RSQ R1.w, R2.x;\n" + "RCP R3.x, R1.w;\n" + "RSQ R1.w, R2.y;\n" + "MUL R5.xyz, -R2, c[5].w;\n" + "MUL R1.xyz, fragment.position.y, c[2];\n" + "MAD R1.xyz, fragment.position.x, c[1], R1;\n" + "ADD R1.xyz, R1, c[3];\n" + "RCP R1.z, R1.z;\n" + "MUL R1.xy, R1, R1.z;\n" + "RSQ R1.z, R2.z;\n" + "MUL R1.xy, R1, c[0];\n" "MAD R2.xyz, -R0, R2.w, c[5].x;\n" - "TEX R3.x, R3, texture[1], 2D;\n" - "MUL R1, fragment.color.primary, R3.x;\n" - "MAD R3.xyz, R1, c[5].z, -R1.w;\n" - "MUL R4.xyz, R2, R3;\n" - "MAD R4.xyz, -R4, R5, R1.w;\n" - "MUL R5.xyz, R6, R3;\n" + "RCP R3.y, R1.w;\n" + "RCP R3.z, R1.z;\n" + "TEX R1.x, R1, texture[1], 2D;\n" + "MUL R1, fragment.color.primary, R1.x;\n" + "MAD R4.xyz, R0.w, R3, -R0;\n" + "MAD R3.xyz, R1, c[5].y, -R1.w;\n" + "MUL R4.xyz, R3, R4;\n" + "ADD R6.xyz, R5, c[6].x;\n" + "MUL R5.xyz, R2, R3;\n" "MAD R2.xyz, -R2, R3, R1.w;\n" - "MUL R4.xyz, R0, R4;\n" - "MAD R5.xyz, R1.w, R0, R5;\n" - "ADD R6.xyz, R5, -R4;\n" - "MUL R5.xyz, R0, c[6].x;\n" - "SGE R3.xyz, R5, R0.w;\n" - "MAD R3.xyz, R3, R6, R4;\n" + "MUL R3.xyz, R1, c[5].y;\n" + "MAD R6.xyz, -R5, R6, R1.w;\n" + "MAD R4.xyz, R1.w, R0, R4;\n" + "MAD R5.xyz, -R0, R6, R4;\n" + "MUL R4.xyz, R0, c[5].w;\n" + "MUL R6.xyz, R0, R6;\n" + "SGE R4.xyz, R4, R0.w;\n" + "MAD R4.xyz, R4, R5, R6;\n" + "MAD R4.xyz, -R0, R2, R4;\n" "MUL R2.xyz, R0, R2;\n" - "MUL R4.xyz, R1, c[5].z;\n" - "ADD R3.xyz, R3, -R2;\n" - "SGE R4.xyz, R4, R1.w;\n" - "MAD R2.xyz, R4, R3, R2;\n" + "SGE R3.xyz, R3, R1.w;\n" + "MAD R2.xyz, R3, R4, R2;\n" "ADD R2.w, -R0, c[5].x;\n" - "MAD R1.xyz, R1, R2.w, R2;\n" - "ADD R2.x, R1.w, R0.w;\n" - "ADD R2.y, -R1.w, c[5].x;\n" - "MAD result.color.xyz, R0, R2.y, R1;\n" - "MAD result.color.w, -R1, R0, R2.x;\n" + "MAD R2.xyz, R1, R2.w, R2;\n" + "ADD R1.x, R1.w, R0.w;\n" + "ADD R1.y, -R1.w, c[5].x;\n" + "MAD result.color.xyz, R0, R1.y, R2;\n" + "MAD result.color.w, -R1, R0, R1.x;\n" "END\n" ; @@ -6803,10 +6802,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[1], 2D;\n" - "MUL R0.xy, fragment.position, c[4];\n" - "TEX R0, R0, texture[0], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[1], 2D;\n" + "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R3.xyz, R1.w, R0;\n" "MUL R2.xyz, R1, R0.w;\n" @@ -6831,10 +6830,10 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[1], 2D;\n" - "MUL R0.xy, fragment.position, c[4];\n" - "TEX R0, R0, texture[0], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[1], 2D;\n" + "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" + "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R2.xyz, R1.w, R0;\n" "MAD R3.xyz, R1, R0.w, R2;\n" @@ -6864,9 +6863,9 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MUL R0.xy, R0, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" "TEX R1.x, R1, texture[1], 2D;\n" - "DP4 R0.x, R0, c[6];\n" - "MUL R1, fragment.color.primary, R1.x;\n" - "MUL result.color, R1, R0.x;\n" + "DP4 R1.y, R0, c[6];\n" + "MUL R0, fragment.color.primary, R1.x;\n" + "MUL result.color, R0, R1.y;\n" "END\n" ; diff --git a/src/opengl/util/masks.conf b/src/opengl/util/masks.conf index 733ac81..d853d0b 100644 --- a/src/opengl/util/masks.conf +++ b/src/opengl/util/masks.conf @@ -1,3 +1,2 @@ FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA trap_exact_aa.glsl FRAGMENT_PROGRAM_MASK_ELLIPSE_AA ellipse_aa.glsl -#FRAGMENT_PROGRAM_MASK_ELLIPSE ellipse.glsl diff --git a/src/opengl/util/simple_porter_duff.glsl b/src/opengl/util/simple_porter_duff.glsl index 83aef48..4cb0599 100644 --- a/src/opengl/util/simple_porter_duff.glsl +++ b/src/opengl/util/simple_porter_duff.glsl @@ -7,10 +7,10 @@ vec4 composite(vec4 src, vec4 dst) result.xyz = porterduff_ab.x * src.xyz * dst.a + porterduff_ab.y * dst.xyz * src.a - + porterduff_xyz.y * src.xyz * (1 - dst.a) - + porterduff_xyz.z * dst.xyz * (1 - src.a); + + porterduff_xyz.y * src.xyz * (1.0 - dst.a) + + porterduff_xyz.z * dst.xyz * (1.0 - src.a); - result.a = dot(porterduff_xyz, vec3(src.a * dst.a, src.a * (1 - dst.a), dst.a * (1 - src.a))); + result.a = dot(porterduff_xyz, vec3(src.a * dst.a, src.a * (1.0 - dst.a), dst.a * (1.0 - src.a))); return result; } diff --git a/src/opengl/util/trap_exact_aa.glsl b/src/opengl/util/trap_exact_aa.glsl index b96f87d..1637f43 100644 --- a/src/opengl/util/trap_exact_aa.glsl +++ b/src/opengl/util/trap_exact_aa.glsl @@ -14,7 +14,7 @@ float quad_aa() vec2 invA = gl_TexCoord[0].zw; // transform right line to left to be able to use same calculations for both - vecX.zw = 2 * gl_FragCoord.x - vecX.zw; + vecX.zw = 2.0 * gl_FragCoord.x - vecX.zw; vec2 topX = vec2(vecX.x, vecX.z); vec2 bottomX = vec2(vecX.y, vecX.w); @@ -33,18 +33,18 @@ float quad_aa() vec2 temp = mix(area - 0.5 * (right - bottomXTemp) * (intersectY.yw - bottom), // left < bottom < right < top (0.5 * (topXTemp + bottomXTemp) - left) * area, // left < bottom < top < right - step(topXTemp, right)); + step(topXTemp, right.xx)); vec2 excluded = 0.5 * (top - intersectY.xz) * (topXTemp - left); // bottom < left < top < right excluded = mix((top - 0.5 * (intersectY.yw + intersectY.xz)) * (right - left), // bottom < left < right < top - excluded, step(topXTemp, right)); + excluded, step(topXTemp, right.xx)); excluded = mix(temp, // left < bottom < right (see calculation of temp) - excluded, step(bottomXTemp, left)); + excluded, step(bottomXTemp, left.xx)); excluded = mix(vec2(area, area), // right < bottom < top - excluded, step(bottomXTemp, right)); + excluded, step(bottomXTemp, right.xx)); excluded *= step(left, topXTemp); @@ -53,6 +53,6 @@ float quad_aa() void main() { - gl_FragColor = quad_aa(); + gl_FragColor = quad_aa().xxxx; } -- cgit v0.12 From d109954578b4948706577dfffb7bde139678370a Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Wed, 14 Oct 2009 17:29:01 +0200 Subject: Fixed the GLSL-to-assembly code generator to output enums correctly. Fixed the output of enums such that the last item in the enum is not followed by comma. Changed the output of the license to say that the file is part of the QtOpenGL module, not the test suite. Reviewed-by: Trond --- src/opengl/util/generator.cpp | 53 ++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/src/opengl/util/generator.cpp b/src/opengl/util/generator.cpp index 62d19ff..0202fe1 100644 --- a/src/opengl/util/generator.cpp +++ b/src/opengl/util/generator.cpp @@ -54,6 +54,8 @@ QT_BEGIN_NAMESPACE QT_USE_NAMESPACE +#define TAB " " + typedef QPair QStringPair; QString readSourceFile(const QString &sourceFile, bool fragmentProgram = false) @@ -243,6 +245,30 @@ QString trimmed(QString source) return result; } +void writeVariablesEnum(QTextStream &out, const char *name, const QSet &s) +{ + out << "enum " << name << " {"; + QSet::const_iterator it = s.begin(); + if (it != s.end()) { + out << "\n" TAB "VAR_" << it->toUpper(); + for (++it; it != s.end(); ++it) + out << ",\n" TAB "VAR_" << it->toUpper(); + } + out << "\n};\n\n"; +} + +void writeTypesEnum(QTextStream &out, const char *name, const QList &s) +{ + out << "enum " << name << " {"; + QList::const_iterator it = s.begin(); + if (it != s.end()) { + out << "\n" TAB << it->first; + for (++it; it != s.end(); ++it) + out << ",\n" TAB << it->first; + } + out << "\n};\n\n"; +} + void writeIncludeFile(const QSet &variables, const QList &brushes, const QList &compositionModes, @@ -257,7 +283,7 @@ void writeIncludeFile(const QSet &variables, QTextStream out(&includeFile); - QLatin1String tab(" "); + QLatin1String tab(TAB); out << "/****************************************************************************\n" "**\n" @@ -265,7 +291,7 @@ void writeIncludeFile(const QSet &variables, "** All rights reserved.\n" "** Contact: Nokia Corporation (qt-info@nokia.com)\n" "**\n" - "** This file is part of the test suite of the Qt Toolkit.\n" + "** This file is part of the QtOpenGL module of the Qt Toolkit.\n" "**\n" "** $QT_BEGIN_LICENSE:LGPL$\n" "** No Commercial Usage\n" @@ -315,25 +341,10 @@ void writeIncludeFile(const QSet &variables, "//\n" "\n"; - out << "enum FragmentVariable {\n"; - foreach (QString str, variables) - out << tab << "VAR_" << str.toUpper() << ",\n"; - out << "};\n\n"; - - out << "enum FragmentBrushType {\n"; - foreach (QStringPair brush, brushes) - out << tab << brush.first << ",\n"; - out << "};\n\n"; - - out << "enum FragmentCompositionModeType {\n"; - foreach (QStringPair mode, compositionModes) - out << tab << mode.first << ",\n"; - out << "};\n\n"; - - out << "enum FragmentMaskType {\n"; - foreach (QStringPair mask, masks) - out << tab << mask.first << ",\n"; - out << "};\n\n"; + writeVariablesEnum(out, "FragmentVariable", variables); + writeTypesEnum(out, "FragmentBrushType", brushes); + writeTypesEnum(out, "FragmentCompositionModeType", compositionModes); + writeTypesEnum(out, "FragmentMaskType", masks); out << "static const unsigned int num_fragment_variables = " << variables.size() << ";\n\n"; out << "static const unsigned int num_fragment_brushes = " << brushes.size() << ";\n"; -- cgit v0.12 From 9a3cdecc11e8dabaf2390eaab2c71e64f6521e69 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 15 Oct 2009 10:13:27 +0200 Subject: Compile There's no implicit conversion from QPixmap to QImage Reviewed-by: Gunnar --- src/gui/effects/qgraphicseffect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 42845cc..91641b0 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -1504,7 +1504,7 @@ void QGraphicsBloomEffect::draw(QPainter *painter, QGraphicsEffectSource *source QTransform restoreTransform = painter->worldTransform(); painter->setWorldTransform(QTransform()); - painter->drawImage(offset, pixmap); + painter->drawPixmap(offset, pixmap); painter->setWorldTransform(restoreTransform); } -- cgit v0.12 From d83761cf3ddd301545ebd9981b9d0547e636e3b4 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Thu, 15 Oct 2009 10:33:25 +0200 Subject: Fixed bitmap brushes and tiled bitmaps in the OpenGL1 paint engine. Fixed drawing of bitmap brushes and tiled bitmaps so that they are painted with the brush colour or pen colour instead of black. Reviewed-by: Trond --- src/opengl/qpaintengine_opengl.cpp | 14 ++- src/opengl/util/fragmentprograms_p.h | 208 ++++++++++++++++++++--------------- src/opengl/util/pattern_brush.glsl | 2 +- 3 files changed, 132 insertions(+), 92 deletions(-) diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index fc1695d..1a586d3 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -1222,7 +1222,7 @@ inline void QOpenGLPaintEnginePrivate::setGradientOps(const QBrush &brush, const fragment_brush = FRAGMENT_PROGRAM_BRUSH_CONICAL; else if (current_style == Qt::SolidPattern) fragment_brush = FRAGMENT_PROGRAM_BRUSH_SOLID; - else if (current_style == Qt::TexturePattern) + else if (current_style == Qt::TexturePattern && !brush.texture().isQBitmap()) fragment_brush = FRAGMENT_PROGRAM_BRUSH_TEXTURE; else fragment_brush = FRAGMENT_PROGRAM_BRUSH_PATTERN; @@ -4311,6 +4311,16 @@ void QOpenGLPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QR void QOpenGLPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &offset) { Q_D(QOpenGLPaintEngine); + if (pm.depth() == 1) { + QPixmap tpx(pm.size()); + tpx.fill(Qt::transparent); + QPainter p(&tpx); + p.setPen(d->cpen); + p.drawPixmap(0, 0, pm); + p.end(); + drawTiledPixmap(r, tpx, offset); + return; + } QImage scaled; const int sz = d->max_texture_size; @@ -5207,7 +5217,7 @@ void QOpenGLPaintEnginePrivate::composite(GLuint primitive, const q_vertexType * device->context()->d_func()->bindTexture(cbrush.textureImage(), GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); else - device->context()->d_func()->bindTexture(qt_imageForBrush(current_style, true), + device->context()->d_func()->bindTexture(qt_imageForBrush(current_style, false), GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption); diff --git a/src/opengl/util/fragmentprograms_p.h b/src/opengl/util/fragmentprograms_p.h index 89cd182..9154c6e 100644 --- a/src/opengl/util/fragmentprograms_p.h +++ b/src/opengl/util/fragmentprograms_p.h @@ -5927,11 +5927,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MAD R0.xyz, fragment.position.x, c[1], R0;\n" "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" - "MUL R0.zw, R0.xyxy, R0.z;\n" - "MUL R1.xy, R0.zwzw, c[0];\n" + "MUL R0.xy, R0, R0.z;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" + "TEX R1.x, R0.zwzw, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[7];\n" "TEX R0, R0, texture[0], 2D;\n" - "TEX R1.x, R1, texture[2], 2D;\n" + "ADD R1.x, -R1, c[10];\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R2.xyz, R0, c[4].y;\n" "MUL R3.xyz, R1.w, R2;\n" @@ -5967,11 +5968,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MAD R0.xyz, fragment.position.x, c[1], R0;\n" "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" - "MUL R0.zw, R0.xyxy, R0.z;\n" - "MUL R1.xy, R0.zwzw, c[0];\n" + "MUL R0.xy, R0, R0.z;\n" + "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" + "TEX R1.x, R0.zwzw, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" - "TEX R1.x, R1, texture[2], 2D;\n" + "ADD R1.x, -R1, c[8];\n" "MUL R1, fragment.color.primary, R1.x;\n" "ADD R2.x, -R0.w, c[8];\n" "MUL R2.xyz, R1, R2.x;\n" @@ -5991,7 +5993,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SCREEN = "!!ARBfp1.0\n" - "PARAM c[8] = { program.local[0..7] };\n" + "PARAM c[9] = { program.local[0..7],\n" + " { 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6002,11 +6005,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[2], 2D;\n" - "MUL R0.xy, fragment.position, c[5];\n" + "TEX R0.x, R0, texture[2], 2D;\n" + "ADD R0.z, -R0.x, c[8].x;\n" "ADD R3.xy, fragment.position, c[6];\n" + "MUL R1, fragment.color.primary, R0.z;\n" + "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" - "MUL R1, fragment.color.primary, R1.x;\n" "ADD R2, R1, R0;\n" "MAD R2, -R1, R0, R2;\n" "MUL R3.xy, R3, c[4];\n" @@ -6020,7 +6024,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_OVERLAY = "!!ARBfp1.0\n" "PARAM c[9] = { program.local[0..7],\n" - " { 2, 1 } };\n" + " { 1, 2 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6033,23 +6037,24 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" "TEX R0.x, R0, texture[2], 2D;\n" + "ADD R0.x, -R0, c[8];\n" "MUL R1, fragment.color.primary, R0.x;\n" "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" - "ADD R2.w, -R0, c[8].y;\n" + "ADD R2.w, -R0, c[8].x;\n" "ADD R3.xyz, R1.w, -R1;\n" "ADD R2.xyz, R0.w, -R0;\n" "MUL R2.xyz, R2, R3;\n" - "MUL R2.xyz, R2, c[8].x;\n" + "MUL R2.xyz, R2, c[8].y;\n" "MAD R2.xyz, R1.w, R0.w, -R2;\n" "MUL R4.xyz, R1, R2.w;\n" "MUL R3.xyz, R1, R0;\n" "MAD R1.xyz, R1, R2.w, R2;\n" - "ADD R2.x, -R1.w, c[8].y;\n" - "MAD R3.xyz, R3, c[8].x, R4;\n" + "ADD R2.x, -R1.w, c[8];\n" + "MAD R3.xyz, R3, c[8].y, R4;\n" "MAD R3.xyz, R0, R2.x, R3;\n" "MAD R1.xyz, R0, R2.x, R1;\n" - "MUL R2.xyz, R0, c[8].x;\n" + "MUL R2.xyz, R0, c[8].y;\n" "ADD R1.xyz, R1, -R3;\n" "SGE R2.xyz, R2, R0.w;\n" "MAD R2.xyz, R2, R1, R3;\n" @@ -6077,10 +6082,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[2], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" + "ADD R1.x, -R1, c[8];\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R3.xyz, R1.w, R0;\n" "MUL R2.xyz, R1, R0.w;\n" @@ -6113,10 +6119,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[2], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" + "ADD R1.x, -R1, c[8];\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R3.xyz, R1.w, R0;\n" "MUL R2.xyz, R1, R0.w;\n" @@ -6152,6 +6159,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" "TEX R0.x, R0, texture[2], 2D;\n" + "ADD R0.x, -R0, c[8];\n" "MUL R1, fragment.color.primary, R0.x;\n" "MAX R0.x, R1.w, c[8].y;\n" "RCP R0.x, R0.x;\n" @@ -6201,7 +6209,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[2], 2D;\n" + "TEX R0.x, R0, texture[2], 2D;\n" + "ADD R1.x, -R0, c[8];\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" @@ -6238,7 +6247,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_HARDLIGHT = "!!ARBfp1.0\n" "PARAM c[9] = { program.local[0..7],\n" - " { 2, 1 } };\n" + " { 1, 2 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6251,21 +6260,22 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" "TEX R0.x, R0, texture[2], 2D;\n" + "ADD R0.x, -R0, c[8];\n" "MUL R1, fragment.color.primary, R0.x;\n" "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" - "ADD R2.w, -R0, c[8].y;\n" + "ADD R2.w, -R0, c[8].x;\n" "ADD R3.xyz, R1.w, -R1;\n" "ADD R2.xyz, R0.w, -R0;\n" "MUL R2.xyz, R2, R3;\n" - "MUL R2.xyz, R2, c[8].x;\n" + "MUL R2.xyz, R2, c[8].y;\n" "MAD R2.xyz, R1.w, R0.w, -R2;\n" "MUL R4.xyz, R1, R2.w;\n" "MAD R2.xyz, R1, R2.w, R2;\n" "MUL R3.xyz, R1, R0;\n" - "ADD R2.w, -R1, c[8].y;\n" - "MAD R3.xyz, R3, c[8].x, R4;\n" - "MUL R1.xyz, R1, c[8].x;\n" + "ADD R2.w, -R1, c[8].x;\n" + "MAD R3.xyz, R3, c[8].y, R4;\n" + "MUL R1.xyz, R1, c[8].y;\n" "SGE R1.xyz, R1, R1.w;\n" "MAD R3.xyz, R0, R2.w, R3;\n" "MAD R2.xyz, R0, R2.w, R2;\n" @@ -6296,24 +6306,25 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "TEMP R6;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.x, R0.w, c[8].z;\n" - "RCP R2.w, R1.x;\n" + "MAX R1.w, R0, c[8].z;\n" + "RCP R2.w, R1.w;\n" "MUL R2.xyz, R0, R2.w;\n" "RSQ R1.w, R2.x;\n" - "RCP R3.x, R1.w;\n" - "RSQ R1.w, R2.y;\n" "MUL R5.xyz, -R2, c[8].w;\n" "MUL R1.xyz, fragment.position.y, c[2];\n" "MAD R1.xyz, fragment.position.x, c[1], R1;\n" "ADD R1.xyz, R1, c[3];\n" "RCP R1.z, R1.z;\n" "MUL R1.xy, R1, R1.z;\n" - "RSQ R1.z, R2.z;\n" "MUL R1.xy, R1, c[0];\n" - "MAD R2.xyz, -R0, R2.w, c[8].x;\n" - "RCP R3.y, R1.w;\n" - "RCP R3.z, R1.z;\n" "TEX R1.x, R1, texture[2], 2D;\n" + "RSQ R1.z, R2.y;\n" + "RSQ R1.y, R2.z;\n" + "MAD R2.xyz, -R0, R2.w, c[8].x;\n" + "RCP R3.x, R1.w;\n" + "RCP R3.y, R1.z;\n" + "RCP R3.z, R1.y;\n" + "ADD R1.x, -R1, c[8];\n" "MUL R1, fragment.color.primary, R1.x;\n" "MAD R4.xyz, R0.w, R3, -R0;\n" "MAD R3.xyz, R1, c[8].y, -R1.w;\n" @@ -6351,7 +6362,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DIFFERENCE = "!!ARBfp1.0\n" "PARAM c[9] = { program.local[0..7],\n" - " { 2 } };\n" + " { 1, 2 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6361,16 +6372,17 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[2], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[5];\n" + "ADD R1.x, -R1, c[8];\n" "TEX R0, R0, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "ADD R2.xyz, R1, R0;\n" "MUL R3.xyz, R1.w, R0;\n" "MUL R1.xyz, R1, R0.w;\n" "MIN R1.xyz, R1, R3;\n" - "MAD R2.xyz, -R1, c[8].x, R2;\n" + "MAD R2.xyz, -R1, c[8].y, R2;\n" "ADD R1.z, R1.w, R0.w;\n" "MAD R2.w, -R1, R0, R1.z;\n" "ADD R1.xy, fragment.position, c[6];\n" @@ -6385,7 +6397,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_EXCLUSION = "!!ARBfp1.0\n" "PARAM c[9] = { program.local[0..7],\n" - " { 2, 1 } };\n" + " { 1, 2 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6395,18 +6407,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R0.zw, R0.xyxy, c[0].xyxy;\n" - "TEX R1.x, R0.zwzw, texture[2], 2D;\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[2], 2D;\n" "MUL R0.xy, fragment.position, c[5];\n" "TEX R0, R0, texture[0], 2D;\n" + "ADD R1.x, -R1, c[8];\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R2.xyz, R1.w, R0;\n" "MAD R3.xyz, R1, R0.w, R2;\n" "MUL R2.xyz, R1, R0;\n" - "MAD R2.xyz, -R2, c[8].x, R3;\n" - "ADD R2.w, -R0, c[8].y;\n" + "MAD R2.xyz, -R2, c[8].y, R3;\n" + "ADD R2.w, -R0, c[8].x;\n" "MAD R1.xyz, R1, R2.w, R2;\n" - "ADD R2.x, -R1.w, c[8].y;\n" + "ADD R2.x, -R1.w, c[8];\n" "MAD R2.xyz, R0, R2.x, R1;\n" "ADD R1.z, R1.w, R0.w;\n" "MAD R2.w, -R1, R0, R1.z;\n" @@ -6432,11 +6445,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R1.xy, R0, c[0];\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[1], 2D;\n" "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R2.xyz, R0, c[4].y;\n" - "TEX R1.x, R1, texture[1], 2D;\n" + "ADD R1.x, -R1, c[7];\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R3.xyz, R1.w, R2;\n" "MUL R2.xyz, R1, c[4].x;\n" @@ -6466,10 +6480,11 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R0, c[3];\n" "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" - "MUL R1.xy, R0, c[0];\n" + "MUL R0.xy, R0, c[0];\n" + "TEX R1.x, R0, texture[1], 2D;\n" "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" - "TEX R1.x, R1, texture[1], 2D;\n" + "ADD R1.x, -R1, c[5];\n" "MUL R1, fragment.color.primary, R1.x;\n" "ADD R2.x, -R0.w, c[5];\n" "MUL R2.xyz, R1, R2.x;\n" @@ -6483,7 +6498,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SCREEN_NOMASK = "!!ARBfp1.0\n" - "PARAM c[5] = { program.local[0..4] };\n" + "PARAM c[6] = { program.local[0..4],\n" + " { 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6493,7 +6509,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[1], 2D;\n" + "TEX R0.x, R0, texture[1], 2D;\n" + "ADD R1.x, -R0, c[5];\n" "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" @@ -6505,7 +6522,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_OVERLAY_NOMASK = "!!ARBfp1.0\n" "PARAM c[6] = { program.local[0..4],\n" - " { 2, 1 } };\n" + " { 1, 2 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6517,23 +6534,24 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" "TEX R0.x, R0, texture[1], 2D;\n" + "ADD R0.x, -R0, c[5];\n" "MUL R1, fragment.color.primary, R0.x;\n" "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" "ADD R3.xyz, R1.w, -R1;\n" "ADD R2.xyz, R0.w, -R0;\n" "MUL R2.xyz, R2, R3;\n" - "ADD R2.w, -R0, c[5].y;\n" - "MUL R2.xyz, R2, c[5].x;\n" + "ADD R2.w, -R0, c[5].x;\n" + "MUL R2.xyz, R2, c[5].y;\n" "MAD R2.xyz, R1.w, R0.w, -R2;\n" "MAD R2.xyz, R1, R2.w, R2;\n" "MUL R3.xyz, R1, R2.w;\n" "MUL R1.xyz, R1, R0;\n" - "ADD R2.w, -R1, c[5].y;\n" - "MAD R1.xyz, R1, c[5].x, R3;\n" + "ADD R2.w, -R1, c[5].x;\n" + "MAD R1.xyz, R1, c[5].y, R3;\n" "MAD R1.xyz, R0, R2.w, R1;\n" "MAD R2.xyz, R0, R2.w, R2;\n" - "MUL R0.xyz, R0, c[5].x;\n" + "MUL R0.xyz, R0, c[5].y;\n" "ADD R2.w, R1, R0;\n" "ADD R2.xyz, R2, -R1;\n" "SGE R0.xyz, R0, R0.w;\n" @@ -6556,7 +6574,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[1], 2D;\n" + "TEX R0.x, R0, texture[1], 2D;\n" + "ADD R1.x, -R0, c[5];\n" "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" @@ -6586,7 +6605,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[1], 2D;\n" + "TEX R0.x, R0, texture[1], 2D;\n" + "ADD R1.x, -R0, c[5];\n" "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" @@ -6617,6 +6637,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" "TEX R0.x, R0, texture[1], 2D;\n" + "ADD R0.x, -R0, c[5];\n" "MUL R1, fragment.color.primary, R0.x;\n" "MAX R0.x, R1.w, c[5].y;\n" "RCP R0.x, R0.x;\n" @@ -6660,7 +6681,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[1], 2D;\n" + "TEX R0.x, R0, texture[1], 2D;\n" + "ADD R1.x, -R0, c[5];\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" @@ -6691,7 +6713,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_HARDLIGHT_NOMASK = "!!ARBfp1.0\n" "PARAM c[6] = { program.local[0..4],\n" - " { 2, 1 } };\n" + " { 1, 2 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6704,21 +6726,22 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" "TEX R0.x, R0, texture[1], 2D;\n" + "ADD R0.x, -R0, c[5];\n" "MUL R1, fragment.color.primary, R0.x;\n" "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" - "ADD R2.w, -R0, c[5].y;\n" + "ADD R2.w, -R0, c[5].x;\n" "ADD R3.xyz, R1.w, -R1;\n" "ADD R2.xyz, R0.w, -R0;\n" "MUL R2.xyz, R2, R3;\n" - "MUL R2.xyz, R2, c[5].x;\n" + "MUL R2.xyz, R2, c[5].y;\n" "MAD R2.xyz, R1.w, R0.w, -R2;\n" "MAD R2.xyz, R1, R2.w, R2;\n" "MUL R4.xyz, R1, R2.w;\n" "MUL R3.xyz, R1, R0;\n" - "MUL R1.xyz, R1, c[5].x;\n" - "ADD R2.w, -R1, c[5].y;\n" - "MAD R3.xyz, R3, c[5].x, R4;\n" + "MUL R1.xyz, R1, c[5].y;\n" + "ADD R2.w, -R1, c[5].x;\n" + "MAD R3.xyz, R3, c[5].y, R4;\n" "MAD R3.xyz, R0, R2.w, R3;\n" "MAD R0.xyz, R0, R2.w, R2;\n" "ADD R2.x, R1.w, R0.w;\n" @@ -6743,24 +6766,25 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "TEMP R6;\n" "MUL R0.xy, fragment.position, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" - "MAX R1.x, R0.w, c[5].z;\n" - "RCP R2.w, R1.x;\n" + "MAX R1.w, R0, c[5].z;\n" + "RCP R2.w, R1.w;\n" "MUL R2.xyz, R0, R2.w;\n" "RSQ R1.w, R2.x;\n" - "RCP R3.x, R1.w;\n" - "RSQ R1.w, R2.y;\n" "MUL R5.xyz, -R2, c[5].w;\n" "MUL R1.xyz, fragment.position.y, c[2];\n" "MAD R1.xyz, fragment.position.x, c[1], R1;\n" "ADD R1.xyz, R1, c[3];\n" "RCP R1.z, R1.z;\n" "MUL R1.xy, R1, R1.z;\n" - "RSQ R1.z, R2.z;\n" "MUL R1.xy, R1, c[0];\n" - "MAD R2.xyz, -R0, R2.w, c[5].x;\n" - "RCP R3.y, R1.w;\n" - "RCP R3.z, R1.z;\n" "TEX R1.x, R1, texture[1], 2D;\n" + "RSQ R1.z, R2.y;\n" + "RSQ R1.y, R2.z;\n" + "MAD R2.xyz, -R0, R2.w, c[5].x;\n" + "RCP R3.x, R1.w;\n" + "RCP R3.y, R1.z;\n" + "RCP R3.z, R1.y;\n" + "ADD R1.x, -R1, c[5];\n" "MUL R1, fragment.color.primary, R1.x;\n" "MAD R4.xyz, R0.w, R3, -R0;\n" "MAD R3.xyz, R1, c[5].y, -R1.w;\n" @@ -6792,7 +6816,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_DIFFERENCE_NOMASK = "!!ARBfp1.0\n" "PARAM c[6] = { program.local[0..4],\n" - " { 2 } };\n" + " { 1, 2 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6803,7 +6827,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[1], 2D;\n" + "TEX R0.x, R0, texture[1], 2D;\n" + "ADD R1.x, -R0, c[5];\n" "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" @@ -6812,7 +6837,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "ADD R0.xyz, R1, R0;\n" "MIN R2.xyz, R2, R3;\n" "ADD R1.x, R1.w, R0.w;\n" - "MAD result.color.xyz, -R2, c[5].x, R0;\n" + "MAD result.color.xyz, -R2, c[5].y, R0;\n" "MAD result.color.w, -R1, R0, R1.x;\n" "END\n" ; @@ -6820,7 +6845,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_EXCLUSION_NOMASK = "!!ARBfp1.0\n" "PARAM c[6] = { program.local[0..4],\n" - " { 2, 1 } };\n" + " { 1, 2 } };\n" "TEMP R0;\n" "TEMP R1;\n" "TEMP R2;\n" @@ -6831,18 +6856,19 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "RCP R0.z, R0.z;\n" "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" - "TEX R1.x, R0, texture[1], 2D;\n" + "TEX R0.x, R0, texture[1], 2D;\n" + "ADD R1.x, -R0, c[5];\n" "MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n" "TEX R0, R0.zwzw, texture[0], 2D;\n" "MUL R1, fragment.color.primary, R1.x;\n" "MUL R2.xyz, R1.w, R0;\n" "MAD R3.xyz, R1, R0.w, R2;\n" "MUL R2.xyz, R1, R0;\n" - "MAD R2.xyz, -R2, c[5].x, R3;\n" - "ADD R2.w, -R0, c[5].y;\n" + "MAD R2.xyz, -R2, c[5].y, R3;\n" + "ADD R2.w, -R0, c[5].x;\n" "MAD R1.xyz, R1, R2.w, R2;\n" "ADD R2.x, R1.w, R0.w;\n" - "ADD R2.y, -R1.w, c[5];\n" + "ADD R2.y, -R1.w, c[5].x;\n" "MAD result.color.xyz, R0, R2.y, R1;\n" "MAD result.color.w, -R1, R0, R2.x;\n" "END\n" @@ -6850,20 +6876,22 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODE_BLEND_MODE_MASK = "!!ARBfp1.0\n" - "PARAM c[7] = { program.local[0..6] };\n" + "PARAM c[8] = { program.local[0..6],\n" + " { 1 } };\n" "TEMP R0;\n" "TEMP R1;\n" "MUL R0.xyz, fragment.position.y, c[2];\n" "MAD R0.xyz, fragment.position.x, c[1], R0;\n" - "ADD R1.xyz, R0, c[3];\n" - "RCP R0.z, R1.z;\n" - "MUL R0.zw, R1.xyxy, R0.z;\n" - "MUL R1.xy, R0.zwzw, c[0];\n" + "ADD R0.xyz, R0, c[3];\n" + "RCP R0.z, R0.z;\n" + "MUL R0.zw, R0.xyxy, R0.z;\n" + "MUL R0.zw, R0, c[0].xyxy;\n" + "TEX R1.x, R0.zwzw, texture[1], 2D;\n" "ADD R0.xy, fragment.position, c[5];\n" "MUL R0.xy, R0, c[4];\n" "TEX R0, R0, texture[0], 2D;\n" - "TEX R1.x, R1, texture[1], 2D;\n" "DP4 R1.y, R0, c[6];\n" + "ADD R1.x, -R1, c[7];\n" "MUL R0, fragment.color.primary, R1.x;\n" "MUL result.color, R0, R1.y;\n" "END\n" @@ -6871,7 +6899,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODE_BLEND_MODE_NOMASK = "!!ARBfp1.0\n" - "PARAM c[4] = { program.local[0..3] };\n" + "PARAM c[5] = { program.local[0..3],\n" + " { 1 } };\n" "TEMP R0;\n" "MUL R0.xyz, fragment.position.y, c[2];\n" "MAD R0.xyz, fragment.position.x, c[1], R0;\n" @@ -6880,6 +6909,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO "MUL R0.xy, R0, R0.z;\n" "MUL R0.xy, R0, c[0];\n" "TEX R0.x, R0, texture[0], 2D;\n" + "ADD R0.x, -R0, c[4];\n" "MUL result.color, fragment.color.primary, R0.x;\n" "END\n" ; diff --git a/src/opengl/util/pattern_brush.glsl b/src/opengl/util/pattern_brush.glsl index ac139b2..31702b8 100644 --- a/src/opengl/util/pattern_brush.glsl +++ b/src/opengl/util/pattern_brush.glsl @@ -17,7 +17,7 @@ vec4 brush() coords *= inv_brush_texture_size; - float alpha = texture2D(brush_texture, coords).r; + float alpha = 1.0 - texture2D(brush_texture, coords).r; return gl_Color * alpha; } -- cgit v0.12 From 342a1233df813f00df475b713fa1c6252ee4dcd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 15 Oct 2009 10:46:59 +0200 Subject: Fixed buggy bitmap drawing in GL 2 engine on X11. Don't use texture_from_pixmap extension for QBitmaps. Reviewed-by: Tom --- src/opengl/qgl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 8aef8b4..1be2073 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2352,7 +2352,7 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, #if defined(Q_WS_X11) // Try to use texture_from_pixmap - if (pd->classId() == QPixmapData::X11Class) { + if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType) { texture = bindTextureFromNativePixmap(pd, key, options); if (texture) { texture->options |= QGLContext::MemoryManagedBindOption; -- cgit v0.12 From ae33eb787a8b0ff9b04f02b9c18bad0bf6736b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 14 Oct 2009 15:50:44 +0200 Subject: Optimized raster drop shadow filter to only blur alpha channel. Reviewed-by: Gunnar --- src/gui/image/qpixmapfilter.cpp | 51 ++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index df445db..9fcf776 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -591,7 +591,7 @@ QRectF QPixmapBlurFilter::boundingRectFor(const QRectF &rect) const // Blur the image according to the blur radius // Based on exponential blur algorithm by Jani Huhtanen // (maximum radius is set to 16) -static QImage blurred(const QImage& image, const QRect& rect, int radius) +static QImage blurred(const QImage& image, const QRect& rect, int radius, bool alphaOnly = false) { int tab[] = { 14, 10, 8, 6, 5, 5, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2 }; int alpha = (radius < 1) ? 16 : (radius > 17) ? 1 : tab[radius-1]; @@ -606,47 +606,53 @@ static QImage blurred(const QImage& image, const QRect& rect, int radius) int rgba[4]; unsigned char* p; + int i1 = 0; + int i2 = 3; + + if (alphaOnly) + i1 = i2 = (QSysInfo::ByteOrder == QSysInfo::BigEndian ? 0 : 3); + for (int col = c1; col <= c2; col++) { p = result.scanLine(r1) + col * 4; - for (int i = 0; i < 4; i++) + for (int i = i1; i <= i2; i++) rgba[i] = p[i] << 4; p += bpl; for (int j = r1; j < r2; j++, p += bpl) - for (int i = 0; i < 4; i++) + for (int i = i1; i <= i2; i++) p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4; } for (int row = r1; row <= r2; row++) { p = result.scanLine(row) + c1 * 4; - for (int i = 0; i < 4; i++) + for (int i = i1; i <= i2; i++) rgba[i] = p[i] << 4; p += 4; for (int j = c1; j < c2; j++, p += 4) - for (int i = 0; i < 4; i++) + for (int i = i1; i <= i2; i++) p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4; } for (int col = c1; col <= c2; col++) { p = result.scanLine(r2) + col * 4; - for (int i = 0; i < 4; i++) + for (int i = i1; i <= i2; i++) rgba[i] = p[i] << 4; p -= bpl; for (int j = r1; j < r2; j++, p -= bpl) - for (int i = 0; i < 4; i++) + for (int i = i1; i <= i2; i++) p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4; } for (int row = r1; row <= r2; row++) { p = result.scanLine(row) + c2 * 4; - for (int i = 0; i < 4; i++) + for (int i = i1; i <= i2; i++) rgba[i] = p[i] << 4; p -= 4; for (int j = c1; j < c2; j++, p -= 4) - for (int i = 0; i < 4; i++) + for (int i = i1; i <= i2; i++) p[i] = (rgba[i] += ((p[i] << 4) - rgba[i]) * alpha / 16) >> 4; } @@ -892,11 +898,11 @@ class QPixmapDropShadowFilterPrivate : public QPixmapFilterPrivate { public: QPixmapDropShadowFilterPrivate() - : offset(8, 8), color(63, 63, 63, 180), blurFilter(new QPixmapBlurFilter) {} + : offset(8, 8), color(63, 63, 63, 180), radius(1) {} QPointF offset; QColor color; - QPixmapBlurFilter *blurFilter; + int radius; }; /*! @@ -940,8 +946,6 @@ public: QPixmapDropShadowFilter::QPixmapDropShadowFilter(QObject *parent) : QPixmapFilter(*new QPixmapDropShadowFilterPrivate, DropShadowFilter, parent) { - Q_D(QPixmapDropShadowFilter); - d->blurFilter->setRadius(1); } /*! @@ -951,8 +955,6 @@ QPixmapDropShadowFilter::QPixmapDropShadowFilter(QObject *parent) */ QPixmapDropShadowFilter::~QPixmapDropShadowFilter() { - Q_D(QPixmapDropShadowFilter); - delete d->blurFilter; } /*! @@ -967,7 +969,7 @@ QPixmapDropShadowFilter::~QPixmapDropShadowFilter() int QPixmapDropShadowFilter::blurRadius() const { Q_D(const QPixmapDropShadowFilter); - return d->blurFilter->radius(); + return d->radius; } /*! @@ -982,7 +984,7 @@ int QPixmapDropShadowFilter::blurRadius() const void QPixmapDropShadowFilter::setBlurRadius(int radius) { Q_D(QPixmapDropShadowFilter); - d->blurFilter->setRadius(radius); + d->radius = radius; } /*! @@ -1056,7 +1058,7 @@ QRectF QPixmapDropShadowFilter::boundingRectFor(const QRectF &rect) const { Q_D(const QPixmapDropShadowFilter); - const qreal delta = qreal(d->blurFilter->radius() * 2); + const qreal delta = qreal(d->radius * 2); qreal x1 = qMin(rect.left(), rect.left() + d->offset.x() - delta); qreal y1 = qMin(rect.top(), rect.top() + d->offset.y() - delta); qreal x2 = qMax(rect.right(), rect.right() + d->offset.x() + delta); @@ -1079,24 +1081,25 @@ void QPixmapDropShadowFilter::draw(QPainter *p, QPixmapDropShadowFilter *dropShadowFilter = static_cast(filter); if (dropShadowFilter) { dropShadowFilter->setColor(d->color); - dropShadowFilter->setBlurRadius(d->blurFilter->radius()); + dropShadowFilter->setBlurRadius(d->radius); dropShadowFilter->setOffset(d->offset); dropShadowFilter->draw(p, pos, px, src); return; } - QImage tmp = src.isNull() ? px.toImage() : px.copy(src.toRect()).toImage(); - QPainter tmpPainter(&tmp); + QImage tmp = src.isNull() ? px.toImage() : px.copy(src.toAlignedRect()).toImage(); + + // blur the alpha channel + tmp = blurred(tmp, tmp.rect(), d->radius, true); // blacken the image... + QPainter tmpPainter(&tmp); tmpPainter.setCompositionMode(QPainter::CompositionMode_SourceIn); tmpPainter.fillRect(0, 0, tmp.width(), tmp.height(), d->color); tmpPainter.end(); - const QPixmap pixTmp = QPixmap::fromImage(tmp); - // draw the blurred drop shadow... - d->blurFilter->draw(p, pos + d->offset, pixTmp); + p->drawImage(pos + d->offset, tmp); // Draw the actual pixmap... p->drawPixmap(pos, px, src); -- cgit v0.12 From ac0fe3babf0c0b6f634af98b24dbeaae1453f11b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 15 Oct 2009 12:20:16 +0200 Subject: Added explicit qualification of static functions to fix xlC compilation. It seems static inline functions need to be fully qualified when called from inside a template function. Task-number: QTBUG-3368 Reviewed-by: Gunnar Sletta --- src/gui/painting/qrasterizer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 66d0c9d..b602690 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -310,7 +310,7 @@ struct QBoolToType template void qScanConvert(QScanConverter &d, T allVertical) { - qSort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), topOrder); + qSort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), QT_PREPEND_NAMESPACE(topOrder)); int line = 0; for (int y = d.m_lines.first().top; y <= d.m_bottom; ++y) { for (; line < d.m_lines.size() && d.m_lines.at(line).top == y; ++line) { @@ -319,7 +319,7 @@ void qScanConvert(QScanConverter &d, T allVertical) QScanConverter::Line *l = &d.m_lines.at(line); d.m_active.resize(d.m_active.size() + 1); int j; - for (j = d.m_active.size() - 2; j >= 0 && xOrder(l, d.m_active.at(j)); --j) + for (j = d.m_active.size() - 2; j >= 0 && QT_PREPEND_NAMESPACE(xOrder)(l, d.m_active.at(j)); --j) d.m_active.at(j+1) = d.m_active.at(j); d.m_active.at(j+1) = l; } else { @@ -334,7 +334,7 @@ void qScanConvert(QScanConverter &d, T allVertical) for (int i = 1; i < numActive; ++i) { QScanConverter::Line *l = d.m_active.at(i); int j; - for (j = i-1; j >= 0 && xOrder(l, d.m_active.at(j)); --j) + for (j = i-1; j >= 0 && QT_PREPEND_NAMESPACE(xOrder)(l, d.m_active.at(j)); --j) d.m_active.at(j+1) = d.m_active.at(j); d.m_active.at(j+1) = l; } -- cgit v0.12 From a38dcd522e05514a8caeeee7d01b05ec6af23fe1 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Thu, 15 Oct 2009 16:19:42 +0200 Subject: Fixed QPainter::begin() so that it fails gracefully. Fixed QPainter::begin() so that if it fails, it can still be used on other paint devices without causing an assert. Autotest included. I also made begin() fail on images with the QImage::Format_Indexed8 format and added warnings in the documentation since painting on such images is not supported. Reviewed-by: Trond --- src/gui/image/qimage.cpp | 3 ++ src/gui/painting/qpainter.cpp | 61 +++++++++++++++++++----------------- tests/auto/qpainter/tst_qpainter.cpp | 40 +++++++++++++++++++++++ 3 files changed, 75 insertions(+), 29 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 9048387..21ab40c 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -377,6 +377,9 @@ bool QImageData::checkForAlphaPixels() const \note If you would like to load QImage objects in a static build of Qt, refer to the \l{How To Create Qt Plugins#Static Plugins}{Plugin HowTo}. + \warning Painting on a QImage with the format + QImage::Format_Indexed8 is not supported. + \tableofcontents \section1 Reading and Writing Image Files diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 155eefe..cddad7d 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1608,9 +1608,21 @@ void QPainter::restore() \warning A paint device can only be painted by one painter at a time. + \warning Painting on a QImage with the format + QImage::Format_Indexed8 is not supported. + \sa end(), QPainter() */ +static inline void qt_cleanup_painter_state(QPainterPrivate *d) +{ + d->states.clear(); + delete d->state; + d->state = 0; + d->engine = 0; + d->device = 0; +} + bool QPainter::begin(QPaintDevice *pd) { Q_ASSERT(pd); @@ -1656,15 +1668,21 @@ bool QPainter::begin(QPaintDevice *pd) printf("QPainter::begin(), device=%p, type=%d\n", pd, pd->devType()); #endif - - d->device = pd; if (pd->devType() == QInternal::Pixmap) static_cast(pd)->detach(); else if (pd->devType() == QInternal::Image) static_cast(pd)->detach(); d->engine = pd->paintEngine(); - d->extended = d->engine && d->engine->isExtended() ? static_cast(d->engine) : 0; + + if (!d->engine) { + qWarning("QPainter::begin: Paint device returned engine == 0, type: %d", pd->devType()); + return false; + } + + d->device = pd; + + d->extended = d->engine->isExtended() ? static_cast(d->engine) : 0; if (d->emulationEngine) d->emulationEngine->real_engine = d->extended; @@ -1677,11 +1695,6 @@ bool QPainter::begin(QPaintDevice *pd) d->state->redirectionMatrix.translate(-redirectionOffset.x(), -redirectionOffset.y()); d->state->brushOrigin = QPointF(); - if (!d->engine) { - qWarning("QPainter::begin: Paint device returned engine == 0, type: %d", pd->devType()); - return false; - } - // Slip a painter state into the engine before we do any other operations if (d->extended) d->extended->setState(d->state); @@ -1700,8 +1713,7 @@ bool QPainter::begin(QPaintDevice *pd) && !paintOutsidePaintEvent && !inPaintEvent) { qWarning("QPainter::begin: Widget painting can only begin as a " "result of a paintEvent"); - d->engine = 0; - d->device = 0; + qt_cleanup_painter_state(d); return false; } @@ -1719,8 +1731,7 @@ bool QPainter::begin(QPaintDevice *pd) Q_ASSERT(pm); if (pm->isNull()) { qWarning("QPainter::begin: Cannot paint on a null pixmap"); - d->engine = 0; - d->device = 0; + qt_cleanup_painter_state(d); return false; } @@ -1736,8 +1747,12 @@ bool QPainter::begin(QPaintDevice *pd) Q_ASSERT(img); if (img->isNull()) { qWarning("QPainter::begin: Cannot paint on a null image"); - d->engine = 0; - d->device = 0; + qt_cleanup_painter_state(d); + return false; + } else if (img->format() == QImage::Format_Indexed8) { + // Painting on indexed8 images is not supported. + qWarning("QPainter::begin: Cannot paint on an image with the QImage::Format_Indexed8 format"); + qt_cleanup_painter_state(d); return false; } if (img->depth() == 1) { @@ -1760,12 +1775,8 @@ bool QPainter::begin(QPaintDevice *pd) if (d->engine->isActive()) { end(); } else { - d->states.clear(); - delete d->state; - d->state = 0; + qt_cleanup_painter_state(d); } - d->engine = 0; - d->device = 0; return false; } else { d->engine->setActive(begun); @@ -1828,10 +1839,7 @@ bool QPainter::end() if (!d->engine) { qWarning("QPainter::end: Painter not active, aborted"); - d->states.clear(); - delete d->state; - d->state = 0; - d->device = 0; + qt_cleanup_painter_state(d); return false; } @@ -1862,8 +1870,6 @@ bool QPainter::end() delete d->engine; } - d->engine = 0; - if (d->emulationEngine) { delete d->emulationEngine; d->emulationEngine = 0; @@ -1873,11 +1879,8 @@ bool QPainter::end() d->extended = 0; } - d->states.clear(); - delete d->state; - d->state = 0; + qt_cleanup_painter_state(d); - d->device = 0; return ended; } diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 9515d87..2231287 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -238,6 +238,8 @@ private slots: void taskQT4444_dontOverflowDashOffset(); + void painterBegin(); + private: void fillData(); QColor baseColor( int k, int intensity=255 ); @@ -4312,5 +4314,43 @@ void tst_QPainter::taskQT4444_dontOverflowDashOffset() QVERIFY(true); // Don't crash } +void tst_QPainter::painterBegin() +{ + QImage nullImage; + QImage indexed8Image(16, 16, QImage::Format_Indexed8); + QImage rgb32Image(16, 16, QImage::Format_RGB32); + QImage argb32Image(16, 16, QImage::Format_ARGB32_Premultiplied); + + QPainter p; + + // Painting on null image should fail. + QVERIFY(!p.begin(&nullImage)); + + // Check that the painter is not messed up by using it on another image. + QVERIFY(p.begin(&rgb32Image)); + QVERIFY(p.end()); + + // If painting on indexed8 image fails, the painter state should still be OK. + if (p.begin(&indexed8Image)) + QVERIFY(p.end()); + QVERIFY(p.begin(&rgb32Image)); + QVERIFY(p.end()); + + // Try opening a painter on the two different images. + QVERIFY(p.begin(&rgb32Image)); + QVERIFY(!p.begin(&argb32Image)); + QVERIFY(p.end()); + + // Try opening two painters on the same image. + QVERIFY(p.begin(&rgb32Image)); + QPainter q; + QVERIFY(!q.begin(&rgb32Image)); + QVERIFY(!q.end()); + QVERIFY(p.end()); + + // Try ending an inactive painter. + QVERIFY(!p.end()); +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" -- cgit v0.12 From 08554b7e8e58c685879881b17bdf65c5f4594c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 15 Oct 2009 16:57:50 +0200 Subject: Fixed tst_QPixmap test failures with GL pixmap backend. Fixes test failures in fill() and setGetMask(). Reviewed-by: Trond --- src/opengl/qpixmapdata_gl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 3a657f1..ba4663f 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -426,6 +426,10 @@ QImage QGLPixmapData::fillImage(const QColor &color) const if (pixelType() == BitmapType) { img = QImage(w, h, QImage::Format_MonoLSB); + img.setNumColors(2); + img.setColor(0, QColor(Qt::color0).rgba()); + img.setColor(1, QColor(Qt::color1).rgba()); + if (color == Qt::color1) img.fill(1); else -- cgit v0.12 From b5106b1b99a749653c58719c333411b9ce374b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 15 Oct 2009 16:42:10 +0200 Subject: Optimized QPixmap::fill for GL backend when pixmap is used as is. When QGLPixmapData is bound after a fill(), without being painted on in the mean-time, it's cheaper to directly generate a source image than to go through convertToGLFormat(), since all the pixels in the image will have the same value. Reviewed-by: Trond --- src/opengl/qgl.cpp | 46 +++++++++++++++++++++++++------------------ src/opengl/qpixmapdata_gl.cpp | 22 +++++++++++++++------ 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 1be2073..a8b136d 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1978,6 +1978,32 @@ GLuint QGLContext::bindTexture(const QString &fileName) return tx_id; } +static inline QRgb qt_gl_convertToGLFormatHelper(QRgb src_pixel, GLenum texture_format) +{ + if (texture_format == GL_BGRA) { + if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { + return ((src_pixel << 24) & 0xff000000) + | ((src_pixel >> 24) & 0x000000ff) + | ((src_pixel << 8) & 0x00ff0000) + | ((src_pixel >> 8) & 0x0000ff00); + } else { + return src_pixel; + } + } else { // GL_RGBA + if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { + return (src_pixel << 8) | ((src_pixel >> 24) & 0xff); + } else { + return ((src_pixel << 16) & 0xff0000) + | ((src_pixel >> 16) & 0xff) + | (src_pixel & 0xff00ff00); + } + } +} + +QRgb qt_gl_convertToGLFormat(QRgb src_pixel, GLenum texture_format) +{ + return qt_gl_convertToGLFormatHelper(src_pixel, texture_format); +} static void convertToGLFormatHelper(QImage &dst, const QImage &img, GLenum texture_format) { @@ -2006,25 +2032,7 @@ static void convertToGLFormatHelper(QImage &dst, const QImage &img, GLenum textu const uint *src = (const quint32 *) (srcPixels - (srcy >> 16) * sbpl); int srcx = basex; for (int x=0; x> 16]; - if (texture_format == GL_BGRA) { - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { - dest[x] = ((src_pixel << 24) & 0xff000000) - | ((src_pixel >> 24) & 0x000000ff) - | ((src_pixel << 8) & 0x00ff0000) - | ((src_pixel >> 8) & 0x0000ff00); - } else { - dest[x] = src_pixel; - } - } else { // GL_RGBA - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { - dest[x] = (src_pixel << 8) | ((src_pixel >> 24) & 0xff); - } else { - dest[x] = ((src_pixel << 16) & 0xff0000) - | ((src_pixel >> 16) & 0xff) - | (src_pixel & 0xff00ff00); - } - } + dest[x] = qt_gl_convertToGLFormatHelper(src[srcx >> 16], texture_format); srcx += ix; } dest = (quint32 *)(((uchar *) dest) + dbpl); diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index ba4663f..83ebece 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -568,6 +568,7 @@ QPaintEngine* QGLPixmapData::paintEngine() const return m_source.paintEngine(); } +extern QRgb qt_gl_convertToGLFormat(QRgb src_pixel, GLenum texture_format); // If copyBack is true, bind will copy the contents of the render // FBO to the texture (which is not bound to the texture, as it's @@ -577,17 +578,26 @@ GLuint QGLPixmapData::bind(bool copyBack) const if (m_renderFbo && copyBack) { copyBackFromRenderFbo(true); } else { - if (m_hasFillColor) { - m_dirty = true; - m_source = QImage(w, h, QImage::Format_ARGB32_Premultiplied); - m_source.fill(PREMUL(m_fillColor.rgba())); - m_hasFillColor = false; - } ensureCreated(); } GLuint id = m_texture.id; glBindTexture(GL_TEXTURE_2D, id); + + if (m_hasFillColor) { + if (!useFramebufferObjects()) { + m_source = QImage(w, h, QImage::Format_ARGB32_Premultiplied); + m_source.fill(PREMUL(m_fillColor.rgba())); + } + + m_hasFillColor = false; + + GLenum format = qt_gl_preferredTextureFormat(); + QImage tx(w, h, QImage::Format_ARGB32_Premultiplied); + tx.fill(qt_gl_convertToGLFormat(m_fillColor.rgba(), format)); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, format, GL_UNSIGNED_BYTE, tx.bits()); + } + return id; } -- cgit v0.12 From 2849e21a59a93714defc023a09b185f93cf1e712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 16 Oct 2009 13:04:13 +0200 Subject: Fixed a crash in the tst_qgl test. QGLFramebuffer::isBound() would crash if it was called when there wasn't a current context bound. Reviewed-by: Kim --- src/opengl/qglframebufferobject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp index 9674cfb..4fb8629 100644 --- a/src/opengl/qglframebufferobject.cpp +++ b/src/opengl/qglframebufferobject.cpp @@ -1204,7 +1204,8 @@ QGLFramebufferObject::Attachment QGLFramebufferObject::attachment() const bool QGLFramebufferObject::isBound() const { Q_D(const QGLFramebufferObject); - return QGLContext::currentContext()->d_ptr->current_fbo == d->fbo(); + const QGLContext *current = QGLContext::currentContext(); + return current ? current->d_ptr->current_fbo == d->fbo() : false; } /*! -- cgit v0.12 From 0dd237d05a865c51ad59f4e9f61b194659e32814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 16 Oct 2009 16:29:11 +0200 Subject: Fixed a crash in tst_qpainter on SPARC w/gcc. This test works with the native Sun compiler for some reason, and the problem is an unaligned read of 16 bits, which is a problem on several other architectures. Reviewed-by: Kim --- src/gui/painting/qblendfunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index 89adaf5..f8dd424 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -374,9 +374,9 @@ template void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl, const uchar *src = srcPixels + y * sbpl; const uchar *srcEnd = src + srcOffset; while (src < srcEnd) { -#if defined(QT_ARCH_ARM) || defined(QT_ARCH_POWERPC) || defined(QT_ARCH_SH) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_WINDOWSCE) && !defined(_X86_)) +#if defined(QT_ARCH_ARM) || defined(QT_ARCH_POWERPC) || defined(QT_ARCH_SH) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_WINDOWSCE) && !defined(_X86_)) || (defined(QT_ARCH_SPARC) && defined(Q_CC_GNU)) // non-16-bit aligned memory access is not possible on PowerPC, - // ARM Date: Fri, 16 Oct 2009 17:26:19 +0200 Subject: This reverts commit 99739f35bf700a2bff707da99f5043cd7c12aed5. Don't create native windows when setting the window title, delay the creation until the native window is needed. If a user really needs the window to be created, he/she can call winId() on the widget or set Qt::AA_ImmediateWidgetCreation. Reviewed-by: Bradley T. Hughes --- src/gui/kernel/qwidget.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 56602f7..a071ba6 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1354,6 +1354,8 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow) d->setWindowIcon_sys(true); if (isWindow() && !d->topData()->iconText.isEmpty()) d->setWindowIconText_helper(d->topData()->iconText); + if (isWindow() && !d->topData()->caption.isEmpty()) + d->setWindowTitle_helper(d->topData()->caption); if (windowType() != Qt::Desktop) { d->updateSystemBackground(); @@ -5664,9 +5666,8 @@ QString qt_setWindowTitle_helperHelper(const QString &title, const QWidget *widg void QWidgetPrivate::setWindowTitle_helper(const QString &title) { Q_Q(QWidget); - if (!q->testAttribute(Qt::WA_WState_Created)) - createWinId(); - setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q)); + if (q->testAttribute(Qt::WA_WState_Created)) + setWindowTitle_sys(qt_setWindowTitle_helperHelper(title, q)); } void QWidgetPrivate::setWindowIconText_helper(const QString &title) -- cgit v0.12 From 4a0e3170c779a6a37954c3dfcfd0b9f0ce144701 Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Fri, 16 Oct 2009 17:53:10 +0200 Subject: Fixed crash in the Boxes demo when using -graphicssystem opengl. QGLWindowSurface::flush() assumed that updateGeometry() had been called, but in some cases it hadn't. It would therefore dereference a null pointer and crash. This has been fixed by returning from flush() if updateGeometry() has not been called. This fixes the symptom rather than the bug, so we still need to find out why it hasn't been called. Reviewed-by: Trond --- src/opengl/qwindowsurface_gl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 7f8577a..e6afed8 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -428,6 +428,12 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & return; } + //### Find out why d_ptr->geometry_updated isn't always false. + // flush() should not be called when d_ptr->geometry_updated is true. It assumes that either + // d_ptr->fbo or d_ptr->pb is allocated and has the correct size. + if (d_ptr->geometry_updated) + return; + QWidget *parent = widget->internalWinId() ? widget : widget->nativeParentWidget(); Q_ASSERT(parent); -- cgit v0.12 From c3bab81d5966c9bd3a42d9c5cbb9d8ad35a1b330 Mon Sep 17 00:00:00 2001 From: Bill King Date: Mon, 19 Oct 2009 14:45:47 +1000 Subject: ODBC: Retrieved in ascii, should be stored in ascii. For non-unicode databases, use ascii. Task-number: QTBUG-3736 --- src/sql/drivers/odbc/qsql_odbc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index ff9458b..e686873 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -1455,7 +1455,7 @@ bool QODBCResult::exec() else #endif { - QByteArray str = val.toString().toUtf8(); + QByteArray str = val.toString().toAscii(); if (*ind != SQL_NULL_DATA) *ind = str.length(); int strSize = str.length(); -- cgit v0.12 From e05137fe501e9536e15b1980c936af771e9518db Mon Sep 17 00:00:00 2001 From: Peter Yard Date: Mon, 19 Oct 2009 15:33:23 +1000 Subject: Additional documentation added to deployment.qdoc which lists the process and links to the original MSDN pages which describe it in full. --- doc/src/deployment/deployment.qdoc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc index f2bae23..b5b1b9c 100644 --- a/doc/src/deployment/deployment.qdoc +++ b/doc/src/deployment/deployment.qdoc @@ -345,6 +345,7 @@ are many ways to solve this: \list + \o You can install the Qt libraries in one of the system library paths (e.g. \c /usr/lib on most systems). @@ -804,6 +805,30 @@ compiler version against the same C runtime version. This prevents deploying errors caused by different versions of the C runtime libraries. + \section2 Visual Studio 2008 And Manual Installs + + As well as the above details for VS 2005 and onwards, Visual Studio 2008 + applications may have problems when deploying manually, say to a USB + stick. + + The recommended procedure is to configure Qt with the \c -plugin-manifests + option using the 'configure' tool. Then follow the \l {http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx}{guidelines} + for manually deploying private assemblies. + + In brief the steps are + + \list 1 + + \o create a folder structure on the development computer that will match the target USB stick directory structure, for example '\\app' and for your dlls, '\\app\\lib'. + + \o on the development computer, from the appropriate 'redist' folder copy over Microsoft.VC80.CRT and Microsoft.VC80.MFC to the directories '\\app' and '\\app\\lib' on the development PC. + + \o xcopy the \\app folder to the target USB stick. + \endlist + + Your application should now run. Also be aware that even with a service + pack installed the Windows DLLs that are linked to will be the defaults. See + the information on \l {http://msdn.microsoft.com/en-us/library/cc664727.aspx}{how to select the appropriate target DLLs}. \section1 Application Dependencies -- cgit v0.12 From 6116573511d8f3ab885ceff34f6d5a2d2d12b67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 19 Oct 2009 08:23:48 +0200 Subject: Remove debug output. --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index 323224c..485c71c 100755 --- a/configure +++ b/configure @@ -2873,7 +2873,6 @@ fi # pass on $CFG_SDK to the configure tests. if [ '!' -z "$CFG_SDK" ]; then MAC_CONFIG_TEST_COMMANDLINE="-sdk $CFG_SDK" - echo "tests command line: $MAC_CONFIG_TEST_COMMANDLINE" fi # find the default framework value -- cgit v0.12 From 511adbc60fdd7fbfe95f2a1cf9cf2d31aba9b7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 19 Oct 2009 10:23:30 +0300 Subject: Fix autotest case for QSoftkeyManager QSoftkeyManager's test case checkSoftkeyEnableStates was broken with recent fix to QSoftkeyManager where softkey action is no longer initialized to the initial state of action widget. Instead, softkey action checks the state of action widget when handling the action. Autotest case is now fixed to handle the change. Task-number: N/A Reviewed-by: Miikka Heikkinen --- tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp | 56 ++++++++++++++++++---- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp index 832605e..6efa85b 100644 --- a/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp +++ b/tests/auto/qsoftkeymanager/tst_qsoftkeymanager.cpp @@ -43,9 +43,15 @@ #include "qevent.h" #include "qdialog.h" +#include "qpushbutton.h" #include "qdialogbuttonbox.h" #include "private/qsoftkeymanager_p.h" +#ifdef Q_WS_S60 +static const int s60CommandStart = 6000; +#endif + + class tst_QSoftKeyManager : public QObject { Q_OBJECT @@ -171,22 +177,52 @@ void tst_QSoftKeyManager::handleCommand() } /* - This tests that softkey enable state follows the state of widget that owns the action - to which the softkey is related to. + This tests that the state of a widget that owns softkey action is respected when handling the softkey + command. */ void tst_QSoftKeyManager::checkSoftkeyEnableStates() { - QWidget w1, w2; - w1.setEnabled(false); - w2.setEnabled(true); + QDialog w; + QDialogButtonBox *buttons = new QDialogButtonBox( + QDialogButtonBox::RestoreDefaults | QDialogButtonBox::Help, + Qt::Horizontal, + &w); + QPushButton *pBDefaults = buttons->button(QDialogButtonBox::RestoreDefaults); + QPushButton *pBHelp = buttons->button(QDialogButtonBox::Help); + pBHelp->setEnabled(false); + w.show(); + QApplication::processEvents(); - QAction *disabledAction = QSoftKeyManager::createAction(QSoftKeyManager::OkSoftKey, &w1); - QAction *enabledAction = QSoftKeyManager::createAction(QSoftKeyManager::OkSoftKey, &w2); + QSignalSpy spy0(w.actions()[0], SIGNAL(triggered())); //restore defaults action + QSignalSpy spy1(w.actions()[1], SIGNAL(triggered())); //disabled help action - QVERIFY(disabledAction->isEnabled()==false); - QVERIFY(enabledAction->isEnabled()==true); + //Verify that enabled button gets all the action trigger signals and + //disabled button gets none. + for (int i = 0; i < 10; i++) { + //simulate "Restore Defaults" softkey press + qApp->symbianHandleCommand(s60CommandStart); + //simulate "help" softkey press + qApp->symbianHandleCommand(s60CommandStart + 1); + } + QApplication::processEvents(); + QCOMPARE(spy0.count(), 10); + QCOMPARE(spy1.count(), 0); + spy0.clear(); + spy1.clear(); + + for (int i = 0; i < 10; i++) { + //simulate "Restore Defaults" softkey press + qApp->symbianHandleCommand(s60CommandStart); + //simulate "help" softkey press + qApp->symbianHandleCommand(s60CommandStart + 1); + //switch enabled button to disabled and vice versa + pBHelp->setEnabled(!pBHelp->isEnabled()); + pBDefaults->setEnabled(!pBDefaults->isEnabled()); + } + QApplication::processEvents(); + QCOMPARE(spy0.count(), 5); + QCOMPARE(spy1.count(), 5); } - QTEST_MAIN(tst_QSoftKeyManager) #include "tst_qsoftkeymanager.moc" -- cgit v0.12 From 10a437f02966ad0963b66585cc2ff6210b995f18 Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 15 Oct 2009 16:18:19 +0200 Subject: Made Mac Carbon use the input method hints when deciding on IM. New behavior is to turn them off when inputting numbers or hidden text, which is the way it was in Qt 4.5. Task: QT-1938 Task: QT-2257 RevBy: Prasanth Ullattil --- src/gui/inputmethod/qmacinputcontext_mac.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qmacinputcontext_mac.cpp b/src/gui/inputmethod/qmacinputcontext_mac.cpp index 116d233..994edb9 100644 --- a/src/gui/inputmethod/qmacinputcontext_mac.cpp +++ b/src/gui/inputmethod/qmacinputcontext_mac.cpp @@ -217,7 +217,11 @@ QMacInputContext::globalEventProcessor(EventHandlerCallRef, EventRef event, void case kEventClassTextInput: { handled_event = false; QWidget *widget = QApplicationPrivate::focus_widget; - if(!widget || (context && widget->inputContext() != context)) { + bool canCompose = widget && (!context || widget->inputContext() == context) + && !(widget->inputMethodHints() & Qt::ImhDigitsOnly + || widget->inputMethodHints() & Qt::ImhFormattedNumbersOnly + || widget->inputMethodHints() & Qt::ImhHiddenText); + if(!canCompose) { handled_event = false; } else if(ekind == kEventTextInputOffsetToPos) { if(!widget->testAttribute(Qt::WA_InputMethodEnabled)) { -- cgit v0.12 From 8472e256280f683f69fd5d9db5c2ed645dab6c92 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 19 Oct 2009 10:27:18 +0200 Subject: Made sure the noSocketEvents value is preserved in case of exception. Task: QT-987 RevBy: mread --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 02f77a1..b32696d 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -668,6 +668,7 @@ void QEventDispatcherSymbian::closingDown() bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags flags ) { bool handledAnyEvent = false; + bool oldNoSocketEventsValue = m_noSocketEvents; QT_TRY { Q_D(QAbstractEventDispatcher); @@ -686,7 +687,6 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla block = false; } - bool oldNoSocketEventsValue = m_noSocketEvents; if (flags & QEventLoop::ExcludeSocketNotifiers) { m_noSocketEvents = true; } else { @@ -762,14 +762,14 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla }; emit awake(); - - m_noSocketEvents = oldNoSocketEventsValue; } QT_CATCH (const std::exception& ex) { #ifndef QT_NO_EXCEPTIONS CActiveScheduler::Current()->Error(qt_symbian_exception2Error(ex)); #endif } + m_noSocketEvents = oldNoSocketEventsValue; + return handledAnyEvent; } -- cgit v0.12 From 2e575432f1e1fd90e1f973791f2ee8df33b6e45e Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 19 Oct 2009 10:42:42 +0200 Subject: QSslSocket: Also handle setSocketOption Handle setSocketOption and forward it to the plainSocket that QSslSocket is using internally. Reviewed-by: Thiago --- src/network/socket/qabstractsocket.cpp | 13 +++++++++++++ src/network/ssl/qsslsocket.cpp | 16 ++++++++++++++++ src/network/ssl/qsslsocket.h | 4 ++++ 3 files changed, 33 insertions(+) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 86ccef2..9fb0b47 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1578,6 +1578,13 @@ bool QAbstractSocket::setSocketDescriptor(int socketDescriptor, SocketState sock */ void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value) { +#ifndef QT_NO_OPENSSL + if (QSslSocket *sslSocket = qobject_cast(this)) { + sslSocket->setSocketOption(option, value); + return; + } +#endif + if (!d_func()->socketEngine) return; @@ -1600,6 +1607,12 @@ void QAbstractSocket::setSocketOption(QAbstractSocket::SocketOption option, cons */ QVariant QAbstractSocket::socketOption(QAbstractSocket::SocketOption option) { +#ifndef QT_NO_OPENSSL + if (QSslSocket *sslSocket = qobject_cast(this)) { + return sslSocket->socketOption(option); + } +#endif + if (!d_func()->socketEngine) return QVariant(); diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index a5732fb..ad766c1 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -467,6 +467,22 @@ bool QSslSocket::setSocketDescriptor(int socketDescriptor, SocketState state, Op return retVal; } +void QSslSocket::setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value) +{ + Q_D(QSslSocket); + if (d->plainSocket) + d->plainSocket->setSocketOption(option, value); +} + +QVariant QSslSocket::socketOption(QAbstractSocket::SocketOption option) +{ + Q_D(QSslSocket); + if (d->plainSocket) + return d->plainSocket->socketOption(option); + else + return QVariant(); +} + /*! Returns the current mode for the socket; either UnencryptedMode, where QSslSocket behaves identially to QTcpSocket, or one of SslClientMode or diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index a41e600..adb206c 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -90,6 +90,10 @@ public: bool setSocketDescriptor(int socketDescriptor, SocketState state = ConnectedState, OpenMode openMode = ReadWrite); + // ### Qt 5: Make virtual + void setSocketOption(QAbstractSocket::SocketOption option, const QVariant &value); + QVariant socketOption(QAbstractSocket::SocketOption option); + SslMode mode() const; bool isEncrypted() const; -- cgit v0.12 From f9e46cdb2d9a42d52f90fe50a53a76c03065b9ce Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 19 Oct 2009 13:24:21 +0200 Subject: Fix crash in QPixmapCache. QCache destruction accesses the key array that was freed in the QPixmapCache destruction, so better clear() before deleting that key. Merge-request: 1820 Reviewed-by: Alexis Menard --- src/gui/image/qpixmapcache.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index f12d397..b0b7d72 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -221,6 +221,7 @@ QPMCache::QPMCache() } QPMCache::~QPMCache() { + clear(); free(keyArray); } -- cgit v0.12 From 7a647e8c9efbbd46184bc4714159c82ae26be958 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowacki Date: Mon, 19 Oct 2009 12:40:38 +0200 Subject: Regression fix. Fix the hasUncaughtException() flag in debugger's event. The QScriptEngine::hasUncaughtException() flag should be set to true if returning from a JS function was caused by an exception. According to documentation, the flag had to be accessible from the QScriptEngineAgent::functionExit event. New autotest was added. Reviewed-by: Kent Hansen --- src/script/api/qscriptengine.cpp | 12 +++++-- src/script/api/qscriptengine_p.h | 5 +++ src/script/api/qscriptengineagent.cpp | 2 ++ src/script/api/qscriptvalue.h | 3 ++ .../qscriptengineagent/tst_qscriptengineagent.cpp | 38 ++++++++++++++++++++++ 5 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index b1f36be..360036a 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -2164,7 +2164,7 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file if (debugger) debugger->evaluateStart(sourceId); - exec->clearException(); + clearExceptions(); JSC::DynamicGlobalObjectScope dynamicGlobalObjectScope(exec, exec->scopeChain()->globalObject()); JSC::EvalExecutable executable(exec, source); @@ -2381,7 +2381,7 @@ bool QScriptEngine::hasUncaughtException() const { Q_D(const QScriptEngine); JSC::ExecState* exec = d->globalExec(); - return exec->hadException(); + return exec->hadException() || d->currentException().isValid(); } /*! @@ -2398,8 +2398,13 @@ bool QScriptEngine::hasUncaughtException() const QScriptValue QScriptEngine::uncaughtException() const { Q_D(const QScriptEngine); + QScriptValue result; JSC::ExecState* exec = d->globalExec(); - return const_cast(d)->scriptValueFromJSCValue(exec->exception()); + if (exec->hadException()) + result = const_cast(d)->scriptValueFromJSCValue(exec->exception()); + else + result = d->currentException(); + return result; } /*! @@ -2452,6 +2457,7 @@ void QScriptEngine::clearExceptions() Q_D(QScriptEngine); JSC::ExecState* exec = d->currentFrame; exec->clearException(); + d->clearCurrentException(); } /*! diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index f1fc135..cde116d 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -183,6 +183,10 @@ public: void agentDeleted(QScriptEngineAgent *agent); + void setCurrentException(QScriptValue exception) { m_currentException = exception; } + QScriptValue currentException() const { return m_currentException; } + void clearCurrentException() { m_currentException.d_ptr.reset(); } + #ifndef QT_NO_QOBJECT JSC::JSValue newQObject(QObject *object, QScriptEngine::ValueOwnership ownership = QScriptEngine::QtOwnership, @@ -263,6 +267,7 @@ public: QSet extensionsBeingImported; QHash loadedScripts; + QScriptValue m_currentException; #ifndef QT_NO_QOBJECT QHash m_qobjectData; diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp index bc2eea2..0ca7ecc 100644 --- a/src/script/api/qscriptengineagent.cpp +++ b/src/script/api/qscriptengineagent.cpp @@ -156,6 +156,7 @@ void QScriptEngineAgentPrivate::exceptionThrow(const JSC::DebuggerCallFrame& fra QScriptValue value(engine->scriptValueFromJSCValue(frame.exception())); q_ptr->exceptionThrow(sourceID, value, hasHandler); engine->currentFrame = oldFrame; + engine->setCurrentException(value); }; void QScriptEngineAgentPrivate::exceptionCatch(const JSC::DebuggerCallFrame& frame, intptr_t sourceID) @@ -165,6 +166,7 @@ void QScriptEngineAgentPrivate::exceptionCatch(const JSC::DebuggerCallFrame& fra QScriptValue value(engine->scriptValueFromJSCValue(frame.exception())); q_ptr->exceptionCatch(sourceID, value); engine->currentFrame = oldFrame; + engine->clearCurrentException(); } void QScriptEngineAgentPrivate::atStatement(const JSC::DebuggerCallFrame& frame, intptr_t sourceID, int lineno, int column) diff --git a/src/script/api/qscriptvalue.h b/src/script/api/qscriptvalue.h index 32f7a43..aba3327 100644 --- a/src/script/api/qscriptvalue.h +++ b/src/script/api/qscriptvalue.h @@ -70,6 +70,7 @@ typedef QList QScriptValueList; typedef double qsreal; class QScriptValuePrivate; +class QScriptEnginePrivate; struct QScriptValuePrivatePointerDeleter; class Q_SCRIPT_EXPORT QScriptValue { @@ -226,6 +227,8 @@ private: QExplicitlySharedDataPointer d_ptr; Q_DECLARE_PRIVATE(QScriptValue) + + friend class QScriptEnginePrivate; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QScriptValue::ResolveFlags) diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp index 283e489..82c8ccd 100644 --- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp +++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp @@ -109,6 +109,7 @@ private slots: void extension_invoctaion(); void extension(); void isEvaluatingInExtension(); + void hasUncaughtException(); private: double m_testProperty; @@ -2182,5 +2183,42 @@ void tst_QScriptEngineAgent::isEvaluatingInExtension() QVERIFY(spy->wasEvaluating); } +class NewSpy :public QScriptEngineAgent +{ + bool m_result; +public: + NewSpy(QScriptEngine* eng) : QScriptEngineAgent(eng), m_result(false) {} + void functionExit (qint64, const QScriptValue &scriptValue) + { + if (engine()->hasUncaughtException()) m_result = true; + } + + bool isPass() { return m_result; } + void reset() { m_result = false; } +}; + +void tst_QScriptEngineAgent::hasUncaughtException() +{ + QScriptEngine eng; + NewSpy* spy = new NewSpy(&eng); + eng.setAgent(spy); + QScriptValue scriptValue; + + // Check unhandled exception. + eng.evaluate("function init () {Unknown.doSth ();}"); + scriptValue = QScriptValue(eng.globalObject().property("init")).call(); + QVERIFY(eng.hasUncaughtException()); + QVERIFY2(spy->isPass(), "At least one of a functionExit event should set hasUncaughtException flag."); + spy->reset(); + + // Check catched exception. + eng.evaluate("function innerFoo() { throw new Error('ciao') }"); + eng.evaluate("function foo() {try { innerFoo() } catch (e) {} }"); + scriptValue = QScriptValue(eng.globalObject().property("foo")).call(); + QVERIFY(!eng.hasUncaughtException()); + QVERIFY2(spy->isPass(), "At least one of a functionExit event should set hasUncaughtException flag."); +} + + QTEST_MAIN(tst_QScriptEngineAgent) #include "tst_qscriptengineagent.moc" -- cgit v0.12 From f16fc0150fce1d78cc71c27c163baf45e8953aca Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 19 Oct 2009 13:50:24 +0200 Subject: qdoc3: Added the \qmlattachedproperty command. It works just like the \qmlproperty command, except that it puts the properties in a different section for attached properties. --- tools/qdoc3/cppcodemarker.cpp | 19 +++++++++++++++++-- tools/qdoc3/cppcodeparser.cpp | 23 +++++++++++++++++------ tools/qdoc3/htmlgenerator.cpp | 6 +++--- tools/qdoc3/node.cpp | 14 ++++++++++---- tools/qdoc3/node.h | 11 +++++++++-- 5 files changed, 56 insertions(+), 17 deletions(-) diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index ed3d150..36293f8 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -1112,6 +1112,10 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, "QML Properties", "property", "properties"); + FastSection qmlattachedproperties(qmlClassNode, + "QML Attached Properties", + "property", + "properties"); FastSection qmlsignals(qmlClassNode, "QML Signals", "signal", @@ -1128,7 +1132,11 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, NodeList::ConstIterator p = qpgn->childNodes().begin(); while (p != qpgn->childNodes().end()) { if ((*p)->type() == Node::QmlProperty) { - insert(qmlproperties,*p,style,Okay); + const QmlPropertyNode* pn = static_cast(*p); + if (pn->isAttached()) + insert(qmlattachedproperties,*p,style,Okay); + else + insert(qmlproperties,*p,style,Okay); } ++p; } @@ -1142,17 +1150,23 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, ++c; } append(sections,qmlproperties); + append(sections,qmlattachedproperties); append(sections,qmlsignals); append(sections,qmlmethods); } else if (style == Detailed) { FastSection qmlproperties(qmlClassNode,"QML Property Documentation"); + FastSection qmlattachedproperties(qmlClassNode,"QML Attached Property Documentation"); FastSection qmlsignals(qmlClassNode,"QML Signal Documentation"); FastSection qmlmethods(qmlClassNode,"QML Method Documentation"); NodeList::ConstIterator c = qmlClassNode->childNodes().begin(); while (c != qmlClassNode->childNodes().end()) { if ((*c)->subType() == Node::QmlPropertyGroup) { - insert(qmlproperties,*c,style,Okay); + const QmlPropGroupNode* pgn = static_cast(*c); + if (pgn->isAttached()) + insert(qmlattachedproperties,*c,style,Okay); + else + insert(qmlproperties,*c,style,Okay); } else if ((*c)->type() == Node::QmlSignal) { insert(qmlsignals,*c,style,Okay); @@ -1163,6 +1177,7 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, ++c; } append(sections,qmlproperties); + append(sections,qmlattachedproperties); append(sections,qmlsignals); append(sections,qmlmethods); } diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index d93e24c..ad43b2b 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -88,6 +88,7 @@ QT_BEGIN_NAMESPACE #ifdef QDOC_QML #define COMMAND_QMLCLASS Doc::alias("qmlclass") #define COMMAND_QMLPROPERTY Doc::alias("qmlproperty") +#define COMMAND_QMLATTACHEDPROPERTY Doc::alias("qmlattachedproperty") #define COMMAND_QMLINHERITS Doc::alias("inherits") #define COMMAND_QMLSIGNAL Doc::alias("qmlsignal") #define COMMAND_QMLMETHOD Doc::alias("qmlmethod") @@ -482,6 +483,7 @@ QSet CppCodeParser::topicCommands() << COMMAND_VARIABLE << COMMAND_QMLCLASS << COMMAND_QMLPROPERTY + << COMMAND_QMLATTACHEDPROPERTY << COMMAND_QMLSIGNAL << COMMAND_QMLMETHOD; #else @@ -759,32 +761,40 @@ bool CppCodeParser::splitQmlArg(const Doc& doc, /*! Process the topic \a command group with arguments \a args. - Currently, this function is called only for \e{qmlproperty}. + Currently, this function is called only for \e{qmlproperty} + and \e{qmlattachedproperty}. */ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, const QString& command, const QStringList& args) { QmlPropGroupNode* qmlPropGroup = 0; - if (command == COMMAND_QMLPROPERTY) { + if ((command == COMMAND_QMLPROPERTY) || + (command == COMMAND_QMLATTACHEDPROPERTY)) { QString type; QString element; QString property; + bool attached = (command == COMMAND_QMLATTACHEDPROPERTY); QStringList::ConstIterator arg = args.begin(); if (splitQmlPropertyArg(doc,(*arg),type,element,property)) { Node* n = tre->findNode(QStringList(element),Node::Fake); if (n && n->subType() == Node::QmlClass) { QmlClassNode* qmlClass = static_cast(n); if (qmlClass) - qmlPropGroup = new QmlPropGroupNode(qmlClass,property); + qmlPropGroup = new QmlPropGroupNode(qmlClass, + property, + attached); } } if (qmlPropGroup) { - new QmlPropertyNode(qmlPropGroup,property,type); + new QmlPropertyNode(qmlPropGroup,property,type,attached); ++arg; while (arg != args.end()) { if (splitQmlPropertyArg(doc,(*arg),type,element,property)) { - new QmlPropertyNode(qmlPropGroup,property,type); + new QmlPropertyNode(qmlPropGroup, + property, + type, + attached); } ++arg; } @@ -1969,7 +1979,8 @@ bool CppCodeParser::matchDocsAndStuff() There is a topic command. Process it. */ #ifdef QDOC_QML - if (topic == COMMAND_QMLPROPERTY) { + if ((topic == COMMAND_QMLPROPERTY) || + (topic == COMMAND_QMLATTACHEDPROPERTY)) { Doc nodeDoc = doc; Node *node = processTopicCommandGroup(nodeDoc,topic,args); if (node != 0) { diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index c02dc2e..18c7916 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1240,7 +1240,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, generateHeader(title, inner, marker, true); generateTitle(title, subtitleText, SmallSubTitle, inner, marker); -#ifdef QDOC_QML +#ifdef QDOC_QML if (classe && !classe->qmlElement().isEmpty()) { generateInstantiatedBy(classe,marker); } @@ -3468,12 +3468,12 @@ QString HtmlGenerator::refForNode(const Node *node) } break; case Node::Property: -#ifdef QDOC_QML +#ifdef QDOC_QML case Node::QmlProperty: #endif ref = node->name() + "-prop"; break; -#ifdef QDOC_QML +#ifdef QDOC_QML case Node::QmlSignal: ref = node->name() + "-signal"; break; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 558808f..49f2cc9 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -1158,8 +1158,12 @@ QString QmlClassNode::fileBase() const Constructor for the Qml property group node. \a parent is always a QmlClassNode. */ -QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name) - : FakeNode(parent, name, QmlPropertyGroup), isdefault(false) +QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, + const QString& name, + bool attached) + : FakeNode(parent, name, QmlPropertyGroup), + isdefault(false), + att(attached) { // nothing. } @@ -1169,11 +1173,13 @@ QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name) */ QmlPropertyNode::QmlPropertyNode(QmlPropGroupNode *parent, const QString& name, - const QString& type) + const QString& type, + bool attached) : LeafNode(QmlProperty, parent, name), dt(type), sto(Trool_Default), - des(Trool_Default) + des(Trool_Default), + att(attached) { // nothing. } diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index f933270..fed4ea1 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -369,15 +369,19 @@ class QmlClassNode : public FakeNode class QmlPropGroupNode : public FakeNode { public: - QmlPropGroupNode(QmlClassNode* parent, const QString& name); + QmlPropGroupNode(QmlClassNode* parent, + const QString& name, + bool attached); virtual ~QmlPropGroupNode() { } const QString& element() const { return name(); } void setDefault() { isdefault = true; } bool isDefault() const { return isdefault; } + bool isAttached() const { return att; } private: bool isdefault; + bool att; }; class QmlPropertyNode : public LeafNode @@ -385,7 +389,8 @@ class QmlPropertyNode : public LeafNode public: QmlPropertyNode(QmlPropGroupNode* parent, const QString& name, - const QString& type); + const QString& type, + bool attached); virtual ~QmlPropertyNode() { } void setDataType(const QString& dataType) { dt = dataType; } @@ -396,6 +401,7 @@ class QmlPropertyNode : public LeafNode QString qualifiedDataType() const { return dt; } bool isStored() const { return fromTrool(sto,true); } bool isDesignable() const { return fromTrool(des,false); } + bool isAttached() const { return att; } const QString& element() const { return parent()->name(); } @@ -408,6 +414,7 @@ class QmlPropertyNode : public LeafNode QString dt; Trool sto; Trool des; + bool att; }; class QmlSignalNode : public LeafNode -- cgit v0.12 From 226d67e9077b908a128521a6bb763cf412fbe87e Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 19 Oct 2009 08:30:48 +0200 Subject: Fixed bad glyph rendering under cocoa The positioning is still wrong, but now it at least the glyphs are ok Reviewed-by: msorvig --- src/gui/painting/qtextureglyphcache.cpp | 7 ++++ src/gui/text/qfontengine_mac.mm | 62 ++++++++++++++++++++++++--------- src/gui/text/qfontengine_p.h | 3 +- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 25b6aba..9e5707d 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -230,7 +230,14 @@ void QImageTextureGlyphCache::createTextureData(int width, int height) int QImageTextureGlyphCache::glyphMargin() const { #ifdef Q_WS_MAC + +#ifdef QT_MAC_USE_COCOA + // For cocoa the margin is built into the glyph it seems.. + return 0; +#else return 2; +#endif + #else return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0; #endif diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm index 758d8af..d11083f 100644 --- a/src/gui/text/qfontengine_mac.mm +++ b/src/gui/text/qfontengine_mac.mm @@ -119,6 +119,28 @@ OSStatus QMacFontPath::closePath(void *data) } + +void qmacfontengine_gamma_correct(QImage *image) +{ + extern uchar qt_pow_rgb_gamma[256]; + + // gamma correct the pixels back to linear color space... + int h = image->height(); + int w = image->width(); + + for (int y=0; yscanLine(y); + for (int x=0; x= MAC_OS_X_VERSION_10_5 QCoreTextFontEngineMulti::QCoreTextFontEngineMulti(const ATSFontFamilyRef &, const ATSFontRef &atsFontRef, const QFontDef &fontDef, bool kerning) : QFontEngineMulti(0) @@ -534,7 +556,7 @@ void QCoreTextFontEngine::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *position } } -QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph) +QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, int margin, bool aa) { const glyph_metrics_t br = boundingBox(glyph); QImage im(qRound(br.width)+2, qRound(br.height)+2, QImage::Format_RGB32); @@ -549,9 +571,10 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph) 8, im.bytesPerLine(), colorspace, cgflags); CGContextSetFontSize(ctx, fontDef.pixelSize); - CGContextSetShouldAntialias(ctx, fontDef.pointSize > qt_antialiasing_threshold - && !(fontDef.styleStrategy & QFont::NoAntialias)); - CGContextSetShouldSmoothFonts(ctx, false); + CGContextSetShouldAntialias(ctx, aa || + (fontDef.pointSize > qt_antialiasing_threshold + && !(fontDef.styleStrategy & QFont::NoAntialias))); + CGContextSetShouldSmoothFonts(ctx, aa); CGAffineTransform oldTextMatrix = CGContextGetTextMatrix(ctx); CGAffineTransform cgMatrix = CGAffineTransformMake(1, 0, 0, 1, 0, 0); @@ -586,6 +609,13 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph) CGContextRelease(ctx); + return im; +} + +QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph) +{ + QImage im = imageForGlyph(glyph, 0, false); + QImage indexed(im.width(), im.height(), QImage::Format_Indexed8); QVector colors(256); for (int i=0; i<256; ++i) @@ -605,6 +635,16 @@ QImage QCoreTextFontEngine::alphaMapForGlyph(glyph_t glyph) return indexed; } +QImage QCoreTextFontEngine::alphaRGBMapForGlyph(glyph_t glyph, int margin, const QTransform &x) +{ + if (x.type() >= QTransform::TxScale) + return QFontEngine::alphaRGBMapForGlyph(glyph, margin, x); + + QImage im = imageForGlyph(glyph, margin, true); + qmacfontengine_gamma_correct(&im); + return im; +} + void QCoreTextFontEngine::recalcAdvances(int numGlyphs, QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const { Q_ASSERT(false); @@ -1505,19 +1545,7 @@ QImage QFontEngineMac::alphaRGBMapForGlyph(glyph_t glyph, int margin, const QTra im = im.transformed(t); } - extern uchar qt_pow_rgb_gamma[256]; - - // gamma correct the pixels back to linear color space... - for (int y=0; y Date: Mon, 19 Oct 2009 13:57:15 +0200 Subject: QTestLib: do not assert if file is not given in logging function that assert was triggered when running a test with "-vs" to show all the signals emitted. Reviewed-by: Andy Shaw --- src/testlib/qtestlog.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index d96755a..5b78976 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -319,7 +319,6 @@ void QTestLog::info(const char *msg, const char *file, int line) { QTEST_ASSERT(QTest::testLogger); QTEST_ASSERT(msg); - QTEST_ASSERT(file); QTest::testLogger->addMessage(QAbstractTestLogger::Info, msg, file, line); } -- cgit v0.12 From 09df1c7c0ebb944f2581779d2e029c16014ddec1 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 19 Oct 2009 07:23:20 +0200 Subject: setcepaths: add support for wincewm65professional-msvc200? mkspecs Reviewed-by: mauricek --- bin/setcepaths.bat | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/setcepaths.bat b/bin/setcepaths.bat index 15d8ff8..914e594 100755 --- a/bin/setcepaths.bat +++ b/bin/setcepaths.bat @@ -79,6 +79,11 @@ checksdk.exe -sdk "Windows Mobile 6 Professional SDK (ARMV4I)" -script tmp_creat tmp_created_script_setup.bat del tmp_created_script_setup.bat echo Windows Mobile 6 Professional selected, environment is set up +) ELSE IF "%1" EQU "wincewm65professional-msvc2005" ( +checksdk.exe -sdk "Windows Mobile 6 Professional SDK (ARMV4I)" -script tmp_created_script_setup.bat 1>NUL +tmp_created_script_setup.bat +del tmp_created_script_setup.bat +echo Windows Mobile 6 Professional selected, environment is set up ) ELSE IF "%1" EQU "wincewm60standard-msvc2005" ( checksdk.exe -sdk "Windows Mobile 6 Standard SDK (ARMV4I)" -script tmp_created_script_setup.bat 1>NUL tmp_created_script_setup.bat @@ -124,6 +129,11 @@ checksdk.exe -sdk "Windows Mobile 6 Professional SDK (ARMV4I)" -script tmp_creat tmp_created_script_setup.bat del tmp_created_script_setup.bat echo Windows Mobile 6 Professional selected, environment is set up +) ELSE IF "%1" EQU "wincewm65professional-msvc2008" ( +checksdk.exe -sdk "Windows Mobile 6 Professional SDK (ARMV4I)" -script tmp_created_script_setup.bat 1>NUL +tmp_created_script_setup.bat +del tmp_created_script_setup.bat +echo Windows Mobile 6 Professional selected, environment is set up ) ELSE IF "%1" EQU "wincewm60standard-msvc2008" ( checksdk.exe -sdk "Windows Mobile 6 Standard SDK (ARMV4I)" -script tmp_created_script_setup.bat 1>NUL tmp_created_script_setup.bat -- cgit v0.12 From 5c2ed0f727aa300f70d1a50ce74ad1f0e7649dc1 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 19 Oct 2009 15:42:36 +0300 Subject: Fixed QWidget::raise in Symbian If toplevel window is raised, the whole application is now raised to foreground. Task-number: QT-2162 Reviewed-by: axis --- src/gui/kernel/qwidget_s60.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 8ce5001..abf5ba5 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -550,8 +550,13 @@ void QWidgetPrivate::raise_sys() Q_Q(QWidget); Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); - if (q->internalWinId()) + if (q->internalWinId()) { q->internalWinId()->DrawableWindow()->SetOrdinalPosition(0); + + // If toplevel widget, raise app to foreground + if (q->isWindow()) + S60->wsSession().SetWindowGroupOrdinalPosition(S60->windowGroup().Identifier(), 0); + } } void QWidgetPrivate::lower_sys() -- cgit v0.12 From 2955086c8d588e58cbfb808ee45212d5ec196b58 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 19 Oct 2009 15:46:35 +0300 Subject: Fluidlauncher now comes to foreground when child application dies. Task-number: QT-2162 Reviewed-by: axis --- demos/embedded/fluidlauncher/fluidlauncher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demos/embedded/fluidlauncher/fluidlauncher.cpp b/demos/embedded/fluidlauncher/fluidlauncher.cpp index c065bc9..5e8cc03 100644 --- a/demos/embedded/fluidlauncher/fluidlauncher.cpp +++ b/demos/embedded/fluidlauncher/fluidlauncher.cpp @@ -265,6 +265,10 @@ void FluidLauncher::demoFinished() { setCurrentWidget(pictureFlowWidget); inputTimer->start(); + + // Bring the Fluidlauncher to the foreground to allow selecting another demo + raise(); + activateWindow(); } void FluidLauncher::changeEvent(QEvent* event) -- cgit v0.12 From dbf8da3f2e56c13a3edf0cd89a3a8596df298e29 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 19 Oct 2009 14:50:49 +0200 Subject: Fixed the build for people who only have emulator binaries installed RevBy: mread --- mkspecs/features/symbian/stl.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/symbian/stl.prf b/mkspecs/features/symbian/stl.prf index 8892d2a..e21ee5c 100644 --- a/mkspecs/features/symbian/stl.prf +++ b/mkspecs/features/symbian/stl.prf @@ -15,7 +15,7 @@ INCLUDEPATH += $$OS_LAYER_STDCPP_SYSTEMINCLUDE INCLUDEPATH -= $$[QT_INSTALL_PREFIX]/mkspecs/common/symbian/stl-off # libstdcppv5 is preferred over libstdcpp as it has/uses the throwing version of operator new -exists($${EPOCROOT}epoc32/release/armv5/urel/libstdcppv5.dll ) { +exists($${EPOCROOT}epoc32/release/armv5/urel/libstdcppv5.dll)|exists($${EPOCROOT}epoc32/release/winscw/udeb/libstdcppv5.dll) { LIBS *= -llibstdcppv5.dll # STDCPP turns on standard C++ new behaviour (ie. throwing new) -- cgit v0.12 From e903578b7c970dd730b73a7eac711d812fefc43e Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Mon, 19 Oct 2009 15:39:39 +0200 Subject: Fix doc error. Should *not* be used as a softkey. Reviewed-by: TrustMe --- src/gui/kernel/qaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index 6a6e549..5f5650f 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -276,7 +276,7 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map) This enum describes how an action should be placed in the softkey bar. Currently this enum only has an effect on the Symbian platform. - \value NoSoftKey This action should be used as a softkey + \value NoSoftKey This action should not be used as a softkey \value PositiveSoftKey This action is used to describe a softkey with a positive or non-destructive role such as Ok, Select, or Options. \value NegativeSoftKey This action is used to describe a soft ey with a negative or destructive role -- cgit v0.12 From a13cd1b97b352dc2e583b3d9b6254c7086218c3b Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Mon, 19 Oct 2009 15:29:20 +0200 Subject: Reimplementing QDate/QTime/QDateTime in Symbian native manner Some of the methods used in QDate/QTime/QDateTime have been reimplemented to use native Symbian calls. Reviewed-by: Janne Anttila --- src/corelib/tools/qdatetime.cpp | 62 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 1b559cf..54465bb 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -73,6 +73,10 @@ #include #endif +#if defined(Q_OS_SYMBIAN) +#include +#endif + QT_BEGIN_NAMESPACE enum { @@ -1128,6 +1132,12 @@ QDate QDate::currentDate() memset(&st, 0, sizeof(SYSTEMTIME)); GetLocalTime(&st); d.jd = julianDayFromDate(st.wYear, st.wMonth, st.wDay); +#elif defined(Q_OS_SYMBIAN) + TTime localTime; + localTime.HomeTime(); + TDateTime localDateTime = localTime.DateTime(); + // months and days are zero indexed + d.jd = julianDayFromDate(localDateTime.Year(), localDateTime.Month() + 1, localDateTime.Day() + 1 ); #else // posix compliant system time_t ltime; @@ -1823,6 +1833,12 @@ QTime QTime::currentTime() #if defined(Q_OS_WINCE) ct.startTick = GetTickCount() % MSECS_PER_DAY; #endif +#elif defined(Q_OS_SYMBIAN) + TTime localTime; + localTime.HomeTime(); + TDateTime localDateTime = localTime.DateTime(); + ct.mds = MSECS_PER_HOUR * localDateTime.Hour() + MSECS_PER_MIN * localDateTime.Minute() + + 1000 * localDateTime.Second() + (localDateTime.MicroSecond() / 1000); #elif defined(Q_OS_UNIX) // posix compliant system struct timeval tv; @@ -2874,6 +2890,8 @@ QDateTime QDateTime::currentDateTime() t.mds = MSECS_PER_HOUR * st.wHour + MSECS_PER_MIN * st.wMinute + 1000 * st.wSecond + st.wMilliseconds; return QDateTime(d, t); +#elif defined(Q_OS_SYMBIAN) + return QDateTime(QDate::currentDate(), QTime::currentTime()); #else #if defined(Q_OS_UNIX) // posix compliant system @@ -3700,6 +3718,27 @@ static QDateTimePrivate::Spec utcToLocal(QDate &date, QTime &time) res.tm_mon = sysTime.wMonth - 1; res.tm_year = sysTime.wYear - 1900; brokenDown = &res; +#elif defined(Q_OS_SYMBIAN) + // months and days are zero index based + _LIT(KUnixEpoch, "19700000:000000.000000"); + TTimeIntervalSeconds utcOffset = User::UTCOffset(); + TTimeIntervalSeconds tTimeIntervalSecsSince1Jan1970UTC(secsSince1Jan1970UTC); + TTime epochTTime; + TInt err = epochTTime.Set(KUnixEpoch); + if(err == KErrNone) { + TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC; + utcTTime = utcTTime + utcOffset; + TDateTime utcDateTime = utcTTime.DateTime(); + tm res; + res.tm_sec = utcDateTime.Second(); + res.tm_min = utcDateTime.Minute(); + res.tm_hour = utcDateTime.Hour(); + res.tm_mday = utcDateTime.Day() + 1; // non-zero based index for tm struct + res.tm_mon = utcDateTime.Month(); + res.tm_year = utcDateTime.Year() - 1900; + res.tm_isdst = 0; + brokenDown = &res; + } #elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) // use the reentrant version of localtime() where available tzset(); @@ -3745,7 +3784,7 @@ static void localToUtc(QDate &date, QTime &time, int isdst) localTM.tm_mon = fakeDate.month() - 1; localTM.tm_year = fakeDate.year() - 1900; localTM.tm_isdst = (int)isdst; -#if defined(Q_OS_WINCE) +#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) time_t secsSince1Jan1970UTC = toTime_tHelper(fakeDate, time); #else #if defined(Q_OS_WIN) @@ -3770,6 +3809,27 @@ static void localToUtc(QDate &date, QTime &time, int isdst) res.tm_year = sysTime.wYear - 1900; res.tm_isdst = (int)isdst; brokenDown = &res; +#elif defined(Q_OS_SYMBIAN) + // months and days are zero index based + _LIT(KUnixEpoch, "19700000:000000.000000"); + TTimeIntervalSeconds utcOffset = TTimeIntervalSeconds(0 - User::UTCOffset().Int()); + TTimeIntervalSeconds tTimeIntervalSecsSince1Jan1970UTC(secsSince1Jan1970UTC); + TTime epochTTime; + TInt err = epochTTime.Set(KUnixEpoch); + if(err == KErrNone) { + TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC; + utcTTime = utcTTime + utcOffset; + TDateTime utcDateTime = utcTTime.DateTime(); + tm res; + res.tm_sec = utcDateTime.Second(); + res.tm_min = utcDateTime.Minute(); + res.tm_hour = utcDateTime.Hour(); + res.tm_mday = utcDateTime.Day() + 1; // non-zero based index for tm struct + res.tm_mon = utcDateTime.Month(); + res.tm_year = utcDateTime.Year() - 1900; + res.tm_isdst = (int)isdst; + brokenDown = &res; + } #elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) // use the reentrant version of gmtime() where available tm res; -- cgit v0.12 From ade25abbe4009c2f491cbd05e81903317d91ec82 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Mon, 19 Oct 2009 16:20:23 +0200 Subject: QTestLib: do not assert if testLogger object is already destroyed ... because when dumping signals we might get QThread::finished() etc. when closing the program, and then the testLogger instance might already be deleted. Reviewed-by: Jesper --- src/testlib/qtestlog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index 5b78976..da695dc 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -317,10 +317,10 @@ void QTestLog::warn(const char *msg) void QTestLog::info(const char *msg, const char *file, int line) { - QTEST_ASSERT(QTest::testLogger); QTEST_ASSERT(msg); - QTest::testLogger->addMessage(QAbstractTestLogger::Info, msg, file, line); + if (QTest::testLogger) + QTest::testLogger->addMessage(QAbstractTestLogger::Info, msg, file, line); } void QTestLog::setLogMode(LogMode mode) -- cgit v0.12 From 758153a35e4f7066419f5a0a9f44cdc37839c419 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 19 Oct 2009 13:55:01 +0200 Subject: qwindowsmobilestyle.cpp: endif comment fixed --- src/gui/styles/qwindowsmobilestyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index d27b1ec..a617102 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -6003,7 +6003,7 @@ void QWindowsMobileStyle::drawComplexControl(ComplexControl control, const QStyl } painter->restore(); break; -#endif // QT_NO_SLIDER +#endif // QT_NO_SCROLLBAR case CC_ToolButton: if (const QStyleOptionToolButton *toolbutton = qstyleoption_cast(option)) { -- cgit v0.12 From 3908a76b470632f943e836342591319b454d785b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 19 Oct 2009 12:56:43 +0200 Subject: qwidget_wince.cpp: don't invalidate the crect on maximize If we do this, QWidget::width() returns negative sizes, which makes QGraphicsView crash. Reviewed-by: thartman --- src/gui/kernel/qwidget_wince.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp index 4a0d30c..0666ab8 100644 --- a/src/gui/kernel/qwidget_wince.cpp +++ b/src/gui/kernel/qwidget_wince.cpp @@ -474,7 +474,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate) int normal = SW_SHOWNOACTIVATE; if ((oldstate & Qt::WindowMinimized) && !(newstate & Qt::WindowMinimized)) - newstate |= Qt::WindowActive; + newstate |= Qt::WindowActive; if (newstate & Qt::WindowActive) normal = SW_SHOWNORMAL; if (isWindow()) { @@ -490,13 +490,13 @@ void QWidget::setWindowState(Qt::WindowStates newstate) d->topData()->normalGeometry = geometry(); } if ((oldstate & Qt::WindowMaximized) != (newstate & Qt::WindowMaximized)) { - if (!(newstate & Qt::WindowMaximized)) { + if (!(newstate & Qt::WindowMaximized)) { int style = GetWindowLong(internalWinId(), GWL_STYLE) | WS_BORDER | WS_POPUP | WS_CAPTION; SetWindowLong(internalWinId(), GWL_STYLE, style); SetWindowLong(internalWinId(), GWL_EXSTYLE, GetWindowLong (internalWinId(), GWL_EXSTYLE) & ~ WS_EX_NODRAG); } - if (isVisible() && newstate & Qt::WindowMaximized) - qt_wince_maximize(this); + if (isVisible() && newstate & Qt::WindowMaximized) + qt_wince_maximize(this); if (isVisible() && !(newstate & Qt::WindowMinimized)) { ShowWindow(internalWinId(), (newstate & Qt::WindowMaximized) ? max : normal); if (!(newstate & Qt::WindowFullScreen)) { @@ -560,16 +560,6 @@ void QWidget::setWindowState(Qt::WindowStates newstate) qt_wince_maximize(this); } } - if ((newstate & Qt::WindowMaximized) && !(newstate & Qt::WindowFullScreen)) { - QRect r = d->topData()->normalGeometry; -#ifdef Q_WS_WINCE_WM - if (!inherits("QDialog") && !inherits("QMdiArea") && !isVisible()) { - d->data.crect.setRect(0, 0, -1, -1); - } -#else - qt_wince_maximize(this); -#endif - } } data->window_state = newstate; QWindowStateChangeEvent e(oldstate); -- cgit v0.12 From 93a6da9a9b14bc2ff637c6756bbb467f58f6200b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 19 Oct 2009 14:19:56 +0200 Subject: fix bug in tst_qwidget.cpp WinIdChangeEventWidget::event didn't return a value in all codepaths. Reviewed-by: thartman --- tests/auto/qwidget/tst_qwidget.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index 758821b..1b898f4 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -4362,11 +4362,13 @@ public: } protected: - bool event(QEvent *e){ - if(e->type() == QEvent::WinIdChange) + bool event(QEvent *e) + { + if (e->type() == QEvent::WinIdChange) { ++m_winIdChangeEventCount; - else - return QWidget::event(e); + return true; + } + return QWidget::event(e); } public: int m_winIdChangeEventCount; -- cgit v0.12 From 02c15e6a8cdb0f8a0bb6ee36880877fe90334d69 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 19 Oct 2009 14:44:43 +0200 Subject: fix widget activation from minimized state on Windows mobile The following didn't work on Windows mobile: * show a widget normal (non-maximized) * minimize it * reactivate it via the file explorer * now the widget should be visible again The code path from minimized to normal state was missing. Reviewed-by: thartman --- src/gui/kernel/qwidget_wince.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qwidget_wince.cpp b/src/gui/kernel/qwidget_wince.cpp index 0666ab8..2fe69e4 100644 --- a/src/gui/kernel/qwidget_wince.cpp +++ b/src/gui/kernel/qwidget_wince.cpp @@ -558,6 +558,8 @@ void QWidget::setWindowState(Qt::WindowStates newstate) else if (newstate & Qt::WindowMaximized) { ShowWindow(internalWinId(), max); qt_wince_maximize(this); + } else { + ShowWindow(internalWinId(), normal); } } } -- cgit v0.12