From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 2/4] gui: graphic_utils: Stub out fb_* functions
Date: Mon, 5 Feb 2018 09:29:33 -0800 [thread overview]
Message-ID: <20180205172935.25232-2-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20180205172935.25232-1-andrew.smirnov@gmail.com>
Stub out fb_* functions so as to avoid having to #ifdef the code using
them.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
include/gui/graphic_utils.h | 47 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/include/gui/graphic_utils.h b/include/gui/graphic_utils.h
index 279fdf91d..d4bac6394 100644
--- a/include/gui/graphic_utils.h
+++ b/include/gui/graphic_utils.h
@@ -11,6 +11,8 @@
#include <gui/image.h>
#include <gui/gui.h>
+#ifdef CONFIG_IMAGE_RENDERER
+
u32 gu_hex_to_pixel(struct fb_info *info, u32 color);
u32 gu_rgb_to_pixel(struct fb_info *info, u8 r, u8 g, u8 b, u8 t);
void gu_rgba_blend(struct fb_info *info, struct image *img, void* dest, int height,
@@ -31,4 +33,49 @@ void gu_screen_blit_area(struct screen *sc, int startx, int starty, int width,
void gu_fill_rectangle(struct screen *sc,
int x1, int y1, int x2, int y2,
u8 r, u8 g, u8 b, u8 a);
+#else
+
+static inline u32 gu_hex_to_pixel(struct fb_info *info, u32 color)
+{
+ return 0;
+}
+static inline u32 gu_rgb_to_pixel(struct fb_info *info, u8 r,
+ u8 g, u8 b, u8 t)
+{
+ return 0;
+}
+static inline void gu_rgba_blend(struct fb_info *info, struct image *img,
+ void* dest,int height,
+ int width, int startx,
+ int starty, bool is_rgba) {}
+static inline void gu_set_pixel(struct fb_info *info, void *adr, u32 px) {}
+static inline void gu_set_rgb_pixel(struct fb_info *info, void *adr,
+ u8 r, u8 g, u8 b) {}
+static inline void gu_set_rgba_pixel(struct fb_info *info, void *adr,
+ u8 r, u8 g, u8 b, u8 a) {}
+static inline void gu_memset_pixel(struct fb_info *info, void* buf,
+ u32 color, size_t size) {}
+static inline struct screen *fb_create_screen(struct fb_info *info)
+{
+ return ERR_PTR(-ENOTSUPP);
+}
+
+static inline struct screen *fb_open(const char *fbdev)
+{
+ return ERR_PTR(-ENOTSUPP);
+}
+
+static inline void fb_close(struct screen *sc) {}
+static inline void gu_screen_blit(struct screen *sc) {}
+static inline void gu_invert_area(struct fb_info *info, void *buf, int startx,
+ int starty, int width, int height) {}
+static inline void gu_screen_blit_area(struct screen *sc, int startx,
+ int starty, int width,
+ int height) {}
+static inline void gu_fill_rectangle(struct screen *sc, int x1, int y1,
+ int x2, int y2, u8 r, u8 g, u8 b, u8 a) {}
+
+#endif
+
+
#endif /* __GRAPHIC_UTILS_H__ */
--
2.14.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-02-05 17:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-05 17:29 [PATCH 1/4] 2d-primitives: Introduce gu_draw_text() Andrey Smirnov
2018-02-05 17:29 ` Andrey Smirnov [this message]
2018-02-05 17:29 ` [PATCH 3/4] linux/font.h: Stub out font functions Andrey Smirnov
2018-02-05 17:29 ` [PATCH 4/4] commands: version: Add framebuffer output support Andrey Smirnov
2018-02-09 7:29 ` Sascha Hauer
2018-02-16 13:39 ` Andrey Smirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180205172935.25232-2-andrew.smirnov@gmail.com \
--to=andrew.smirnov@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox