Tizen Developers

Menu
Sites
Language
Performance issue drawing on Canvas

I have a native game, in which I draw several bitmaps on form's canvas.
The problem is that if I draw background bitmap on whole canvas it slows down drawing process a lot.

I do it in onDraw method of my game form:

result GameForm::OnDraw() {
    result r = E_SUCCESS;
    pCanvas->SetBackgroundColor(*backgroundColor);
    pCanvas->Clear(*rect);

    //this increases time of drawing from about 25ms to 50ms
    //  r = pCanvas->DrawBitmap(Rectangle(0, 0, this->GetWidth(), this->GetHeight()), *pBackgroundBitmap);

    //drawing some (up to 60-80) small bitmaps on pCanvas
    pLevel->draw(pCanvas);

    return r;
}

I decode Images with BITMAP_PIXEL_FORMAT_ARGB8888 option.

I also tried to add a screen-size Label with background Bitmap, but it only got worse.

Is there any way to draw background bitmap more efficiently without using openGL?

Responses

2 Replies
Michał Karpiuk

I am already using timer to invode redrawing.  What methods do you use to refresh screen after repainting canvas?

I guess in the end onDraw() is going to be invoked anyway.

Chintan Gandhi

Hi Nour,

Even I have called Draw() function which recursively calls the child function OnDraw() on timer expired and that redraws the entire screen of my game app.

I personally feel its the best way.

:)

Thanks.