Skip to contentSkip to conversation

ui/cursor: remove cursor_get_mono_image

PATCH In review [email protected] 3 participants 3 messages Sep 17, 2024 – Oct 2, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ui/cursor: remove cursor_get_mono_image

From: "Dr. David Alan Gilbert" <[email protected]>

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

Remove it.

---
 include/ui/console.h |  1 -
 ui/cursor.c          | 24 ------------------------
 2 files changed, 25 deletions(-)
include/ui/console.h +0 -1
index fa986ab97e..5832d52a8a 100644
@@ -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;
ui/cursor.c +0 -24
index dd3853320d..6e23244fbe 100644
@@ -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;
Signature · 1 line
2.46.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Tue, Sep 17, 2024 at 4:23 AM <[email protected]> wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

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

Remove it.

Quoted 58 lines
---
 include/ui/console.h |  1 -
 ui/cursor.c          | 24 ------------------------
 2 files changed, 25 deletions(-)
include/ui/console.h +0 -1
index fa986ab97e..5832d52a8a 100644
@@ -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;

ui/cursor.c +0 -25
index dd3853320d..6e23244fbe 100644
@@ -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

Signature · 1 line
Marc-André Lureau
Reviewed-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 50 lines · On 17/09/2024 02.23, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

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

Remove it.

---
  include/ui/console.h |  1 -
  ui/cursor.c          | 24 ------------------------
  2 files changed, 25 deletions(-)
include/ui/console.h +0 -1
index fa986ab97e..5832d52a8a 100644
@@ -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;
ui/cursor.c +0 -17
index dd3853320d..6e23244fbe 100644
@@ -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) {

ui/cursor.c void cursor_set_mono(QEMUCursor *c, · line 202

Quoted 10 lines
ui/cursor.c +0 -7
-                bit = 0x80;
-            }
-        }
-        image += bpl;
-    }
-}
-
  void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask)
  {
      uint32_t *data = c->data;