mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
- libdvbsub: use framebuffer functions getBackBufferPointer() and blit2FB()
Signed-off-by: J. Krieg <bellum07@googlemail.com> Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -85,12 +85,7 @@ fb_pixel_t * simple_resize32(uint8_t * orgin, uint32_t * colors, int nb_colors,
|
|||||||
fb_pixel_t *cr,*l;
|
fb_pixel_t *cr,*l;
|
||||||
int i,j,k,ip;
|
int i,j,k,ip;
|
||||||
|
|
||||||
cr = (fb_pixel_t *) malloc(dx*dy*sizeof(fb_pixel_t));
|
cr = CFrameBuffer::getInstance()->getBackBufferPointer();
|
||||||
|
|
||||||
if(cr == NULL) {
|
|
||||||
printf("Error: malloc\n");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
l = cr;
|
l = cr;
|
||||||
|
|
||||||
for(j = 0; j < dy; j++, l += dx)
|
for(j = 0; j < dy; j++, l += dx)
|
||||||
@@ -109,8 +104,6 @@ fb_pixel_t * simple_resize32(uint8_t * orgin, uint32_t * colors, int nb_colors,
|
|||||||
void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y)
|
void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int stride = CFrameBuffer::getInstance()->getScreenWidth(true);
|
|
||||||
uint32_t *sublfb = CFrameBuffer::getInstance()->getFrameBufferPointer();
|
|
||||||
int sw = CFrameBuffer::getInstance()->getScreenWidth(true);
|
int sw = CFrameBuffer::getInstance()->getScreenWidth(true);
|
||||||
int sh = CFrameBuffer::getInstance()->getScreenHeight(true);
|
int sh = CFrameBuffer::getInstance()->getScreenHeight(true);
|
||||||
|
|
||||||
@@ -145,13 +138,7 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y)
|
|||||||
fb_pixel_t * newdata = simple_resize32 (sub.rects[i]->data[0], colors, sub.rects[i]->nb_colors, width, height, nw, nh);
|
fb_pixel_t * newdata = simple_resize32 (sub.rects[i]->data[0], colors, sub.rects[i]->nb_colors, width, height, nw, nh);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fb_pixel_t * ptr = newdata;
|
CFrameBuffer::getInstance()->blit2FB(newdata, nw, nh, xoff, yoff, 0, 0);
|
||||||
for (int y2 = 0; y2 < nh; y2++) {
|
|
||||||
int y = (yoff + y2) * stride;
|
|
||||||
for (int x2 = 0; x2 < nw; x2++)
|
|
||||||
*(sublfb + xoff + x2 + y) = *ptr++;
|
|
||||||
}
|
|
||||||
free(newdata);
|
|
||||||
|
|
||||||
if(min_x > xoff)
|
if(min_x > xoff)
|
||||||
min_x = xoff;
|
min_x = xoff;
|
||||||
|
Reference in New Issue
Block a user