mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 02:11:11 +02:00
spark: revert framebuffer scaling commits
we're going to use the STFB blitter instead of manually scaling everything if the videomode is not 720p, so more or less revert all commits regarding FB scaling: Revert "fontrenderer: scale fonts for nonstandard FB resolutions" Revert "neutrino: resize framebuffer on videomode change" Revert "fontrenderer: fix issue with epgwindow font when FB is scaling" Revert "neutrino: fix artefacts with scaling framebuffer and 1080i" Revert "spark: draw lines 2px wide instead of 1 in full-HD mode" Revert "spark: do not scale framebuffer for PAL mode" Revert "spark: fix framebuffer glitches" Revert "spark: do not sync blitter after every rectangle (improves performance)"
This commit is contained in:
@@ -37,9 +37,6 @@
|
||||
#include <system/debug.h>
|
||||
#include <global.h>
|
||||
|
||||
/* the multiplier for the SPARK scale feature */
|
||||
#define SCALE_MULT 2048
|
||||
|
||||
/* Drawing pixels is actually faster without the GXA accelerator (wich OTOH is
|
||||
faster for drawing lines, so disable it here. */
|
||||
#undef USE_NEVIS_GXA
|
||||
@@ -244,10 +241,6 @@ Font::Font(FBFontRenderClass *render, FTC_FaceID faceid, const int isize, const
|
||||
scaler.x_res = render->xres;
|
||||
scaler.y_res = render->yres;
|
||||
|
||||
xmult = frameBuffer->scaleX(SCALE_MULT, false);
|
||||
ymult = frameBuffer->scaleY(SCALE_MULT, false);
|
||||
last_xmult = xmult;
|
||||
|
||||
setSize(isize);
|
||||
}
|
||||
|
||||
@@ -259,11 +252,9 @@ FT_Error Font::getGlyphBitmap(FT_ULong glyph_index, FTC_SBit *sbit)
|
||||
int Font::setSize(int isize)
|
||||
{
|
||||
int temp = font.width;
|
||||
last_size = isize;
|
||||
font.width = isize * xmult / SCALE_MULT;
|
||||
font.height = isize * ymult / SCALE_MULT;
|
||||
scaler.width = font.width * 64;
|
||||
scaler.height = font.height * 64;
|
||||
font.width = font.height = isize;
|
||||
scaler.width = isize * 64;
|
||||
scaler.height = isize * 64;
|
||||
|
||||
FT_Error err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
|
||||
if (err != 0)
|
||||
@@ -313,17 +304,12 @@ return 0;
|
||||
|
||||
int Font::getWidth(void)
|
||||
{
|
||||
return fontwidth * SCALE_MULT / xmult;
|
||||
}
|
||||
|
||||
int Font::getSize(void)
|
||||
{
|
||||
return font.width * SCALE_MULT / xmult;
|
||||
return fontwidth;
|
||||
}
|
||||
|
||||
int Font::getHeight(void)
|
||||
{
|
||||
return height * SCALE_MULT / ymult;
|
||||
return height;
|
||||
}
|
||||
|
||||
int Font::getDigitHeight(void)
|
||||
@@ -381,24 +367,11 @@ int UTF8ToUnicode(const char * &text, const bool utf8_encoded) // returns -1 on
|
||||
return unicode_value;
|
||||
}
|
||||
|
||||
void Font::RenderString(int _x, int _y, const int _width, const char *text, const unsigned char color, const int _boxheight, const bool utf8_encoded)
|
||||
void Font::RenderString(int x, int y, const int width, const char *text, const unsigned char color, const int boxheight, const bool utf8_encoded)
|
||||
{
|
||||
if (!frameBuffer->getActive())
|
||||
return;
|
||||
|
||||
if ((xmult = frameBuffer->scaleX(SCALE_MULT, false)) != last_xmult)
|
||||
{
|
||||
last_xmult = xmult;
|
||||
ymult = frameBuffer->scaleY(SCALE_MULT, false);
|
||||
setSize(last_size);
|
||||
}
|
||||
|
||||
int x = _x * xmult / SCALE_MULT;
|
||||
int y = _y * ymult / SCALE_MULT;
|
||||
int boxheight = _boxheight * ymult / SCALE_MULT;
|
||||
int width = _width * xmult / SCALE_MULT;
|
||||
int step_y = height * ymult / SCALE_MULT;
|
||||
|
||||
pthread_mutex_lock( &renderer->render_mutex );
|
||||
|
||||
FT_Error err = FTC_Manager_LookupSize(renderer->cacheManager, &scaler, &size);
|
||||
@@ -413,6 +386,7 @@ void Font::RenderString(int _x, int _y, const int _width, const char *text, cons
|
||||
int use_kerning=FT_HAS_KERNING(face);
|
||||
|
||||
int left=x;
|
||||
int step_y=height;
|
||||
|
||||
// ----------------------------------- box upper end (this is NOT a font metric, this is our method for y centering)
|
||||
//
|
||||
@@ -708,7 +682,7 @@ int Font::getRenderWidth(const char *text, const bool utf8_encoded)
|
||||
|
||||
pthread_mutex_unlock( &renderer->render_mutex );
|
||||
|
||||
return x * SCALE_MULT / xmult;
|
||||
return x;
|
||||
}
|
||||
|
||||
int Font::getRenderWidth(const std::string & text, const bool utf8_encoded)
|
||||
|
Reference in New Issue
Block a user