Called on a background thread. Here we can only modify fBackMatrices.
200 {
201 for (int idx = 0; idx < kNumPaths; ++idx) {
205
206 glyph->fPosition.fX += v->fDx * dt;
207 if (glyph->fPosition.x() < 0) {
208 glyph->fPosition.fX -= 2 * glyph->fPosition.x();
209 v->fDx = -v->fDx;
210 }
else if (glyph->fPosition.x() >
w) {
211 glyph->fPosition.fX -= 2 * (glyph->fPosition.x() -
w);
212 v->fDx = -v->fDx;
213 }
214
215 glyph->fPosition.fY += v->fDy * dt;
216 if (glyph->fPosition.y() < 0) {
217 glyph->fPosition.fY -= 2 * glyph->fPosition.y();
218 v->fDy = -v->fDy;
219 }
else if (glyph->fPosition.y() >
h) {
220 glyph->fPosition.fY -= 2 * (glyph->fPosition.y() -
h);
221 v->fDy = -v->fDy;
222 }
223
224 glyph->fSpin += v->fDSpin * dt;
225
226 backMatrix->
setTranslate(glyph->fPosition.x(), glyph->fPosition.y());
227 backMatrix->
preScale(glyph->fZoom, glyph->fZoom);
229 backMatrix->
preTranslate(-glyph->fMidpt.x(), -glyph->fMidpt.y());
230 }
231 }
SkMatrix & setTranslate(SkScalar dx, SkScalar dy)
SkMatrix & preTranslate(SkScalar dx, SkScalar dy)
SkMatrix & preRotate(SkScalar degrees, SkScalar px, SkScalar py)
SkMatrix & preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)