1136 {
1140
1142
1143 DashOpImpl::LineData lineData;
1145
1146
1147 SkASSERT(phase >= 0 && phase < intervals[0] + intervals[1]);
1148
1149
1150 if (pts[0].fY != pts[1].fY || pts[0].fX > pts[1].fX) {
1152 align_to_x_axis(pts, &rotMatrix, lineData.fPtsRot);
1153 if (!rotMatrix.
invert(&lineData.fSrcRotInv)) {
1154 SkDebugf(
"Failed to create invertible rotation matrix!\n");
1155 return nullptr;
1156 }
1157 } else {
1158 lineData.fSrcRotInv.reset();
1159 memcpy(lineData.fPtsRot, pts, 2 *
sizeof(
SkPoint));
1160 }
1161
1162
1163 calc_dash_scaling(&lineData.fParallelScale, &lineData.fPerpendicularScale, viewMatrix, pts);
1166 return nullptr;
1167 }
1168
1169 SkScalar offInterval = intervals[1] * lineData.fParallelScale;
1171
1173
1175 }
1176
1177
1178 bool fullDash = offInterval > 0.f || aaMode !=
AAMode::kNone;
1179
1180 lineData.fViewMatrix = viewMatrix;
1181 lineData.fPhase = phase;
1182 lineData.fIntervals[0] = intervals[0];
1183 lineData.fIntervals[1] = intervals[1];
1184
1186 stencilSettings);
1187}
static const int strokeWidth
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
SkScalar dashPhase() const
bool invert(SkMatrix *inverse) const
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
bool CanDrawDashLine(const SkPoint pts[2], const GrStyle &style, const SkMatrix &viewMatrix)