Re-org gif's which_palette determination

This commit is contained in:
Nigel Tao committed 2018-08-26 17:30:36 +10:00
1 parent 826b3e6c48
commit 0066d6ac9b
2 files changed
+12 -12

No files matched your search

+6 -6
View File
@@ -187,12 +187,6 @@ pub func decoder.decode_frame_config!??(dst nptr base.frame_config, src base.io_
}
}
if (this.local_palette_log2_size != 0) or this.gc_has_transparent_index {
this.which_palette = 1
} else {
this.which_palette = 0
}
var blend base.u8 = 0
if not this.gc_has_transparent_index {
blend = 2 // 2 is WUFFS_BASE__ANIMATION_BLEND__OPAQUE.
@@ -551,6 +545,12 @@ pri func decoder.decode_id_part1!??(dst ptr base.pixel_buffer, src base.io_reade
this.palettes[1][(4 * (this.gc_transparent_index as base.u32)) + 2] = 0x00
this.palettes[1][(4 * (this.gc_transparent_index as base.u32)) + 3] = 0x00
}
if (this.local_palette_log2_size != 0) or this.gc_has_transparent_index {
this.which_palette = 1
} else {
this.which_palette = 0
}
args.dst.set_palette!(palette:this.palettes[this.which_palette][:])
// Other GIF implementations accept GIF files that aren't completely spec