diff options
author | Vincent Sanders <vince@kyllikki.org> | 2020-05-13 19:03:14 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2020-05-13 19:03:14 +0100 |
commit | 3a7fc30a5f1c0945c021abf185274e88f72e7080 (patch) | |
tree | 2bb5252d22b799cc01ef1ee1858fdcb5473095bf /content/handlers/image/gif.c | |
parent | 95e0a24fac2abc4cddaa91bf44304ebc3d776b17 (diff) | |
download | netsurf-3a7fc30a5f1c0945c021abf185274e88f72e7080.tar.gz netsurf-3a7fc30a5f1c0945c021abf185274e88f72e7080.tar.bz2 |
implement content opacity check through the function table
Diffstat (limited to 'content/handlers/image/gif.c')
-rw-r--r-- | content/handlers/image/gif.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/content/handlers/image/gif.c b/content/handlers/image/gif.c index 6ef4fa7e7..e2a0ca5db 100644 --- a/content/handlers/image/gif.c +++ b/content/handlers/image/gif.c @@ -416,6 +416,19 @@ static content_type nsgif_content_type(void) return CONTENT_IMAGE; } +static bool nsgif_content_is_opaque(struct content *c) +{ + nsgif_content *gif = (nsgif_content *) c; + + if (gif->current_frame != gif->gif->decoded_frame) { + if (nsgif_get_frame(gif) != GIF_OK) { + return false; + } + } + + return guit->bitmap->get_opaque(gif->gif->frame_image); +} + static const content_handler nsgif_content_handler = { .create = nsgif_create, .data_complete = nsgif_convert, @@ -426,6 +439,7 @@ static const content_handler nsgif_content_handler = { .remove_user = nsgif_remove_user, .get_internal = nsgif_get_internal, .type = nsgif_content_type, + .is_opaque = nsgif_content_is_opaque, .no_share = false, }; |