mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
fb_generic: add swidth variable, "stride in fb_pixel_t units"
this should allow to use fb_pixel_t pointer arithmetics more often
instead of byte pointers
Origin commit data
------------------
Commit: 7c7d5f08dd
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-15 (Wed, 15 Feb 2017)
This commit is contained in:
committed by
Michael Liebmann
parent
8cad1eb1a8
commit
0f4ed6c34a
@@ -340,6 +340,7 @@ int CFrameBuffer::setMode(unsigned int /*nxRes*/, unsigned int /*nyRes*/, unsign
|
||||
}
|
||||
|
||||
stride = _fix.line_length;
|
||||
swidth = stride / sizeof(fb_pixel_t);
|
||||
printf("FB: %dx%dx%d line length %d. %s accelerator.\n", xRes, yRes, bpp, stride,
|
||||
"Not using graphics"
|
||||
);
|
||||
@@ -623,7 +624,6 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int
|
||||
line++;
|
||||
}
|
||||
} else {
|
||||
int swidth = stride / sizeof(fb_pixel_t);
|
||||
fb_pixel_t *fbp = getFrameBufferPointer() + (swidth * y);
|
||||
int line = 0;
|
||||
while (line < dy) {
|
||||
@@ -934,7 +934,7 @@ void CFrameBuffer::paintPixel(const int x, const int y, const fb_pixel_t col)
|
||||
return;
|
||||
|
||||
fb_pixel_t * pos = getFrameBufferPointer();
|
||||
pos += (stride / sizeof(fb_pixel_t)) * y;
|
||||
pos += swidth * y;
|
||||
pos += x;
|
||||
|
||||
*pos = col;
|
||||
@@ -1680,7 +1680,6 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t
|
||||
uint32_t xc = (width > xRes) ? (uint32_t)xRes : width;
|
||||
uint32_t yc = (height > yRes) ? (uint32_t)yRes : height;
|
||||
|
||||
uint32_t swidth = stride / sizeof(fb_pixel_t);
|
||||
fb_pixel_t *fbp = getFrameBufferPointer() + (swidth * yoff);
|
||||
fb_pixel_t* data = (fb_pixel_t*)boxBuf;
|
||||
|
||||
|
Reference in New Issue
Block a user