{"id":416,"date":"2010-09-07T11:13:52","date_gmt":"2010-09-07T10:13:52","guid":{"rendered":"http:\/\/gnome\/cairo-1_10"},"modified":"2010-09-07T11:13:52","modified_gmt":"2010-09-07T10:13:52","slug":"cairo-1-10","status":"publish","type":"post","link":"https:\/\/blogs.igalia.com\/carlosgc\/2010\/09\/07\/cairo-1-10\/","title":{"rendered":"Cairo 1.10"},"content":{"rendered":"<p>Yes, it&#8217;s true, <a href=\"http:\/\/lists.cairographics.org\/archives\/cairo-announce\/2010-September\/000167.html\">Cairo 1.10 has been finally released<\/a>. Chris already summarized <a href=\"http:\/\/cgit.freedesktop.org\/cairo\/commit\/?id=87fad104645c481ab027afbc9fa45c54cacbc9a7\">two years of development in 60 lines<\/a>, so I&#8217;m going to talk about how this release affects to Evince\/Poppler.<\/p>\n<p><strong>Blend Modes<\/strong><\/p>\n<p>Cairo 1.10 has some new <a href=\"http:\/\/www.cairographics.org\/manual\/cairo-cairo-t.html#cairo-operator-t\">operators<\/a> inspired by PDF blend modes, that allowed us to <a href=\"http:\/\/cgit.freedesktop.org\/poppler\/poppler\/commit\/?id=b054756113f0df6b59935823882f412486e96db5\">easily implement PDF blend modes<\/a> in the poppler cairo backend<\/p>\n<table border=\"0\" width=\"100%\">\n<tbody>\n<tr align=\"center\">\n<td><a href=\"http:\/\/blogs.igalia.com\/carlosgc\/files\/old\/evince-pdf-blend-modes.png\"> <img decoding=\"async\" src=\"http:\/\/blogs.igalia.com\/carlosgc\/files\/old\/evince-pdf-blend-modes-min.png\" alt=\"PDF Blend Modes\" \/><\/a><\/td>\n<\/tr>\n<tr align=\"center\">\n<td><em>PDF Blend Modes<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Here is an example of a PDF document combining the use of Multiply blend mode with gradients<\/p>\n<table border=\"0\" width=\"100%\">\n<tbody>\n<tr align=\"center\">\n<td><a href=\"http:\/\/blogs.igalia.com\/carlosgc\/files\/old\/evince-scooby-gradient-cairo-1.8.png\"> <img decoding=\"async\" src=\"http:\/\/blogs.igalia.com\/carlosgc\/files\/old\/evince-scooby-gradient-cairo-1.8-min.png\" alt=\"Scooby gradient rendered with Cairo 1.8\" \/><\/a><\/td>\n<\/tr>\n<tr align=\"center\">\n<td><em>Scooby gradient rendered by poppler with Cairo 1.8<\/em><\/td>\n<\/tr>\n<tr align=\"center\">\n<td><a href=\"http:\/\/blogs.igalia.com\/carlosgc\/files\/old\/evince-scooby-gradient-cairo-1.10.png\"> <img decoding=\"async\" src=\"http:\/\/blogs.igalia.com\/carlosgc\/files\/old\/evince-scooby-gradient-cairo-1.10-min.png\" alt=\"Scooby gradient rendered by poppler with Cairo 1.10\" \/><\/a><\/td>\n<\/tr>\n<tr align=\"center\">\n<td><em>Scooby gradient rendered by poppler with Cairo 1.10<\/em><\/td>\n<\/tr>\n<tr align=\"center\">\n<td><a href=\"http:\/\/blogs.igalia.com\/carlosgc\/files\/old\/evince-scooby-gradient-xpdf.png\"> <img decoding=\"async\" src=\"http:\/\/blogs.igalia.com\/carlosgc\/files\/old\/evince-scooby-gradient-xpdf-min.png\" alt=\"Scooby gradient rendered by xpdf\" \/><\/a><\/td>\n<\/tr>\n<tr align=\"center\">\n<td><em>Scooby gradient rendered by xpdf<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Blend modes are also important for annotations, since highlight annotations are usually implemented by using the Multiply blend mode<\/p>\n<p><strong>Performance<\/strong><\/p>\n<p>There were some PDF documents where the performance of the poppler cairo backend was really bad. It seems that, with such particular documents, poppler was clipping too much. Of course, <a href=\"http:\/\/cgit.freedesktop.org\/cairo\/commit\/?id=85094c4eee4e50ec724bf1bb54ecff6f7c1014bf\">Chris fixed it<\/a>, see the screenshot:<\/p>\n<table border=\"0\" width=\"100%\">\n<tbody>\n<tr align=\"center\">\n<td><a href=\"http:\/\/blogs.igalia.com\/carlosgc\/files\/old\/poppler-cairo-performance.png\"> <img decoding=\"async\" src=\"http:\/\/blogs.igalia.com\/carlosgc\/files\/old\/poppler-cairo-performance-min.png\" alt=\"Poppler with cairo 1.8 and 1.10\" \/><\/a><\/td>\n<\/tr>\n<tr align=\"center\">\n<td><em>Poppler with cairo 1.8 and 1.10<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Output file size when printing<\/strong><\/p>\n<p>Thanks to <a href=\"http:\/\/www.cairographics.org\/manual\/cairo-cairo-surface-t.html#cairo-surface-set-mime-data\">cairo_surface_set_mime_data<\/a> now we can attach the original uncompressed image to the ps\/pdf surface that will be used when creating the resulting ps\/pdf file. It drastically reduces the size of the ps\/pdf output files created when printing documents that contain images<\/p>\n<p><strong>Fit to contents\/Trim margins<\/strong><\/p>\n<p>This hasn&#8217;t been implemented in Evince yet, but using the new recording surface we can get the page bounding box and use it to implement a <a href=\"https:\/\/bugzilla.gnome.org\/show_bug.cgi?id=169676\">new fit to contents zoom mode<\/a>.<\/p>\n<p><strong>Thanks!<\/strong><\/p>\n<p>Thank you very much to everybody involved in this release<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yes, it&#8217;s true, Cairo 1.10 has been finally released. Chris already summarized two years of development in 60 lines, so I&#8217;m going to talk about how this release affects to Evince\/Poppler. Blend Modes Cairo 1.10 has some new operators inspired &hellip; <a href=\"https:\/\/blogs.igalia.com\/carlosgc\/2010\/09\/07\/cairo-1-10\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[9,12,17,18],"class_list":["post-416","post","type-post","status-publish","format-standard","hentry","category-freedesktop-org","category-gnome","tag-cairo","tag-evince","tag-pdf","tag-poppler"],"_links":{"self":[{"href":"https:\/\/blogs.igalia.com\/carlosgc\/wp-json\/wp\/v2\/posts\/416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.igalia.com\/carlosgc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.igalia.com\/carlosgc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/carlosgc\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/carlosgc\/wp-json\/wp\/v2\/comments?post=416"}],"version-history":[{"count":0,"href":"https:\/\/blogs.igalia.com\/carlosgc\/wp-json\/wp\/v2\/posts\/416\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.igalia.com\/carlosgc\/wp-json\/wp\/v2\/media?parent=416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.igalia.com\/carlosgc\/wp-json\/wp\/v2\/categories?post=416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.igalia.com\/carlosgc\/wp-json\/wp\/v2\/tags?post=416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}