Bug 50413 - [patch] add explaination to _cairo_surface_create_in_error, improving code readability
Summary: [patch] add explaination to _cairo_surface_create_in_error, improving code re...
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 1.12.2
Hardware: All All
: medium normal
Assignee: Bryce Harrington
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-28 01:01 UTC by Homer Hsing
Modified: 2014-02-27 02:43 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Homer Hsing 2012-05-28 01:01:53 UTC
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 8a7cbb0..fadee8d 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -2489,6 +2489,16 @@ _cairo_surface_set_resolution (cairo_surface_t *surface,
     surface->y_resolution = y_res;
 }
 
+/**
+ * _cairo_surface_create_in_error:
+ * @status: the error status
+ *
+ * Return an appropriate static error surface for the error status.
+ * On error, surface creation functions should always return a surface
+ * created with _cairo_surface_create_in_error() instead of a new surface
+ * in an error state. This simplifies internal code as no refcounting has
+ * to be done.
+ **/
 cairo_surface_t *
 _cairo_surface_create_in_error (cairo_status_t status)
 {
Comment 1 Bryce Harrington 2014-02-27 02:43:33 UTC
commit e555dfc7173897bc0819c715e8897cd1c886e2a3
Author: Bryce Harrington <b.harrington@samsung.com>
Date:   Wed Feb 26 18:42:41 2014 -0800

    Add explanation to _cairo_surface_create_in_error

    Patch by Homer Hsing

    Bugzilla:  https://bugs.freedesktop.org/show_bug.cgi?id=50413


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.