aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/context2d
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2013-09-04 21:51:42 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-05 23:40:08 +0200
commit591b641d5ad85ea58cfd45c41dce383b6ec78672 (patch)
treeda5ce722c036c843a1c4d2dcfd8f9ed46861ac65 /src/quick/items/context2d
parentefb24d1b7dfa9028cb53a464dd3bd1cbbfe5fc2c (diff)
Remove large, unused function in QtQuick 2
qquickcontext2dcommandbuffer.cpp(187): warning #177: function "drawRepeatPattern" was declared but never referenced Change-Id: If3d6a2d30f1782f640876f03de0ee8f901e23347 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'src/quick/items/context2d')
-rw-r--r--src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
index d433efcb69..a01704d179 100644
--- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
+++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
@@ -184,73 +184,6 @@ static void strokeShadowPath(QPainter* p, const QPainterPath& path, qreal offset
shadowMaker.paintShapeAndShadow(p, offsetX, offsetY, blur, color);
}
-static inline void drawRepeatPattern(QPainter* p, const QImage& image, const QRectF& rect, const bool repeatX, const bool repeatY)
-{
- // Patterns must be painted so that the top left of the first image is anchored at
- // the origin of the coordinate space
- if (!image.isNull()) {
- int w = image.width();
- int h = image.height();
- int startX, startY;
- QRect r(static_cast<int>(rect.x()), static_cast<int>(rect.y()), static_cast<int>(rect.width()), static_cast<int>(rect.height()));
-
- // startX, startY is the coordinate of the first image we need to put on the left-top of the rect
- if (repeatX && repeatY) {
- // repeat
- // startX, startY is at the left top side of the left-top of the rect
- startX = r.x() >=0 ? r.x() - (r.x() % w) : r.x() - (w - qAbs(r.x()) % w);
- startY = r.y() >=0 ? r.y() - (r.y() % h) : r.y() - (h - qAbs(r.y()) % h);
- } else {
- if (!repeatX && !repeatY) {
- // no-repeat
- // only draw the image once at orgin once, check if need to draw
- QRect imageRect(0, 0, w, h);
- if (imageRect.intersects(r)) {
- startX = 0;
- startY = 0;
- } else
- return;
- } else if (repeatX && !repeatY) {
- // repeat-x
- // startY is fixed, but startX change based on the left-top of the rect
- QRect imageRect(r.x(), 0, r.width(), h);
- if (imageRect.intersects(r)) {
- startX = r.x() >=0 ? r.x() - (r.x() % w) : r.x() - (w - qAbs(r.x()) % w);
- startY = 0;
- } else
- return;
- } else {
- // repeat-y
- // startX is fixed, but startY change based on the left-top of the rect
- QRect imageRect(0, r.y(), w, r.height());
- if (imageRect.intersects(r)) {
- startX = 0;
- startY = r.y() >=0 ? r.y() - (r.y() % h) : r.y() - (h - qAbs(r.y()) % h);
- } else
- return;
- }
- }
-
- int x = startX;
- int y = startY;
- do {
- // repeat Y
- do {
- // repeat X
- QRect imageRect(x, y, w, h);
- QRect intersectRect = imageRect.intersected(r);
- QPoint destStart(intersectRect.x(), intersectRect.y());
- QRect sourceRect(intersectRect.x() - imageRect.x(), intersectRect.y() - imageRect.y(), intersectRect.width(), intersectRect.height());
-
- p->drawImage(destStart, image, sourceRect);
- x += w;
- } while (repeatX && x < r.x() + r.width());
- x = startX;
- y += h;
- } while (repeatY && y < r.y() + r.height());
- }
-}
-
QPen QQuickContext2DCommandBuffer::makePen(const QQuickContext2D::State& state)
{
QPen pen;