remove hardware specific code from gui

Use the framebuffer's getWidth4FB_HW_ACC() instead of system/helpers.
The use in cc_item_picture was guarded by a hardware #ifdef, use
needAlign4Blit() instead.

This needs testing on the affected hardware, which I do not have :-)
This commit is contained in:
Stefan Seyfried
2017-02-14 00:14:30 +01:00
committed by M. Liebmann
parent b6909fb815
commit c9e1072b94
2 changed files with 4 additions and 6 deletions

View File

@@ -33,7 +33,6 @@
#include "cc_item_picture.h" #include "cc_item_picture.h"
#include <unistd.h> #include <unistd.h>
#include <system/debug.h> #include <system/debug.h>
#include <system/helpers.h>
#include <driver/pictureviewer/pictureviewer.h> #include <driver/pictureviewer/pictureviewer.h>
extern CPictureViewer * g_PicViewer; extern CPictureViewer * g_PicViewer;
@@ -222,10 +221,9 @@ void CComponentsPicture::initCCItem()
{ {
float h_ratio = float(height)*100/(float)dy; float h_ratio = float(height)*100/(float)dy;
width = int(h_ratio*(float)dx/100); width = int(h_ratio*(float)dx/100);
#ifdef BOXMODEL_CS_HD2 if (frameBuffer->needAlign4Blit() &&
if (do_scale && (width > 10 || height > 10)) do_scale && (width > 10 || height > 10))
width = GetWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness; width = frameBuffer->getWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness;
#endif
keep_dx_aspect = false; keep_dx_aspect = false;
} }
if (keep_dy_aspect && dx) if (keep_dy_aspect && dx)

View File

@@ -2448,7 +2448,7 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data)
int xoff = (double) sub->rects[i]->x * xc; int xoff = (double) sub->rects[i]->x * xc;
int yoff = (double) sub->rects[i]->y * yc; int yoff = (double) sub->rects[i]->y * yc;
int nw = GetWidth4FB_HW_ACC(xoff, (double) sub->rects[i]->w * xc); int nw = frameBuffer->getWidth4FB_HW_ACC(xoff, (double) sub->rects[i]->w * xc);
int nh = (double) sub->rects[i]->h * yc; int nh = (double) sub->rects[i]->h * yc;
printf("Draw: #%d at %d,%d size %dx%d colors %d (x=%d y=%d w=%d h=%d) \n", i+1, printf("Draw: #%d at %d,%d size %dx%d colors %d (x=%d y=%d w=%d h=%d) \n", i+1,