From c9e1072b94e3327c5ded71eada4533489572899a Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 14 Feb 2017 00:14:30 +0100 Subject: [PATCH] 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 :-) --- src/gui/components/cc_item_picture.cpp | 8 +++----- src/gui/movieplayer.cpp | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index bcaccf6c7..1870092af 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -33,7 +33,6 @@ #include "cc_item_picture.h" #include #include -#include #include extern CPictureViewer * g_PicViewer; @@ -222,10 +221,9 @@ void CComponentsPicture::initCCItem() { float h_ratio = float(height)*100/(float)dy; width = int(h_ratio*(float)dx/100); -#ifdef BOXMODEL_CS_HD2 - if (do_scale && (width > 10 || height > 10)) - width = GetWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness; -#endif + if (frameBuffer->needAlign4Blit() && + do_scale && (width > 10 || height > 10)) + width = frameBuffer->getWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness; keep_dx_aspect = false; } if (keep_dy_aspect && dx) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index ec9379fc9..0fda64768 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -2448,7 +2448,7 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) int xoff = (double) sub->rects[i]->x * xc; 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; printf("Draw: #%d at %d,%d size %dx%d colors %d (x=%d y=%d w=%d h=%d) \n", i+1,