Re: [cairo-commit] src/cairo-skia-surface.cpp

RAVI NANJUNDAPPA <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <16076336.27351405326987753.JavaMail.weblogic@epv6ml08>
HiUli, 

In such a case,"return  _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));"  ( the earlier code) 
makes more sense, as it returns a NULL backend surface with the valid status result.  
Let me know if I'm missing anything.

Thanks and Best Regards, 
N Ravi


------- Original Message -------
Sender : Uli Schlachter<[email protected]>
Date : Jul 14, 2014 13:44 (GMT+05:30)
Title : Re: [cairo] [cairo-commit] src/cairo-skia-surface.cpp

Hi Ravi,

On 14.07.2014 08:42, RAVI NANJUNDAPPA wrote:
> Hi Chris, 
> 
> Please see if this patch fulfils the need. 
> 
> Thanks, 
> N Ravi
> 
>> -----Original Message-----
>> From: Chris Wilson [mailto:[email protected]]
>> Sent: Friday, July 11, 2014 11:28 AM
>> To: RAVI NANJUNDAPPA
>> Cc: [email protected]; [email protected]
>> Subject: Re: Re: [cairo] [cairo-commit] src/cairo-skia-surface.cpp
>>
>> On Fri, Jul 11, 2014 at 04:33:52AM +0000, RAVI NANJUNDAPPA wrote:
>>> Hi Chris,
>>>
>>> I understand your point.
>>> May be in such a case, where the user has not explicitly passed any
> format
>> type, then we can fallback to   " _cairo_image_surface_create_with_content
>> (content, width, height);" statement,
>>> which ideally should be the case (I'm using this from
>> _cairo_gl_surface_create_similar()).
>>> I hope this is fine ?
>>
>> If the create_similar backend returns NULL, it is an indication that the
>> operation is unsupported for that backend. The caller then decides how to
>> handle the unsupported operation. In the user facing function, an image
>> surface is created instead.
>> -Chris

The attached effectively reverts your change and makes this return NULL again,
but it also adds a comment explaining why this shouldn't make a difference.

What Chris meant is: The old code returned NULL and that is the right thing to
do. The calling function has to be able to handle NULL and fall back in this
case. But if you return an error surface, no fallback happens and the error is
propagated. And implementing the fallback here in cairo-skia isn't necessary and
would be inconsistent with other backends.

This isn't a git formatted patch on purpose. Someone else can handle this.

Uli
-- 
- Buck, when, exactly, did you lose your mind?
- Three months ago. I woke up one morning married to a pineapple.
  An ugly pineapple... But I loved her.
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.