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

RAVI NANJUNDAPPA <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
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
> 
> --
> Chris Wilson, Intel Open Source Technology Centre

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
0001-skia-Fallback-handling-for-when-skia-cannot-do-the-r.patch (application/octet-stream, 1.1 KB)
From 1eae21c468d0eb267734b050b803602bbef7dd3f Mon Sep 17 00:00:00 2001
From: Ravi Nanjundappa <[email protected]>
Date: Mon, 14 Jul 2014 11:57:13 +0530
Subject: [PATCH] skia : Fallback handling for when skia cannot do the
 requested operation

Enable the normal fallback handling for when skia cannot do the request operation.
In the user facing function, an image surface is created instead.

Signed-off-by: Ravi Nanjundappa <[email protected]>
---
 src/cairo-skia-surface.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/cairo-skia-surface.cpp b/src/cairo-skia-surface.cpp
index 0282c2b..0e87676 100644
--- a/src/cairo-skia-surface.cpp
+++ b/src/cairo-skia-surface.cpp
@@ -570,7 +570,8 @@ _cairo_skia_surface_create_similar (void *asurface,
     if (! format_to_sk_config (_cairo_format_from_content (content),
 			       config, opaque))
     {
-	return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_INVALID_FORMAT));
+	return _cairo_image_surface_create_with_content (content, width,
+							height);
     }
 
     return &_cairo_skia_surface_create_internal (config, opaque,
-- 
1.7.9.5
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.