summaryrefslogtreecommitdiffstats
path: root/lib/gui
Commit message (Collapse)AuthorAgeFilesLines
* gui: picopng: declare locally used functions as staticLucas Stach2019-12-021-30/+30
| | | | | Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* trivial: fix typo lenght -> lengthUwe Kleine-König2019-10-141-8/+8
| | | | | | | | | | | | Generated by perl -p -i -e 's/lenghte?/length/' arch/arm/boards/chumby_falconwing/falconwing.c arch/arm/mach-samsung/mem-s3c64xx.c fs/ext4/ext_common.h lib/gui/lodepng.c include/jtag.h There is another instance in dts/Bindings/usb/s3c2410-usb.txt, this is fixed in Linux v5.3-rc1 so supposed to be fixed soon in barebox, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: png_lode: fix freeing of uninitialized pointerAhmad Fatoum2019-08-301-6/+7
| | | | | | | | | If either calloc or png_uncompress_init fails, free(png) will free the uninitialized png pointer. Avoid this and while at it postpone the img allocation till after the early exit. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 2d-primitives: fix no previous prototype warningSam Ravnborg2019-01-031-0/+2
| | | | | | | | | | | | | | | | Fix the following warnings: lib/gui/2d-primitives.c:88:6: warning: no previous prototype for ‘gu_draw_line’ [-Wmissing-prototypes] void gu_draw_line(struct screen *sc, ^~~~~~~~~~~~ lib/gui/2d-primitives.c:174:6: warning: no previous prototype for ‘gu_draw_circle’ [-Wmissing-prototypes] void gu_draw_circle(struct screen *sc, ^~~~~~~~~~~~~~ Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/missing-prototypes'Sascha Hauer2018-12-072-41/+29
|\
| * gui: lodepng: Avoid missing prototypes warningSascha Hauer2018-11-122-41/+29
| | | | | | | | | | | | | | | | - move prototypes to header file - remove some unused functions - make locally used functions static. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | lib: lodepng: remove useless testOleksij Rempel2018-11-211-7/+1
|/ | | | | | | | | | | | | | Either the condition 'code_ll==(unsigned int)(-1)' is redundant or the array 'LENGTHBASE[29]' is accessed at index 4294967038, which is out of bounds. On other hand this condition is tested within other scope: "if(code_ll >= FIRST_LENGTH_CODE_INDEX && code_ll <= LAST_LENGTH_CODE_INDEX)" with is already limited to (code_ll >= 257 && code_ll <= 285), so it can't be -1 any way. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 2d-primitives: fix typos in function names in commentsNikita Yushchenko2017-11-031-3/+3
| | | | | | | | This fixes gl_* -> gu_* in several places. Reported-by: Chris Healy <cphealy@gmail.com> Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/graphics'Sascha Hauer2017-10-191-2/+2
|\
| * 2d-primitives: fix missing pixel in gu_draw_line()Nikita Yushchenko2017-10-161-2/+2
| | | | | | | | | | | | | | | | | | When drawing line from (x1, y1) to (x2, y2), pixel at (x2, y2) should be included. Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com> Tested-by: Chris Healy <[1]cphealy@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | graphic_utils: Fix freeing uninitialzed pointer in fb_open()Sascha Hauer2017-10-191-3/+1
|/ | | | | | | In fb_open() when fb_create_screen() fails then sc contains an error pointer which is then freed in the failure path. Fix this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: bmp.c: fix "no previous prototype" warningAntony Pavlov2017-03-301-2/+2
| | | | | | | | | | | | | | The patch fixes these compiler's warnings: lib/gui/bmp.c:12:15: warning: no previous prototype for 'bmp_open' [-Wmissing-prototypes] struct image *bmp_open(char *inbuf, int insize) ^ lib/gui/bmp.c:33:6: warning: no previous prototype for 'bmp_close' [-Wmissing-prototypes] void bmp_close(struct image *img) ^ Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 2d-primitives: check dimensions in __illuminateBastian Stender2017-02-241-0/+3
| | | | | | | | gl_draw_circle draws outside of the screen if the resolution is too low. This lead to memory corruption. Check the dimensions before drawing. Signed-off-by: Bastian Stender <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphic_utils: do not allocate info in fb_openBastian Stender2017-02-241-3/+0
| | | | | | | | info was errorneously allocated, but it really is a pointer to a fb_info struct from the framebuffer. This fixes a memory leak. Signed-off-by: Bastian Stender <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphic_utils: implement 8 bpp color depth in gu_set_pixelBastian Stender2017-02-241-0/+1
| | | | | Signed-off-by: Bastian Stender <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* GUI: Add code to draw simple graphicsAndrey Smirnov2016-06-303-0/+203
| | | | | | | | Add code to draw simple graphics, namely lines(solid or dashed) and circles. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* GUI: Add a function to draw vertical/horizontal barsAndrey Smirnov2016-06-301-0/+29
| | | | | | | Add a function to draw solid vertical or horizontal bars. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphics_utils: check for valid framebuffer before creating a screenSascha Hauer2015-11-131-0/+4
| | | | | | Otherwise we crash later when we try to print on that screen. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: implement blitting screen areasSascha Hauer2015-08-201-0/+19
| | | | | | | So far we only supported blitting the whole screen from the shadow fb to the framebuffer. Add a function to blit areas. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: Use fb provided shadowfb for offscreen renderingSascha Hauer2015-08-201-17/+7
| | | | | | | The fb core now has builtin support for offscreen rendering, use this and drop offscreen handling in the gui code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fb: return original fb_info in FBIOGET_SCREENINFOSascha Hauer2015-08-201-4/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphics_utils: Let fb_open allocate the screenSascha Hauer2015-07-203-35/+61
| | | | | | | | | Allocate the screen dynamically in fb_open. This opens the way to create a fb_create_screen function which takes a struct fb_info * instead of a filename. This is suitable for the framebuffer console which already has a struct fb_info *. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphics_utils: add function to create pixel from rgb tripletSascha Hauer2015-07-161-6/+26
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphics_utils: Export get_pixelSascha Hauer2015-07-161-2/+12
| | | | | | | | | | | get_pixel converts a 32bit trgb color into framebuffer format. This is useful for other code aswell, so export it. Other functions in the graphics utils code use the name get/set_pixel aswell, but instead of converting data they get a pixel from the framebuffer or set a pixel on the framebuffer. To separate from these rename the function to gu_hex_to_pixel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphics_utils: Add function to invert an areaSascha Hauer2015-07-161-0/+19
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: Fix typo in function nameSascha Hauer2015-07-152-2/+2
| | | | | | It's a render buffer, not a redering buffer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphic_utils: Add a common namespace to functionsSascha Hauer2015-07-153-14/+14
| | | | | | | This adds a common namespace to the graphic functions. We use gu_ for graphic_utils. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-07-031-4/+4
|\
| * image_renderer: Use read_file_2Sascha Hauer2015-06-261-4/+4
| | | | | | | | | | | | | | This returns a proper error code and allows us to print a proper error message which might not always be -ENOMEM. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bmp support: Use unaligned accessorsSascha Hauer2015-06-231-5/+6
|/ | | | | | | Some fields in the bmp header are unaligned. Use unaligned accessor functions to acces them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphic_utils: set_pixel only write 16bit in 16bit modeJean-Christophe PLAGNIOL-VILLARD2015-01-051-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move file helper functions to separate fileSascha Hauer2014-08-071-0/+1
| | | | | | | | | | We have our file helper functions in several places. Move them all to lib/libfile.c. With this we no longer have file helpers in fs/fs.c which contains the core fs functions and no functions in lib/libbb.c which are not from busybox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: IMAGE_RENDERER does not depend on VIDEOSascha Hauer2014-06-051-1/+0
| | | | | | | | | Image renderer may not be particularly useful without framebuffer support, but technically it does not depend on VIDEO. Fixes: warning: (CMD_SPLASH) selects IMAGE_RENDERER which has unmet direct dependencies (VIDEO) Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: Fix resource leakAlexander Shiyan2014-04-231-0/+4
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: fix signedness mixups in printf format specifiersLucas Stach2014-04-231-1/+1
| | | | | | | | | This most likely doesn't fix any real bugs, but it's the right thing to do and reduces the noise level with static checkers. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* splash: Print error message when no renderer is foundSascha Hauer2014-03-171-0/+2
| | | | | | | the splash command silently fails when no renderer is found for an image type. Print an error message in this case. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* barebox: remove double semicolonsAlexander Aring2013-11-181-2/+2
| | | | | Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: Fix signed/unsigned arguments for printfAlexander Shiyan2013-11-111-1/+1
| | | | | | | "%u" in format string requires a unsigned integer. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: convert the bmp renderer to respect line_lengthAndre Heider2013-11-061-4/+4
| | | | | Signed-off-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: convert graphic utils to respect line_lengthAndre Heider2013-11-061-5/+5
| | | | | Signed-off-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: fix format specifiersSascha Hauer2013-01-271-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphic_utils/fb_open: fix fbsizeJean-Christophe PLAGNIOL-VILLARD2013-01-161-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'kconfig'Sascha Hauer2012-12-081-1/+1
|\
| * Cleanup Kconfig filesAlexander Shiyan2012-12-081-1/+1
| | | | | | | | | | | | | | | | | | This patch provides a global cleanup barebox Kconfig files. This includes replacing spaces to tabs, formatting in accordance format, removing extraneous lines and spaces. No functional changes. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | filetype: Pass bufsizeSascha Hauer2012-12-031-3/+3
|/ | | | | | | | | | Pass the buffer size to the file detection code. This makes sure we do not read past the buffer. This is especially useful for ext filesystem detection as the magic is at byte offset 1080. Also introduce a FILE_TYPE_SAFE_BUFSIZE define which is set to the minimum bufsize the detection code needs to detect all known filetypes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bmp: specify we need to keep the data read from the fileJean-Christophe PLAGNIOL-VILLARD2012-11-211-0/+1
| | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Tested-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: blit the surface on demandJean-Christophe PLAGNIOL-VILLARD2012-10-043-6/+8
| | | | | | | | Do not blit the surface everytime we write an image As we want to able to render multiple image this will cause 1 blit per image; Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphic_utils: introduce common fb_open/closeJean-Christophe PLAGNIOL-VILLARD2012-10-043-9/+56
| | | | | | | To open, memmap, get the fb_info and if needed allocate the offscreen buffer Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gui: introduce screen and surface to factorize and simplify codeJean-Christophe PLAGNIOL-VILLARD2012-10-043-41/+48
| | | | | | | | | | Instead of passing hundreds of parameter, just pass the right structure. struct screen represent the screen with a without double buffering. struct surface represent the part of the screen we want to render. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* graphic_utils: pass image so we can draw only the visible part of the imageJean-Christophe PLAGNIOL-VILLARD2012-10-042-4/+5
| | | | | | | This is needed if the image is bigger than the screen. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>