Skip to content

Commit

Permalink
#3504 free buffers as soon as possible, log alpha channel merge cost
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Apr 8, 2022
1 parent da07790 commit a8603b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xpra/codecs/nvjpeg/decoder.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def decompress_with_device(rgb_format, img_data, options=None, download=None):
memcpy.set_dst_device(buf)
memcpy.height = width*height
memcpy(aligned=False)
rgb.free()
#fill in the alpha channel:
memcpy = Memcpy2D()
memcpy.src_x_in_bytes = memcpy.src_y = memcpy.dst_y = 0
Expand All @@ -204,9 +205,10 @@ def decompress_with_device(rgb_format, img_data, options=None, download=None):
memcpy.set_dst_device(buf)
memcpy.height = alpha_size
memcpy(aligned=False)
rgb_format += "A"
rgb.free()
alpha.free()
end = monotonic()
log("alpha merge took %ims", 1000*(end-start))
rgb_format += "A"
buf_size = rgb_size+alpha_size
else:
buf = rgb
Expand Down

0 comments on commit a8603b5

Please sign in to comment.