After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 680124 - Quartz Image option , memory not zeroed before loading?
Quartz Image option , memory not zeroed before loading?
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: CoglTexture
1.10.x
Other Mac OS
: Normal normal
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-07-17 18:15 UTC by Roland Peffer
Modified: 2012-08-15 13:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bitmap: Use the 'copy' blend mode when loading images on Quartz (1.43 KB, patch)
2012-07-18 10:32 UTC, Neil Roberts
none Details | Review

Description Roland Peffer 2012-07-17 18:15:25 UTC
It looks like as memory is not cleaned before loading.
Transparent pixels show some artifacts from "old" memory pieces!
Comment 1 Neil Roberts 2012-07-18 10:31:31 UTC
I don't have a development environment set up to test the Quartz backend so I can't test it. I've just written this patch blind which might help. It would be great if you could test it.
Comment 2 Neil Roberts 2012-07-18 10:32:36 UTC
Created attachment 219085 [details] [review]
bitmap: Use the 'copy' blend mode when loading images on Quartz

When loading images on Quartz, the image is rendered into a bitmap
context using a buffer allocated with
_cogl_bitmap_new_with_malloc_buffer. However this buffer is not
initialised and by default Quartz will blend the source image with the
destination so if there are transparent parts in the source image it
will leave garbage in the destination. This patch changes the blend
mode to 'copy' so that it won't try to blend.

Before 5b785dd4 the buffer was cleared because it was allocated with
g_malloc0 so it was working in that case. Presumably it should be more
efficient to disable blending and avoid the clear though.
Comment 3 Neil Roberts 2012-08-15 13:12:02 UTC
As far as I remember Roland reported that the patch works on IRC so I've pushed it to master as 5ba7f4e6837a. Thanks!