return;
}
SkRect rect = this->rect();
- SkPointPriv::SetRectTriStrip(pts, rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vertexStride);
+ SkPointPriv::SetRectTriStrip(pts, rect, vertexStride);
helper.recordDraw(target, this->gp(), this->makePipeline(target));
}
return;
}
SkRect rect = this->rect();
- SkPointPriv::SetRectTriStrip(&verts[0].fPosition, rect.fLeft, rect.fTop, rect.fRight,
- rect.fBottom, sizeof(Vertex));
+ SkPointPriv::SetRectTriStrip(&verts[0].fPosition, rect, sizeof(Vertex));
fDevToUV.apply<4, sizeof(Vertex), sizeof(SkPoint)>(verts);
helper.recordDraw(target, this->gp(), this->makePipeline(target));
}
return;
}
- SkPointPriv::SetRectTriStrip(verts, fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom,
- sizeof(SkPoint));
+ SkPointPriv::SetRectTriStrip(verts, fRect, sizeof(SkPoint));
helper.recordDraw(
target, gp.get(),
#define SkPointPriv_DEFINED
#include "SkPoint.h"
+#include "SkRect.h"
class SkPointPriv {
public:
((SkPoint*)((intptr_t)v + 2 * stride))->set(r, t);
((SkPoint*)((intptr_t)v + 3 * stride))->set(r, b);
}
-
+ static void SetRectTriStrip(SkPoint v[], const SkRect& rect, size_t stride) {
+ SetRectTriStrip(v, rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, stride);
+ }
};
#endif
static const Sk4f kFlipMuls(1.f, -1.f, 1.f, -1.f);
while (patch.fIter->next(&srcR, &dstR)) {
auto vertices = reinterpret_cast<LatticeGP::Vertex*>(verts);
- SkPointPriv::SetRectTriStrip(&vertices->fPosition, dstR.fLeft, dstR.fTop,
- dstR.fRight, dstR.fBottom, vertexStride);
+ SkPointPriv::SetRectTriStrip(&vertices->fPosition, dstR, vertexStride);
Sk4f coords(SkIntToScalar(srcR.fLeft), SkIntToScalar(srcR.fTop),
SkIntToScalar(srcR.fRight), SkIntToScalar(srcR.fBottom));
Sk4f domain = coords + kDomainOffsets;
while (!iter.done()) {
SkRect rect = SkRect::Make(iter.rect());
SkPoint* position = (SkPoint*)verts;
- SkPointPriv::SetRectTriStrip(position, rect.fLeft, rect.fTop, rect.fRight, rect.fBottom,
- vertexStride);
+ SkPointPriv::SetRectTriStrip(position, rect, vertexStride);
static const int kColorOffset = sizeof(SkPoint);
GrColor* vertColor = reinterpret_cast<GrColor*>(verts + kColorOffset);
position = (SkPoint*)positionOffset;
*position = quad.point(3);
} else {
- SkPointPriv::SetRectTriStrip(positions,
- translatedBounds.left(),
- translatedBounds.top(),
- translatedBounds.right(),
- translatedBounds.bottom(),
- vertexStride);
+ SkPointPriv::SetRectTriStrip(positions, translatedBounds, vertexStride);
}
// colors
// Setup positions
SkPoint* position = (SkPoint*) vertices;
- SkPointPriv::SetRectTriStrip(position, fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom,
- vertexStride);
+ SkPointPriv::SetRectTriStrip(position, fRect, vertexStride);
// Setup vertex colors
GrColor* color = (GrColor*)((intptr_t)vertices + kColorOffset);