[cairo] [PATCH 3/3] Adjust assertions and checks to handle more pixel formats

LRN lrn1986 at gmail.com
Thu Apr 17 03:50:01 PDT 2014


On 17.04.2014 13:46, Uli Schlachter wrote:
> On 17.04.2014 11:07, LRN wrote:
>> Now that ARGB32 format is available, allow it to be used, and use it
>> where appropriate.
> 
> I would squash this into the previous commit. Without this, the previous commit
> just adds some really broken API.

OK.

> 
> Also, why is this patch correct? Are you sure that all of this code really
> handles the ARGB32 format correctly?

No, i'm not sure.

> 
>> Signed-off-by: Руслан Ижбулатов <lrn1986 at gmail.com>
>> ---
>>  src/win32/cairo-win32-display-surface.c | 4 ++--
>>  src/win32/cairo-win32-surface.c         | 2 +-
>>  2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c
>> index d002ce2..5c01721 100644
>> --- a/src/win32/cairo-win32-display-surface.c
>> +++ b/src/win32/cairo-win32-display-surface.c
>> @@ -372,7 +372,7 @@ _cairo_win32_display_surface_create_similar (void	    *abstract_src,
>>       */
>>      if (!(src->is_dib || content & CAIRO_CONTENT_ALPHA)) {
>>  	/* try to create a ddb */
>> -	new_surf = cairo_win32_surface_create_with_ddb (src->win32.dc, CAIRO_FORMAT_RGB24, width, height);
>> +	new_surf = cairo_win32_surface_create_with_ddb (src->win32.dc, CAIRO_FORMAT_ARGB32, width, height);
> 
> I don't like this. It should only use ARGB32 when really necessary, not always.
> Since this was using RGB24 before, there must be cases when it is still enough
> to use RGB24.

Right...

-- 
O< ascii ribbon - stop html email! - www.asciiribbon.org


More information about the cairo mailing list