qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ui/cursor: remove cursor_get_mono_image
@ 2024-09-17  0:23 dave
  2024-09-17  9:58 ` Marc-André Lureau
  2024-10-02 10:36 ` Thomas Huth
  0 siblings, 2 replies; 3+ messages in thread
From: dave @ 2024-09-17  0:23 UTC (permalink / raw)
  To: marcandre.lureau, berrange; +Cc: qemu-devel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <dave@treblig.org>

cursor_get_mono_image has been unused since 2018's
  0015ca5cba ("ui: remove support for SDL1.2 in favour of SDL2")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
---
 include/ui/console.h |  1 -
 ui/cursor.c          | 24 ------------------------
 2 files changed, 25 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index fa986ab97e..5832d52a8a 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -175,7 +175,6 @@ int cursor_get_mono_bpl(QEMUCursor *c);
 void cursor_set_mono(QEMUCursor *c,
                      uint32_t foreground, uint32_t background, uint8_t *image,
                      int transparent, uint8_t *mask);
-void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *mask);
 void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask);
 
 typedef void *QEMUGLContext;
diff --git a/ui/cursor.c b/ui/cursor.c
index dd3853320d..6e23244fbe 100644
--- a/ui/cursor.c
+++ b/ui/cursor.c
@@ -197,30 +197,6 @@ void cursor_set_mono(QEMUCursor *c,
     }
 }
 
-void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *image)
-{
-    uint32_t *data = c->data;
-    uint8_t bit;
-    int x,y,bpl;
-
-    bpl = cursor_get_mono_bpl(c);
-    memset(image, 0, bpl * c->height);
-    for (y = 0; y < c->height; y++) {
-        bit = 0x80;
-        for (x = 0; x < c->width; x++, data++) {
-            if (((*data & 0xff000000) == 0xff000000) &&
-                ((*data & 0x00ffffff) == foreground)) {
-                image[x/8] |= bit;
-            }
-            bit >>= 1;
-            if (bit == 0) {
-                bit = 0x80;
-            }
-        }
-        image += bpl;
-    }
-}
-
 void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask)
 {
     uint32_t *data = c->data;
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ui/cursor: remove cursor_get_mono_image
  2024-09-17  0:23 [PATCH] ui/cursor: remove cursor_get_mono_image dave
@ 2024-09-17  9:58 ` Marc-André Lureau
  2024-10-02 10:36 ` Thomas Huth
  1 sibling, 0 replies; 3+ messages in thread
From: Marc-André Lureau @ 2024-09-17  9:58 UTC (permalink / raw)
  To: dave; +Cc: berrange, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 2208 bytes --]

On Tue, Sep 17, 2024 at 4:23 AM <dave@treblig.org> wrote:

> From: "Dr. David Alan Gilbert" <dave@treblig.org>
>
> cursor_get_mono_image has been unused since 2018's
>   0015ca5cba ("ui: remove support for SDL1.2 in favour of SDL2")
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  include/ui/console.h |  1 -
>  ui/cursor.c          | 24 ------------------------
>  2 files changed, 25 deletions(-)
>
> diff --git a/include/ui/console.h b/include/ui/console.h
> index fa986ab97e..5832d52a8a 100644
> --- a/include/ui/console.h
> +++ b/include/ui/console.h
> @@ -175,7 +175,6 @@ int cursor_get_mono_bpl(QEMUCursor *c);
>  void cursor_set_mono(QEMUCursor *c,
>                       uint32_t foreground, uint32_t background, uint8_t
> *image,
>                       int transparent, uint8_t *mask);
> -void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *mask);
>  void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask);
>
>  typedef void *QEMUGLContext;
> diff --git a/ui/cursor.c b/ui/cursor.c
> index dd3853320d..6e23244fbe 100644
> --- a/ui/cursor.c
> +++ b/ui/cursor.c
> @@ -197,30 +197,6 @@ void cursor_set_mono(QEMUCursor *c,
>      }
>  }
>
> -void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *image)
> -{
> -    uint32_t *data = c->data;
> -    uint8_t bit;
> -    int x,y,bpl;
> -
> -    bpl = cursor_get_mono_bpl(c);
> -    memset(image, 0, bpl * c->height);
> -    for (y = 0; y < c->height; y++) {
> -        bit = 0x80;
> -        for (x = 0; x < c->width; x++, data++) {
> -            if (((*data & 0xff000000) == 0xff000000) &&
> -                ((*data & 0x00ffffff) == foreground)) {
> -                image[x/8] |= bit;
> -            }
> -            bit >>= 1;
> -            if (bit == 0) {
> -                bit = 0x80;
> -            }
> -        }
> -        image += bpl;
> -    }
> -}
> -
>  void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask)
>  {
>      uint32_t *data = c->data;
> --
> 2.46.0
>
>
>

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 3287 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ui/cursor: remove cursor_get_mono_image
  2024-09-17  0:23 [PATCH] ui/cursor: remove cursor_get_mono_image dave
  2024-09-17  9:58 ` Marc-André Lureau
@ 2024-10-02 10:36 ` Thomas Huth
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2024-10-02 10:36 UTC (permalink / raw)
  To: dave, marcandre.lureau, berrange, QEMU Trivial; +Cc: qemu-devel

On 17/09/2024 02.23, dave@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <dave@treblig.org>
> 
> cursor_get_mono_image has been unused since 2018's
>    0015ca5cba ("ui: remove support for SDL1.2 in favour of SDL2")
> 
> Remove it.
> 
> Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
> ---
>   include/ui/console.h |  1 -
>   ui/cursor.c          | 24 ------------------------
>   2 files changed, 25 deletions(-)
> 
> diff --git a/include/ui/console.h b/include/ui/console.h
> index fa986ab97e..5832d52a8a 100644
> --- a/include/ui/console.h
> +++ b/include/ui/console.h
> @@ -175,7 +175,6 @@ int cursor_get_mono_bpl(QEMUCursor *c);
>   void cursor_set_mono(QEMUCursor *c,
>                        uint32_t foreground, uint32_t background, uint8_t *image,
>                        int transparent, uint8_t *mask);
> -void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *mask);
>   void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask);
>   
>   typedef void *QEMUGLContext;
> diff --git a/ui/cursor.c b/ui/cursor.c
> index dd3853320d..6e23244fbe 100644
> --- a/ui/cursor.c
> +++ b/ui/cursor.c
> @@ -197,30 +197,6 @@ void cursor_set_mono(QEMUCursor *c,
>       }
>   }
>   
> -void cursor_get_mono_image(QEMUCursor *c, int foreground, uint8_t *image)
> -{
> -    uint32_t *data = c->data;
> -    uint8_t bit;
> -    int x,y,bpl;
> -
> -    bpl = cursor_get_mono_bpl(c);
> -    memset(image, 0, bpl * c->height);
> -    for (y = 0; y < c->height; y++) {
> -        bit = 0x80;
> -        for (x = 0; x < c->width; x++, data++) {
> -            if (((*data & 0xff000000) == 0xff000000) &&
> -                ((*data & 0x00ffffff) == foreground)) {
> -                image[x/8] |= bit;
> -            }
> -            bit >>= 1;
> -            if (bit == 0) {
> -                bit = 0x80;
> -            }
> -        }
> -        image += bpl;
> -    }
> -}
> -
>   void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask)
>   {
>       uint32_t *data = c->data;

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-02 10:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-17  0:23 [PATCH] ui/cursor: remove cursor_get_mono_image dave
2024-09-17  9:58 ` Marc-André Lureau
2024-10-02 10:36 ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).