void *ath_prepare_strip(struct bitmap *bmp, int top, int lines) { fprintf(stderr, "preps\n"); Bitmap *b = (Bitmap *)bmp->flags; bmp->data = b->LockRaster(); bmp->skip = b->GetBytesPerRow(); return ((char *)bmp->data) + bmp->skip * top; }
void *ath_prepare_strip(struct bitmap *bmp, int top, int lines) { debug2("preps\n"); Bitmap *b = (Bitmap *)bmp->flags; if (!b) return NULL; bmp->data = b->LockRaster(); bmp->skip = b->GetBytesPerRow(); return ((char *)bmp->data) + bmp->skip * top; }
int ath_get_empty_bitmap(struct bitmap *bmp) { fprintf(stderr, "bmp\n"); Bitmap *b = new Bitmap(bmp->x, bmp->y, ath_cs_bmp, Bitmap::SHARE_FRAMEBUFFER); if (!b) { bmp->data = NULL; return 0; } bmp->data = b->LockRaster(); bmp->skip = b->GetBytesPerRow(); bmp->flags = b; return 0; }
int ath_get_empty_bitmap(struct bitmap *bmp) { debug2("bmp\n"); Bitmap *b; retry: b = new Bitmap(bmp->x, bmp->y, ath_cs_bmp, Bitmap::SHARE_FRAMEBUFFER); if (!b) { if (out_of_memory(0, NULL, 0)) goto retry; bmp->data = NULL; bmp->flags = NULL; return -1; } bmp->data = b->LockRaster(); bmp->skip = b->GetBytesPerRow(); bmp->flags = b; return 0; }