summaryrefslogtreecommitdiff
path: root/frontends/gtk
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-03-29 15:25:33 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2022-03-29 15:25:33 +0100
commit8e56cc3b1a0d9d18e35811a015cf42b57ede1025 (patch)
treec3ec6fc87924e500e168986a6921f6bff93cd280 /frontends/gtk
parentcfbd16cf7ea3335b7ac75989c4ffa63306224dfc (diff)
downloadnetsurf-8e56cc3b1a0d9d18e35811a015cf42b57ede1025.tar.gz
netsurf-8e56cc3b1a0d9d18e35811a015cf42b57ede1025.tar.bz2
Bitmap: Implement test_opaque in core instead of in every frontend.
Diffstat (limited to 'frontends/gtk')
-rw-r--r--frontends/gtk/bitmap.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/frontends/gtk/bitmap.c b/frontends/gtk/bitmap.c
index ace507333..595d5eae5 100644
--- a/frontends/gtk/bitmap.c
+++ b/frontends/gtk/bitmap.c
@@ -125,36 +125,6 @@ static void bitmap_set_opaque(void *vbitmap, bool opaque)
/**
- * Tests whether a bitmap has an opaque alpha channel
- *
- * \param vbitmap a bitmap, as returned by bitmap_create()
- * \return whether the bitmap is opaque
- */
-static bool bitmap_test_opaque(void *vbitmap)
-{
- struct bitmap *gbitmap = (struct bitmap *)vbitmap;
- unsigned char *pixels;
- int pcount;
- int ploop;
-
- assert(gbitmap);
-
- pixels = cairo_image_surface_get_data(gbitmap->surface);
-
- pcount = cairo_image_surface_get_stride(gbitmap->surface) *
- cairo_image_surface_get_height(gbitmap->surface);
-
- for (ploop = 3; ploop < pcount; ploop += 4) {
- if (pixels[ploop] != 0xff) {
- return false;
- }
- }
-
- return true;
-}
-
-
-/**
* Gets whether a bitmap should be plotted opaque
*
* \param vbitmap a bitmap, as returned by bitmap_create()
@@ -356,7 +326,6 @@ static struct gui_bitmap_table bitmap_table = {
.destroy = bitmap_destroy,
.set_opaque = bitmap_set_opaque,
.get_opaque = bitmap_get_opaque,
- .test_opaque = bitmap_test_opaque,
.get_buffer = bitmap_get_buffer,
.get_rowstride = bitmap_get_rowstride,
.get_width = nsgtk_bitmap_get_width,