9
0
Fork 0
Commit Graph

39 Commits

Author SHA1 Message Date
Bastian Stender ab5a26ef14 2d-primitives: check dimensions in __illuminate
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>
2017-02-24 08:24:35 +01:00
Bastian Stender 43f2decf5b graphic_utils: do not allocate info in fb_open
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>
2017-02-24 08:24:35 +01:00
Bastian Stender 11f1728318 graphic_utils: implement 8 bpp color depth in gu_set_pixel
Signed-off-by: Bastian Stender <bst@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2017-02-24 08:24:35 +01:00
Andrey Smirnov 927176bc16 GUI: Add code to draw simple graphics
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>
2016-06-30 08:33:53 +02:00
Andrey Smirnov 0cd1a51924 GUI: Add a function to draw vertical/horizontal bars
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>
2016-06-30 08:33:53 +02:00
Sascha Hauer 92327f1f6e graphics_utils: check for valid framebuffer before creating a screen
Otherwise we crash later when we try to print on that screen.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-11-13 08:37:13 +01:00
Sascha Hauer cabfe34ca7 gui: implement blitting screen areas
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>
2015-08-20 12:57:08 +02:00
Sascha Hauer 7c5937d245 gui: Use fb provided shadowfb for offscreen rendering
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>
2015-08-20 12:57:08 +02:00
Sascha Hauer eac28050d0 fb: return original fb_info in FBIOGET_SCREENINFO
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-08-20 12:57:07 +02:00
Sascha Hauer cfec57d898 graphics_utils: Let fb_open allocate the screen
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>
2015-07-20 07:11:21 +02:00
Sascha Hauer 322d8a509e graphics_utils: add function to create pixel from rgb triplet
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:17:17 +02:00
Sascha Hauer 3ea4dee7fd graphics_utils: Export get_pixel
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>
2015-07-16 09:13:04 +02:00
Sascha Hauer 976ad2aea2 graphics_utils: Add function to invert an area
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-16 09:03:05 +02:00
Sascha Hauer ea532ddb86 gui: Fix typo in function name
It's a render buffer, not a redering buffer.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-15 07:25:01 +02:00
Sascha Hauer 592ae690f5 graphic_utils: Add a common namespace to functions
This adds a common namespace to the graphic functions. We use
gu_ for graphic_utils.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-07-15 07:25:00 +02:00
Sascha Hauer f2a2894c27 Merge branch 'for-next/misc' 2015-07-03 08:37:40 +02:00
Sascha Hauer 24867bac8a image_renderer: Use read_file_2
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>
2015-06-26 11:56:24 +02:00
Sascha Hauer 8dee3145bf bmp support: Use unaligned accessors
Some fields in the bmp header are unaligned. Use unaligned accessor
functions to acces them.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-06-23 17:00:39 +02:00
Jean-Christophe PLAGNIOL-VILLARD 461710b119 graphic_utils: set_pixel only write 16bit in 16bit mode
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 11:36:40 +01:00
Sascha Hauer 3cfa4bc00c move file helper functions to separate file
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>
2014-08-07 06:13:51 +02:00
Sascha Hauer 68ad2e4daa gui: IMAGE_RENDERER does not depend on VIDEO
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>
2014-06-05 10:18:34 +02:00
Alexander Shiyan 746407bfbe gui: Fix resource leak
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-23 14:00:25 +02:00
Lucas Stach 9c63e92baa treewide: fix signedness mixups in printf format specifiers
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>
2014-04-23 09:05:51 +02:00
Sascha Hauer 380ebff70f splash: Print error message when no renderer is found
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>
2014-03-17 08:20:45 +01:00
Alexander Aring 32a5775125 barebox: remove double semicolons
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-18 10:13:35 +01:00
Alexander Shiyan 960eb40d02 gui: Fix signed/unsigned arguments for printf
"%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>
2013-11-11 08:52:05 +01:00
Andre Heider 9617cfecbe gui: convert the bmp renderer to respect line_length
Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-06 09:59:04 +01:00
Andre Heider 3ad1765467 gui: convert graphic utils to respect line_length
Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-06 09:59:04 +01:00
Sascha Hauer a01e54d201 treewide: fix format specifiers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-27 14:24:10 +01:00
Jean-Christophe PLAGNIOL-VILLARD cef34886b7 graphic_utils/fb_open: fix fbsize
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-16 21:33:14 +01:00
Sascha Hauer 8030ab24fa Merge branch 'kconfig' 2012-12-08 12:22:21 +01:00
Alexander Shiyan 4c20f9af97 Cleanup Kconfig files
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>
2012-12-08 12:22:12 +01:00
Sascha Hauer 5e74263762 filetype: Pass bufsize
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>
2012-12-03 11:23:25 +01:00
Jean-Christophe PLAGNIOL-VILLARD 2d439a4738 bmp: specify we need to keep the data read from the file
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>
2012-11-21 11:54:05 +01:00
Jean-Christophe PLAGNIOL-VILLARD 5eb89cea2a gui: blit the surface on demand
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>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9a048064e4 graphic_utils: introduce common fb_open/close
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>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD 3fa8d74abe gui: introduce screen and surface to factorize and simplify code
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>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD 21a8ef55b0 graphic_utils: pass image so we can draw only the visible part of the image
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>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD da0d61770a gui: move gui file to include/gui and lib/gui
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 17:22:09 +02:00