diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-29 15:25:33 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-29 15:25:33 +0100 |
commit | 8e56cc3b1a0d9d18e35811a015cf42b57ede1025 (patch) | |
tree | c3ec6fc87924e500e168986a6921f6bff93cd280 /frontends/amiga | |
parent | cfbd16cf7ea3335b7ac75989c4ffa63306224dfc (diff) | |
download | netsurf-8e56cc3b1a0d9d18e35811a015cf42b57ede1025.tar.gz netsurf-8e56cc3b1a0d9d18e35811a015cf42b57ede1025.tar.bz2 |
Bitmap: Implement test_opaque in core instead of in every frontend.
Diffstat (limited to 'frontends/amiga')
-rw-r--r-- | frontends/amiga/bitmap.c | 22 | ||||
-rwxr-xr-x | frontends/amiga/bitmap.h | 8 | ||||
-rw-r--r-- | frontends/amiga/dt_picture.c | 2 |
3 files changed, 2 insertions, 30 deletions
diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c index c39f3842c..cd2667bdd 100644 --- a/frontends/amiga/bitmap.c +++ b/frontends/amiga/bitmap.c @@ -306,25 +306,6 @@ void amiga_bitmap_set_opaque(void *bitmap, bool opaque) /* exported function documented in amiga/bitmap.h */ -bool amiga_bitmap_test_opaque(void *bitmap) -{ - struct bitmap *bm = bitmap; - uint32 p = bm->width * bm->height; - uint32 a = 0; - uint32 *bmi = (uint32 *)amiga_bitmap_get_buffer(bm); - - assert(bitmap); - - for(a=0;a<p;a+=4) - { - if ((*bmi & 0x000000ffU) != 0x000000ffU) return false; - bmi++; - } - return true; -} - - -/* exported function documented in amiga/bitmap.h */ bool amiga_bitmap_get_opaque(void *bitmap) { struct bitmap *bm = bitmap; @@ -463,7 +444,7 @@ struct bitmap *ami_bitmap_from_datatype(char *filename) PBPAFMT_RGBA, amiga_bitmap_get_rowstride(bm), 0, 0, bmh->bmh_Width, bmh->bmh_Height); - amiga_bitmap_set_opaque(bm, amiga_bitmap_test_opaque(bm)); + amiga_bitmap_set_opaque(bm, bitmap_test_opaque(bm)); } DisposeDTObject(dto); } @@ -809,7 +790,6 @@ static struct gui_bitmap_table bitmap_table = { .destroy = amiga_bitmap_destroy, .set_opaque = amiga_bitmap_set_opaque, .get_opaque = amiga_bitmap_get_opaque, - .test_opaque = amiga_bitmap_test_opaque, .get_buffer = amiga_bitmap_get_buffer, .get_rowstride = amiga_bitmap_get_rowstride, .get_width = bitmap_get_width, diff --git a/frontends/amiga/bitmap.h b/frontends/amiga/bitmap.h index ae072c0cd..8e7bcbc70 100755 --- a/frontends/amiga/bitmap.h +++ b/frontends/amiga/bitmap.h @@ -176,14 +176,6 @@ void amiga_bitmap_modified(void *bitmap); void amiga_bitmap_set_opaque(void *bitmap, bool opaque); /** - * Tests whether a bitmap has an opaque alpha channel - * - * \param bitmap a bitmap, as returned by bitmap_create() - * \return whether the bitmap is opaque - */ -bool amiga_bitmap_test_opaque(void *bitmap); - -/** * Gets whether a bitmap should be plotted opaque * * \param bitmap a bitmap, as returned by bitmap_create() diff --git a/frontends/amiga/dt_picture.c b/frontends/amiga/dt_picture.c index f84e0e016..e13790d5c 100644 --- a/frontends/amiga/dt_picture.c +++ b/frontends/amiga/dt_picture.c @@ -202,7 +202,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c) amiga_bitmap_get_rowstride(bitmap), 0, 0, c->width, c->height); - amiga_bitmap_set_opaque(bitmap, amiga_bitmap_test_opaque(bitmap)); + amiga_bitmap_set_opaque(bitmap, bitmap_test_opaque(bitmap)); DisposeDTObject(dto); adt->dto = NULL; |