<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.wiki.synfig.org/index.php?action=history&amp;feed=atom&amp;title=Dev%3ACairo_render_migration</id>
		<title>Dev:Cairo render migration - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://www.wiki.synfig.org/index.php?action=history&amp;feed=atom&amp;title=Dev%3ACairo_render_migration"/>
		<link rel="alternate" type="text/html" href="https://www.wiki.synfig.org/index.php?title=Dev:Cairo_render_migration&amp;action=history"/>
		<updated>2026-04-26T20:35:36Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>https://www.wiki.synfig.org/index.php?title=Dev:Cairo_render_migration&amp;diff=15819&amp;oldid=prev</id>
		<title>Genete: /* Rendering plugin system */</title>
		<link rel="alternate" type="text/html" href="https://www.wiki.synfig.org/index.php?title=Dev:Cairo_render_migration&amp;diff=15819&amp;oldid=prev"/>
				<updated>2012-04-22T18:17:26Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Rendering plugin system&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 18:17, 22 April 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot; &gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Uiomae made a number of changes to the individual targets to support new way of receiving data&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** Uiomae made a number of changes to the individual targets to support new way of receiving data&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** Each target is now annotated with the kind of color data that it accepts. (See the enum PixelFormat)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** Each target is now annotated with the kind of color data that it accepts. (See the enum PixelFormat)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** A few targets may have been mis-annotated, in which case the resulting images will turn out wierd (or segfault the renderer). The PNG target should work properly, though.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** A few targets may have been mis-annotated, in which case the resulting images will turn out wierd (or segfault the renderer). The PNG target should work properly, though. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;If a target is mis-annotated then it would fall back to software render&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** The render-to-screen targets defined in Synfig Studio do not support these methods, so they cannot currently render using Cairo.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*** The render-to-screen targets defined in Synfig Studio do not support these methods, so they cannot currently render using Cairo.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key synfigru_wiki:diff:version:1.11a:oldid:14756:newid:15819 --&gt;
&lt;/table&gt;</summary>
		<author><name>Genete</name></author>	</entry>

	<entry>
		<id>https://www.wiki.synfig.org/index.php?title=Dev:Cairo_render_migration&amp;diff=14756&amp;oldid=prev</id>
		<title>Eldruin: /* Data formats */  Wiki format correction</title>
		<link rel="alternate" type="text/html" href="https://www.wiki.synfig.org/index.php?title=Dev:Cairo_render_migration&amp;diff=14756&amp;oldid=prev"/>
				<updated>2012-02-07T13:34:37Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Data formats: &lt;/span&gt;  Wiki format correction&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:34, 7 February 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l35&quot; &gt;Line 35:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 35:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; Color order&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; Color order&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: ARGB32 is (8 bits of alpha value, 8 bits of red, 8 bits of green, 8 bits of blue).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: ARGB32 is (8 bits of alpha value, 8 bits of red, 8 bits of green, 8 bits of blue).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;	 &lt;/del&gt;IIRC Synfig's renderer is RGBA32 (the alpha channel is at the end, not at the beginning)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;: &lt;/ins&gt;IIRC Synfig's renderer is RGBA32 (the alpha channel is at the end, not at the beginning)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; Stride concept in Cairo&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; Stride concept in Cairo&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Synfig packs 32-bit pixel values back-to-back in a memory buffer: immediately following the last pixel in one row is the first pixel in the next row.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Synfig packs 32-bit pixel values back-to-back in a memory buffer: immediately following the last pixel in one row is the first pixel in the next row.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key synfigru_wiki:diff:version:1.11a:oldid:14755:newid:14756 --&gt;
&lt;/table&gt;</summary>
		<author><name>Eldruin</name></author>	</entry>

	<entry>
		<id>https://www.wiki.synfig.org/index.php?title=Dev:Cairo_render_migration&amp;diff=14755&amp;oldid=prev</id>
		<title>Eldruin: /* Data formats */  Wiki format correction</title>
		<link rel="alternate" type="text/html" href="https://www.wiki.synfig.org/index.php?title=Dev:Cairo_render_migration&amp;diff=14755&amp;oldid=prev"/>
				<updated>2012-02-07T13:33:56Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Data formats: &lt;/span&gt;  Wiki format correction&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:33, 7 February 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l34&quot; &gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are two key differences between the formats:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are two key differences between the formats:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; Color order&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; Color order&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;;&lt;/del&gt;:ARGB32 is (8 bits of alpha value, 8 bits of red, 8 bits of green, 8 bits of blue).&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: ARGB32 is (8 bits of alpha value, 8 bits of red, 8 bits of green, 8 bits of blue).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	 IIRC Synfig's renderer is RGBA32 (the alpha channel is at the end, not at the beginning)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	 IIRC Synfig's renderer is RGBA32 (the alpha channel is at the end, not at the beginning)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; Stride concept in Cairo&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; Stride concept in Cairo&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;;&lt;/del&gt;: Synfig packs 32-bit pixel values back-to-back in a memory buffer: immediately following the last pixel in one row is the first pixel in the next row.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Synfig packs 32-bit pixel values back-to-back in a memory buffer: immediately following the last pixel in one row is the first pixel in the next row.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;;&lt;/del&gt;:That is, the pixel in row `r' and column `c' can be found at memory location (width * 32bits * r) + (32bits * c)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: That is, the pixel in row `r' and column `c' can be found at memory location (width * 32bits * r) + (32bits * c)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;but Cairo sometimes pads zeros between rows in order to align the data for better hardware acceleration. So in cairo, the pixel in row `r' and column `c' can be found at memory location (stride * r) + (32bits * c), where stride &amp;gt;= width * 32bits. Therefore the default implementation of cairo_render must perform a color conversion between the two data formats. This definitely has a negative performance impact.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;but Cairo sometimes pads zeros between rows in order to align the data for better hardware acceleration. So in cairo, the pixel in row `r' and column `c' can be found at memory location (stride * r) + (32bits * c), where stride &amp;gt;= width * 32bits. Therefore the default implementation of cairo_render must perform a color conversion between the two data formats. This definitely has a negative performance impact.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key synfigru_wiki:diff:version:1.11a:oldid:14754:newid:14755 --&gt;
&lt;/table&gt;</summary>
		<author><name>Eldruin</name></author>	</entry>

	<entry>
		<id>https://www.wiki.synfig.org/index.php?title=Dev:Cairo_render_migration&amp;diff=14754&amp;oldid=prev</id>
		<title>Eldruin: Wikified and depersonalized version of the Nikitakit notes on cairo rendering. Thank you Nikitakit!</title>
		<link rel="alternate" type="text/html" href="https://www.wiki.synfig.org/index.php?title=Dev:Cairo_render_migration&amp;diff=14754&amp;oldid=prev"/>
				<updated>2012-02-07T13:32:56Z</updated>
		
		<summary type="html">&lt;p&gt;Wikified and depersonalized version of the Nikitakit notes on cairo rendering. Thank you Nikitakit!&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page is to describe the Cairo render migration process from the actual Synfig software render.&lt;br /&gt;
&lt;br /&gt;
== Rendering plugin system ==&lt;br /&gt;
* A plugin system for rendering methods (can be extended to support rendering methods other than Cairo, such as OpenGL)&lt;br /&gt;
** In target.h, there is an option to specify the rendering method.&lt;br /&gt;
*** SOFTWARE is the old renderer, OPENGL is unsupported but kept for consistency with Uiomae's branch, and CAIRO is the one nikitakit added&lt;br /&gt;
** Uiomae made a number of changes to the individual targets to support new way of receiving data&lt;br /&gt;
*** Each target is now annotated with the kind of color data that it accepts. (See the enum PixelFormat)&lt;br /&gt;
*** A few targets may have been mis-annotated, in which case the resulting images will turn out wierd (or segfault the renderer). The PNG target should work properly, though.&lt;br /&gt;
*** The render-to-screen targets defined in Synfig Studio do not support these methods, so they cannot currently render using Cairo.&lt;br /&gt;
&lt;br /&gt;
== Cairo rendering system ==&lt;br /&gt;
=== How the cairo rendering system works ===&lt;br /&gt;
* Nikitakit added a virtual method cairo_render to the Layer class. It receives a Cairo rendering context (cr) in addition to the Synfig context.&lt;br /&gt;
* The default implementation in the layer.cpp simply renders the layer using the software renderer, copies the output onto a cairo image surface, and then paints it onto the context.&lt;br /&gt;
** This involves one copy (with a color conversion, see below) and one paint operation - not very efficient!&lt;br /&gt;
* Each layer can override the method cairo_render to specify an actual cairo renderer.&lt;br /&gt;
* We should start the cairo conversion by implementing cairo_render for a few common layers, and figuring out how to do painting and blend methods properly.&lt;br /&gt;
** Cairo does not support as many blend methods as Synfig, but it does have quite a few (see [http://cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t])&lt;br /&gt;
**; Note&lt;br /&gt;
**: cairomm does not provide wrappers for all of them. You may need to get the constants from the C API.&lt;br /&gt;
&lt;br /&gt;
=== Cairo image surfaces, and color conversions ===&lt;br /&gt;
* Cairo has a number of underlying &amp;quot;surfaces&amp;quot; that redirect the paint operation to different targets. There are PNG, SVG, OpenGL, direct-to-screen, and a couple others.&lt;br /&gt;
* Nikitakit use the image surfaces because of the need to perform operations with color buffers.&lt;br /&gt;
** The image surfaces have a variety of data formats (see [http://cairographics.org/manual/cairo-Image-Surfaces.html#cairo-format-t])&lt;br /&gt;
==== Data formats ====&lt;br /&gt;
The only one among them, however, that includes both alpha and RGB data channels is Cairo::FORMAT_ARGB32.&lt;br /&gt;
&lt;br /&gt;
This format uses 8 bits per channel. One thing to watch out for is that professional photographers tend to want higher bit depth, especially for print. However, this may not apply to on-screen animation.&lt;br /&gt;
&lt;br /&gt;
But this cairo data format is NOT the data format that is used by the default Synfig renderer! This is probably the most confusing part of the whole rendering framework.&lt;br /&gt;
&lt;br /&gt;
There are two key differences between the formats:&lt;br /&gt;
; Color order&lt;br /&gt;
;:ARGB32 is (8 bits of alpha value, 8 bits of red, 8 bits of green, 8 bits of blue).&lt;br /&gt;
	 IIRC Synfig's renderer is RGBA32 (the alpha channel is at the end, not at the beginning)&lt;br /&gt;
; Stride concept in Cairo&lt;br /&gt;
;: Synfig packs 32-bit pixel values back-to-back in a memory buffer: immediately following the last pixel in one row is the first pixel in the next row.&lt;br /&gt;
;:That is, the pixel in row `r' and column `c' can be found at memory location (width * 32bits * r) + (32bits * c)&lt;br /&gt;
but Cairo sometimes pads zeros between rows in order to align the data for better hardware acceleration. So in cairo, the pixel in row `r' and column `c' can be found at memory location (stride * r) + (32bits * c), where stride &amp;gt;= width * 32bits. Therefore the default implementation of cairo_render must perform a color conversion between the two data formats. This definitely has a negative performance impact.&lt;br /&gt;
&lt;br /&gt;
In addition, each of the Synfig render targets expects color data in a specific format, which is NOT the same as Synfig's format, NOR is it the same as cairo's data format.&lt;br /&gt;
Here Nikitakit uses Uiomae's work on defining which color format a target accepts, and convert the cairo data format to that format&lt;br /&gt;
&lt;br /&gt;
Ideally, we would want to take advantage of cairo's native render-to-png, render-to-svg, and render-to-screen surfaces instead of manually calling libpng, etc. &lt;br /&gt;
Therefore we should consider having each target return a cairo surface, draw the image onto the cairo surface, and then pass the finalized color surface to the target&lt;br /&gt;
&lt;br /&gt;
However, that would be a completely different model from the software renderer. We would need a good way to integrate them, or else scrap our custom rendering framework and use Cairo's image surfaces, even in our software renderer (as a final step).&lt;br /&gt;
&lt;br /&gt;
== Implementing process ==&lt;br /&gt;
# Implement cairo_render for at least a few key layers (namely: Paste canvas, and either rectangle or Bline). Figure out how to do color composition correctly&lt;br /&gt;
# Decide whether to keep the current color conversion system, or figure out how to integrate cairo's native surfaces&lt;br /&gt;
#* Either integrate cairo image surfaces into all targets, including the ones in Synfig Studio&lt;br /&gt;
#* Or specify the color conversion needed for the Synfig Studio renderer.&lt;br /&gt;
#*;Note&lt;br /&gt;
#*: both require modification/reimplementation of tiling, since all renderers in core are not tile renderers)&lt;br /&gt;
# Make sure all render targets work properly&lt;br /&gt;
# Implement the rest of the layers in Cairo&lt;br /&gt;
#; Note&lt;br /&gt;
#: Since this is mostly independent, parallelized work, it's possible to have a code sprint where different people take care of different layers&lt;br /&gt;
# Figure out what parts, if any, of the custom rendering framework we want to scrap in favor of using library code&lt;br /&gt;
# Optimize: for example, don't re-render a layer if it doesn't change from one frame to the next&lt;/div&gt;</summary>
		<author><name>Eldruin</name></author>	</entry>

	</feed>