Exemplo n.º 1
0
static void movie_draw(JNIEnv* env, jobject movie, jobject canvas,
                       jfloat fx, jfloat fy, jobject jpaint) {
    NPE_CHECK_RETURN_VOID(env, movie);
    NPE_CHECK_RETURN_VOID(env, canvas);
    // its OK for paint to be null

    SkMovie* m = J2Movie(env, movie);
    SkCanvas* c = GraphicsJNI::getNativeCanvas(env, canvas);
    SkScalar sx = SkFloatToScalar(fx);
    SkScalar sy = SkFloatToScalar(fy);
    const SkBitmap& b = m->bitmap();
    const SkPaint* p = jpaint ? GraphicsJNI::getNativePaint(env, jpaint) : NULL;

    c->drawBitmap(b, sx, sy, p);
}
Exemplo n.º 2
0
        virtual void onDraw(SkCanvas* canvas)
            {
            this->drawBG(canvas);

            if (fMovie)
                {
                if (fMovie->duration())
                    {
                    fMovie->setTime(SkTime::GetMSecs() % fMovie->duration());
                    }
                else
                    {
                    fMovie->setTime(0);
                    }
                canvas->drawBitmap(fMovie->bitmap(), SkIntToScalar(20),
                                   SkIntToScalar(20));
                this->inval(NULL);
                }
            }
Exemplo n.º 3
0
ECode Movie::Draw(
    /* [in] */ ICanvas* canvas,
    /* [in] */ Float x,
    /* [in] */ Float y,
    /* [in] */ IPaint* paint)
{
    assert(canvas != NULL);
    // its OK for paint to be null

    // NPE_CHECK_RETURN_VOID(env, movie);
    // NPE_CHECK_RETURN_VOID(env, canvas);
    // // its OK for paint to be null

    SkMovie* m = ((SkMovie*)mNativeMovie);
    SkCanvas* c = GraphicsNative::GetNativeCanvas(canvas);
    const SkBitmap& b = m->bitmap();
    const SkPaint* p = paint ? GraphicsNative::GetNativePaint(paint) : NULL;

    c->drawBitmap(b, x, y, p);
    return NOERROR;
}