virtual SkScalar next(SkPath* dst, SkScalar distance, SkPathMeasure& )
 {
     fMaker->setExtraPropertyCallBack(fDraw->fType, GetDistance, &distance);
     SkDrawPath* drawPath = NULL;
     if (fDraw->addPath->isPath()) {
         drawPath = (SkDrawPath*) fDraw->addPath;
     } else {
         SkApply* apply = (SkApply*) fDraw->addPath;
         apply->refresh(*fMaker);
         apply->activate(*fMaker);
         apply->interpolate(*fMaker, SkScalarMulRound(distance, 1000));
         drawPath = (SkDrawPath*) apply->getScope();
     }
     SkMatrix m;
     m.reset();
     if (fDraw->addMatrix) {
         SkDrawMatrix* matrix;
         if (fDraw->addMatrix->getType() == SkType_Matrix)
             matrix = (SkDrawMatrix*) fDraw->addMatrix;
         else {
             SkApply* apply = (SkApply*) fDraw->addMatrix;
             apply->refresh(*fMaker);
             apply->activate(*fMaker);
             apply->interpolate(*fMaker, SkScalarMulRound(distance, 1000));
             matrix = (SkDrawMatrix*) apply->getScope();
         }
     }
     SkScalar result = 0;
     SkAnimatorScript::EvaluateFloat(*fMaker, NULL, fDraw->spacing.c_str(), &result);
     if (drawPath)
         dst->addPath(drawPath->getPath(), m);
     fMaker->clearExtraPropertyCallBack(fDraw->fType);
     return result;
 }
Exemplo n.º 2
0
void SkGroup::reset() {
    if (fOriginal)  // has been copied
        return;
    int index = 0;
    int max = fCopies.count() << 5;
    for (SkDrawable** ptr = fChildren.begin(); ptr < fChildren.end(); ptr++) {
        if (index >= max || copySet(index) == false)
            continue;
        SkApply* apply = (SkApply*) *ptr;
        SkASSERT(apply->isApply());
        SkASSERT(apply->getScope());
        *ptr = apply->getScope();
        markCopyClear(index);
        index++;
    }
}
    virtual void next(const SkPoint& loc, int u, int v, SkPath* dst)
    {
        fLoc = loc;
        fU = u;
        fV = v;
        SkDrawPath* drawPath;
        fMaker->setExtraPropertyCallBack(fDraw->fType, Get2D, this);
        if (fDraw->addPath->isPath()) {
            drawPath = (SkDrawPath*) fDraw->addPath;
        } else {
            SkApply* apply = (SkApply*) fDraw->addPath;
            apply->refresh(*fMaker);
            apply->activate(*fMaker);
            apply->interpolate(*fMaker, v);
            drawPath = (SkDrawPath*) apply->getScope();
        }
        if (drawPath == NULL)
            goto clearCallBack;
        if (fDraw->matrix) {
            SkDrawMatrix* matrix;
            if (fDraw->matrix->getType() == SkType_Matrix) 
                matrix = (SkDrawMatrix*) fDraw->matrix;
            else {
                SkApply* apply = (SkApply*) fDraw->matrix;
                apply->activate(*fMaker);
                apply->interpolate(*fMaker, v);
                matrix = (SkDrawMatrix*) apply->getScope();
            }
            if (matrix) {
                dst->addPath(drawPath->getPath(), matrix->getMatrix());
                goto clearCallBack;
            }
        }
        dst->addPath(drawPath->getPath());
clearCallBack:
        fMaker->clearExtraPropertyCallBack(fDraw->fType);
    }