summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qstroker.cpp39
-rw-r--r--src/gui/painting/qstroker_p.h15
-rw-r--r--src/opengl/util/fragmentprograms_p.h246
3 files changed, 147 insertions, 153 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<qfixed> 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; i<dashCount; ++i) {
- dashes[i] = qMax(m_dashPattern.at(i), qreal(0)) * m_stroker->strokeWidth();
+ 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..a10ebd9 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<qfixed> m_dashPattern;
qreal m_dashOffset;
+
+ qreal m_stroke_width;
+ qreal m_miter_limit;
};
@@ -361,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
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"