Fixes a bug introduced by commit 5d0c382a59 that caused graphical
corruption on anti-aliased fonts.
Change-Id: I6052ca758382bd9a1154d2e2208dee633dd17715
Avoids a harmless out of bounds reads in ASAN that occurs with
malloc buflib. Code size and performance is similar.
Change-Id: I1c674d046b069e64ad8cb6941356f7c568a81e88
There's no need to generate separate copies of these functions
for main and remote LCDs; we can just pass the viewport directly.
Change-Id: I20aa04a58d327b479a942708e161068bd6a3357b
In-viewport clipping code is duplicated across 8 files, making
it a chore to change anything related to clipping; refactor the
clipping logic into dedicated functions.
Change-Id: I4ab20bb3c59b0406098d0c7d23833025f17a320a
This was only enabled for the mrobe500 and sansaconnect targets.
Most targets are therefore running without this "safety" measure,
and presumably we'd have noticed long ago if there was a problem.
So in all likelihood this is just a bunch of dead code that we
don't need to carry around.
Change-Id: I7d27701a38b1c2a985ee73fa6f277ad215d8d385
Rewrite the loop to update the framebuffer by rows rather
than by columns. This should (a) be more efficient on the
majority of targets using horizontal stride framebuffers,
(b) skimp a bit on code size and (c) avoid AddressSanitizer
errors caused by reading past the end of the source buffer.
Change-Id: I238d191d63bfdecd25336fd8879a63d9d6ab7087
Ive seen no ill effects having this disabled on target so
limit it to the sim to stop Address Sanitizer from dumping
on the extra byte read. the bad data is never used AFAICT
since the loop ends
Change-Id: I8cb54e9d1f8fe28747867d861a015edb3dbfa5ff
'Bugfix' mono_bitmap_part reads ahead in the buffer,
if the height is <= char bit pixels other memory gets read
found with [Address Sanitizer]
also g#3332 since this is clearly a problem across the code
instead place the check for height < 8 in the lcd_mono_bitmap_part function
second try places the check above the negative y offset
this was causing glitches on the Q1 and likely other TS targets
since a negative y was added to height it made it < CHAR_BIT setting
stride = 0 even though the bitmap was >= CHAR_BIT high
Change-Id: I13bb8ab472c2ae61302a6de5d9e2c78243354460
'Bugfix' mono_bitmap_part reads ahead in the buffer,
if the height is <= char bit pixels other memory gets read
found with [Address Sanitizer]
also g#3332 since this is clearly a problem across the code
instead place the check for height < 8 in the lcd_mono_bitmap_part function
Change-Id: I917cbbd568fd5474b76a98c8919467e2538e0f0c
'Bugfix' mono_bitmap_part reads ahead in the buffer,
if the height is <= char bit pixels other memory gets read
Change-Id: I6e0d7a9017e1f9c371ffbd56af149ac20cb82341
several issues I saw that could pontentially cause problems
scroll engine doesn't take text height into account when checking bounds
NBELEMS was one whole row too large hopefully I got them right this time
Change-Id: If303da8320429c3964fc675351cb088d46303745
I'm currently running up against the limitations of the lcd_draw functions
I want these functions to be able to be used on any size buffer not
just buffers with a stride matching the underlying device
[DONE] allow the framebuffer to be decoupled from the device framebuffer
[DONE need examples] allow for some simple blit like transformations
[DONE] remove the device framebuffer from the plugin api
[DONE}ditto remote framebuffer
[DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr
while remote lcds may compile (and work in the sim) its not been tested on targets
[FIXED] backdrops need work to be screen agnostic
[FIXED] screen statusbar is not being combined into the main viewport correctly yet
[FIXED] screen elements are displayed incorrectly after switch to void*
[FIXED] core didn't restore proper viewport on splash etc.
[NEEDS TESTING] remote lcd garbled data
[FIXED] osd lib garbled screen on bmp_part
[FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport
[FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer
[FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw)
[UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear
scrolling viewports no longer trigger wps refresh
also fixed a bug where guisyncyesno was displaying and then disappearing
[ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes
(LCD_ and LCD_REMOTE_)
LCD_STRIDE(w, h) same as STRIDE_MAIN
LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H
LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H
LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH)
test_viewports.c has an example of usage
[FIXED!!] 2bit targets don't respect non-native strides
[FIXED] Few define snags
Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is
not valid. In any case, one should use intptr_t and ptrdiff_t when casting
to integers. This commit attempts to fix all instances reported by GCC.
When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h
Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
An upcoming lcd-24bit.c driver will re-use a lot of code from the 16bit
drivers, so prepare for that.
Change-Id: I7bc7f6b992e5e3f4e0a0aa54dc08103ebb05315f
These where used for line styling during scrolling, which is now done in apps/,
The viewport struct doesn't need to record these anymore.
Change-Id: I810d9dcb2644b00a798c6e75acab69c74a78e77f
Some seldomly used drawmode combinations did not work in conjunction with
alpha bitmaps and backdrops. Now all should work (see comment added) by using
more bits.
Change-Id: I2bc96ecf471fa8c1a608a321a235b9c8527b3dc5
If DRMODE_FG now the alpha channel in bitmaps can be used to draw the bitmap
over the framebuffer, so that e.g. a line selector isn't cleared for
for transparent bitmap pixels.
Change-Id: I09d59a09d2f3c90450a0fe2b83c6c59d757b686b
By saving current_vp fields into temp vars just before the loop gcc can
put them into registers. This yields ~15% speedup for drawing anti-aliased fonts.
Change-Id: I4c0c9f5ff7a7f084e2eb08c4ed874176b1f9832c
The comment about the format was actually incorrect. The alpha information
is now negated during conversion to native format, according to the
corrected comment.
Change-Id: Ifdb9ffdf9b55e39e64983eec2d9d60339e570bd9
As far as I can say only one file is affected. The loops needs to
go one more time since the end pointer is on the last pixel, not
beyond it.
Change-Id: Ie629138f8399b927bef7bad3847ef42db37e2fed
Change all lcd drivers to using a pointer to the static framebuffer
instead of directly accessing the static array. This will let us
later do fun things like dynamic framebuffer sizes (RaaA) or
ability to use different buffers for different layers (dynamic
skin backdrops!)
Change-Id: I0a4d58a9d7b55e6c932131b929e5d4c9f9414b06
It failed to restore macsr to the expected default (FRAC/SAT) which caused DSP
functions like tone control filter calculation to fail (resulting in noise).
The FFT plugin was also affected.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31589 a1c6a512-1295-4272-9138-f99709370657
current gcc/binutils don't support weak attribute correctly
see http://sourceware.org/bugzilla/show_bug.cgi?id=9687
fix FS#12427
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31193 a1c6a512-1295-4272-9138-f99709370657
For images, rows need to be even (this is not true for anti-aliased font files).
Fix stride and size calculation. This makes images that have odd pixel rows display properly and fixes buffer overflows.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30966 a1c6a512-1295-4272-9138-f99709370657
This uses the alpha blending capabilities introduced with anti-aliased fonts
to draw bitmaps with transparency information. The bmp loader is extended to read
this information (pass FORMAT_TRANSPARENT in format). The alpha information will
be used when drawing the bitmap.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30937 a1c6a512-1295-4272-9138-f99709370657
This new APIs wrap around lcd_[mono|transparent]_bitmap/_part calls and
handle all kinds bitmaps. The intended use is to draw bitmaps that
come from read_bmp_fd/_file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30936 a1c6a512-1295-4272-9138-f99709370657