<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">It also looks like Cairo has a suite of performance tests checked into their repository:&nbsp;<a href="http://events.linuxfoundation.org/sites/events/files/slides/cairo_perf.pdf" class="">http://events.linuxfoundation.org/sites/events/files/slides/cairo_perf.pdf</a><div class=""><br class=""></div><div class="">—Myles</div><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On Nov 3, 2016, at 12:32 PM, S. Litherum &lt;<a href="mailto:litherum@gmail.com" class="">litherum@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Some quick Googling reveals these open-source benchmarks:<div class=""><ul class="MailOutline"><li class="">MotionMark&nbsp;<a href="http://browserbench.org/MotionMark" class="">http://browserbench.org/MotionMark</a></li><li class="">CaskBench&nbsp;<a href="https://github.com/ezhangle/caskbench" class="">https://github.com/ezhangle/caskbench</a></li><li class="">Skia project’s collection of benchmarks&nbsp;<a href="https://skia.googlesource.com/skia/+/master/bench/" class="">https://skia.googlesource.com/skia/+/master/bench/</a></li><li class="">Cairo-demos&nbsp;<a href="https://openbenchmarking.org/test/pts/cairo-demos" class="">https://openbenchmarking.org/test/pts/cairo-demos</a></li></ul><div class=""><br class=""></div><div class="">Please feel free to try others not on this list.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Myles</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On Nov 3, 2016, at 12:19 PM, Brent Fulgham &lt;<a href="mailto:bfulgham@apple.com" class="">bfulgham@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I would suggest “<a href="http://browserbench.org/MotionMark" class="">http://browserbench.org/MotionMark</a>”. :-)<div class=""><br class=""></div><div class="">-Brent</div><div class=""><br class=""><div style="" class=""><blockquote type="cite" class=""><div class="">On Nov 3, 2016, at 12:17 PM, Rogovin, Kevin &lt;<a href="mailto:kevin.rogovin@intel.com" class="">kevin.rogovin@intel.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class=""> What are some good 2D UI graphics benchmarks that are cross-platform-ish? I'd think I need to port them to Fast UI Draw, but that is possible.<br class=""><br class=""> I am very confident that Fast UI Draw will perform at the top by a large margin. The more complicated and heavier the load, the better it will do.<br class=""><br class="">-Kevin<br class=""><br class="">-----Original Message-----<br class="">From: <a href="mailto:mmaxfield@apple.com" class="">mmaxfield@apple.com</a> [<a href="mailto:mmaxfield@apple.com" class="">mailto:mmaxfield@apple.com</a>] <br class="">Sent: Thursday, November 3, 2016 9:07 PM<br class="">To: Rogovin, Kevin &lt;<a href="mailto:kevin.rogovin@intel.com" class="">kevin.rogovin@intel.com</a>&gt;<br class="">Cc: Carlos Garcia Campos &lt;<a href="mailto:carlosgc@webkit.org" class="">carlosgc@webkit.org</a>&gt;; <a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class="">Subject: Re: [webkit-dev] WebKit GPU rendering possibility<br class=""><br class="">It sounds like the primary focus of your work is improving performance. It also sounds like the only benchmark you’ve run is an artificial one that you constructed yourself.<br class=""><br class="">Given these two things, I would strongly hesitate to call our interest "significant community enthusiasm.”<br class=""><br class="">Why don’t you start by running some of the many existing graphics benchmarks with your library?<br class=""><br class="">Please correct me if my assumptions are mistaken.<br class=""><br class="">Thanks,<br class="">Myles<br class=""><br class=""><blockquote type="cite" class="">On Nov 3, 2016, at 12:50 AM, Rogovin, Kevin &lt;<a href="mailto:kevin.rogovin@intel.com" class="">kevin.rogovin@intel.com</a>&gt; wrote:<br class=""><br class="">Adding a new GraphicsContext is what I want to do as it seems the path of least pain and suffering. However, all the other things of a backend I do not need to do. I do not know how to add a GraphicsContext backend in terms of makefile magicks and configuration. I also do not know the plumbing for making it active. In theory, FastUIDraw's GraphicsContext will work on any platform that does OpenGL 3.3 or OpenGL ES 3.0. What is the plumbing to do this? Years ago I remember that the build configuration is what governed what backend was built... and I usually just piggy packed onto another... years ago I remember there was like an SDL style backend that did not require a large toolkit, just SDL.. is that still alive? where is it? I could piggy back the work there if it still is alive...<br class=""><br class="">Also, to get permission to do this work, I need significant community enthusiasm otherwise I will not be able to justify the large amount of work needed. This is another area where I need a great deal of help.<br class=""><br class="">Best Regards,<br class="">-Kevin Rogovin<br class=""><br class="">-----Original Message-----<br class="">From: Carlos Garcia Campos [<a href="mailto:carlosgc@webkit.org" class="">mailto:carlosgc@webkit.org</a>]<br class="">Sent: Thursday, November 3, 2016 9:43 AM<br class="">To: Rogovin, Kevin &lt;<a href="mailto:kevin.rogovin@intel.com" class="">kevin.rogovin@intel.com</a>&gt;; Myles C. Maxfield <br class="">&lt;<a href="mailto:mmaxfield@apple.com" class="">mmaxfield@apple.com</a>&gt;<br class="">Cc: <a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class="">Subject: Re: [webkit-dev] WebKit GPU rendering possibility<br class=""><br class="">El jue, 03-11-2016 a las 07:35 +0000, Rogovin, Kevin escribió:<br class=""><blockquote type="cite" class="">Hi,<br class=""><br class=""> The main issue of making a Cairo backend to FastUIDraw is clipping.<br class="">Cairo tracks the clipping region in CPU and does things that are fine <br class="">for CPU-based rendering (i.e. span based rendering) but are <br class="">absolutely awful for GPU rendering (from my slides, one sees that GL <br class="">backed QPainter and Cairo do much worse than CPU backed). FastUIDraw <br class="">only supports clipIn and clipOut and pushes all the clipping work to <br class="">the GPU with almost no CPU work. It does NOT track the clipping <br class="">region at all. I can give more technical details how it works (and <br class="">those details are why FastUIDraw cannot be used a backend for Cairo).<br class="">For those interested in where the code is located for clipping in <br class="">FastUIDraw, it is located at src/fastuidraw/painter/painter.cpp,<br class="">methods clipInRect, clipOutPath and clipInPath. Their implementations <br class="">are very short and simple and are quite cheap on CPU.<br class=""></blockquote><br class="">I see. Then I guess adding a new GraphicsContext for FastUIDraw is the easiest and best way to try this out in WebKit. Would it be possible to &nbsp;just add a new GraphicsContext implementation? or would you also need to change other parts of the graphics implementation or the GraphicsContext API itself?<br class=""><br class=""><blockquote type="cite" class="">Best Regards,<br class="">-Kevin<br class=""><br class="">-----Original Message-----<br class="">From: Carlos Garcia Campos [<a href="mailto:carlosgc@webkit.org" class="">mailto:carlosgc@webkit.org</a>]<br class="">Sent: Thursday, November 3, 2016 9:27 AM<br class="">To: Rogovin, Kevin &lt;<a href="mailto:kevin.rogovin@intel.com" class="">kevin.rogovin@intel.com</a>&gt;; Myles C. Maxfield &lt;mmax <br class=""><a href="mailto:field@apple.com" class="">field@apple.com</a>&gt;<br class="">Cc: <a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class="">Subject: Re: [webkit-dev] WebKit GPU rendering possibility<br class=""><br class="">El jue, 03-11-2016 a las 06:58 +0000, Rogovin, Kevin escribió:<br class=""><blockquote type="cite" class="">Hi!<br class=""><br class="">Question answers:<br class="">1. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Currently FastUIDraw has a backend to OpenGL 3.3 and OpenGL <br class="">ES 3.0. One of its design goals is to make it not terribly awful to <br class="">write a backend to different 3D API’s.<br class="">2. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I think I was unclear in my video. I have NOT migrated ANY <br class="">UI rendering library to use Fast UI Draw. What I have done is made a <br class="">demo<br class="">(painter-cells) and ported that demo to Fast UI Draw, Cairo, Qt’s <br class="">QPainter and SKIA. The diffs between the ports is almost trivial (it <br class="">really is just using those different rendering API’s).<br class=""></blockquote><br class="">That makes me wonder, would it be possible to add a new cairo backend <br class="">based on FastUIDraw? That would make very easy to try it out with the <br class="">current GraphicsContext cairo backend.<br class=""><br class=""><blockquote type="cite" class="">3. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;There are a few areas:<br class="">a. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reduce some render to offscreen buffers. When I worked with <br class="">WebKit YEARS ago, I saw a few instances of rendering to texture that <br class="">are unnecessary and even harm performance for GPU rendering. The <br class="">first example was where a brush pattern with an image and/or <br class="">gradient applied is to be drawn tiled across an area. WebKit (at <br class="">that time) first drew a single instance of that pattern to an image, <br class="">then drew that image tiled. For GPU renderers we can (very easily) <br class="">just do the repeat pattern (of both original image and gradient) <br class="">from a shader.<br class="">Another instance happens at RenderLayer where a new GraphicsContext <br class="">“layer” is started on a transformation that has rotation or <br class="">perspective. For FastUIDraw, this is not necessary, though if a <br class="">layer is transparent, then it is.<br class="">b. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;In addition, FastUIDraw has an interface so that if “what”<br class="">is<br class="">drawn is unchanged but the “how” changes, then a caller can cache <br class="">the “what” to send to the GPU. To be explicit, “what” to draw is <br class="">essentially attributes and indices and those values do NOT depend on <br class="">the state of “how” to draw. Examples of “how” to draw: current <br class="">transformation, brush to apply, clipping applied, stroking <br class="">parameters (including dash pattern) and blending mode. I admit that <br class="">I am quite proud of being able to use the same attributes an indices <br class="">even if stroking parameters (stroking width, miter limit and dash<br class="">pattern) change. Text rendering “what” to draw does depend on what <br class="">glyphs one wants to use. Specifically, if drawing coverage font <br class="">glyphs, then attributes and indices values change if one wants to <br class="">draw the glyph biffer, but for the GPU rendered glyphs they do not.<br class="">4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The renderer implements full 3x3 transformations. However, <br class="">the renderer does NOT implement out-of-order transparency. For a <br class="">GPU, a<br class="">3x3 transformation is cheap (naturally!). The renderer does handle, <br class="">with a very little additional overhead changing clipping even <br class="">between nasty rotations or perspective changes. The demo <br class="">painter-cells deliberately pushes and does lots of nasty clipping <br class="">and the performance impact of it on FastUIDraw is very small.<br class="">5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Drawing text is a right pain in the rear. Currently, <br class="">FastUIDraw has 3 methods to draw text: coverage, distance field and <br class="">an original GPU algorithm that I devised for another open sourced <br class="">project years ago. Coverage is needed when glyphs are drawn small <br class="">and hinting becomes important. The original GPU algorithm keeps <br class="">corners sharps and does a computation in the fragment shader to <br class="">compute a coverage value.<br class="">Distance field is a fall back which has render quality issues <br class="">(namely corners are rounded) but is very, very cheap.<br class="">I want to write an additional glyph renderer that is much faster <br class="">than the original GPU method and keeps corners sharp. This new one <br class="">is to use the ideas found in <a href="https://github.com/Chlumsky/msdfgen" class="">https://github.com/Chlumsky/msdfgen</a> but <br class="">I have a way to make the distance field generation much, much faster <br class="">and handle natively cubics (instead of breaking cubics into<br class="">quadratics)<br class=""><br class="">For convenience, below is a list of features FastUIDraw implements:<br class="">1. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3x3 transformation matrix<br class="">2. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path stroking with anti-aliasing a. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dashed stroking too <br class="">b. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;miter, rouned, bevel joins c. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flat, square and rounded <br class="">caps 3. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path filling against an arbitrary fill rule 4.<br class="">“brush”<br class="">a. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;linear gradients<br class="">b. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;two point conical gradients (I call these radial gradients) <br class="">c.<br class="">images<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i. nearest, <br class="">bilinear and bicubic filtering 5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clipping a. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clipIn <br class="">against rect or filled path (with arbitrary fill rule) b. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br class="">clipOut against path (with arbitrary fill rule) 6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Glyph <br class="">rendering a.<br class="">coverage fonts b. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1-channel distance field c. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;curve-pair <br class="">analytic (original algorithm) 7. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all 12 Porter-Duff blend modes<br class=""><br class="">However, I still have work to do:<br class="">1. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;anti-alias path fills<br class="">2. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;anti-alias clipping<br class="">3. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;more glyph rendering work<br class="">4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;some optimizations related to culling on path-fills 5.<br class="">dash pattern adjustments from contour length as found in http <br class=""><a href="s://www.w3.org/TR/svg-strokes/" class="">s://www.w3.org/TR/svg-strokes/</a> 6. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the analog of <br class="">GraphicContext’s begin/endTransparencyLayer 7. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The <br class="">blend/combine/transfer modes of W3C that are not from Porter-Duff.<br class=""><br class="">At this point, I need to garner interest to be able to get time to <br class="">work on this project at my employer. The stronger the enthusiasm I <br class="">can get the better my chances for continuing the work.<br class=""></blockquote><br class="">This looks really interesting, I think the GTK+ port could benefit <br class="">from this if it eventually can be used as a cairo replacement.<br class=""><br class=""><blockquote type="cite" class="">Best Regards,<br class="">-Kevin Rogovin<br class=""><br class="">From: Myles C. Maxfield [<a href="mailto:mmaxfield@apple.com" class="">mailto:mmaxfield@apple.com</a>]<br class="">Sent: Thursday, November 3, 2016 1:30 AM<br class="">To: Rogovin, Kevin &lt;<a href="mailto:kevin.rogovin@intel.com" class="">kevin.rogovin@intel.com</a>&gt;<br class="">Cc: <a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class="">Subject: Re: [webkit-dev] WebKit GPU rendering possibility<br class=""><br class="">Hello,<br class=""><br class="">This is certainly interesting work! I have a few questions about the <br class="">approach of this renderer.<br class=""><br class="">1. What API is this on top of? OpenGL? Metal? Vulkan? Raw GPU <br class="">commands[1]?<br class="">2. You mention in your video that you have already migrated Cairo on <br class="">top of your new tech. Traditionally, a web engine is divorced from a <br class="">2D rendering engine such as Cairo. Why can’t the ports of WebKit <br class="">which use Cairo get this new tech without any change?<br class="">3. What sort of API changes do you have in mind to make <br class="">GraphicsContext adopt?<br class="">4. Out of curiosity, does the renderer implement 3D transforms?<br class="">Did<br class="">you have to implement 3-D triangle subdivision along intersections <br class="">(perhaps for order-independent transparency)?<br class="">5. Which algorithm did you choose to draw text?<br class=""><br class="">Historically, the WebKit team has hesitated to allow experiments in <br class="">the OpenSource repository. Traditionally, this sort of exploratory <br class="">work is done in a branch, and only after it has proved to be an <br class="">improvement, the work is adopted on trunk.<br class=""><br class="">Thanks,<br class="">Myles<br class=""><br class="">[1] <a href="https://01.org/linuxgraphics/documentation/hardware-specificati" class="">https://01.org/linuxgraphics/documentation/hardware-specificati</a><br class="">on<br class="">-prms<br class=""><br class="">On Nov 2, 2016, at 9:35 AM, Rogovin, Kevin &lt;<a href="mailto:kevin.rogovin@intel.com" class="">kevin.rogovin@intel.com</a><br class=""><blockquote type="cite" class=""><br class=""></blockquote>wrote:<br class=""><br class="">Hi,<br class=""><br class="">I was directed here by some colleagues as this is the place to post <br class="">the following to get started on the following proposal.<br class=""><br class="">I have been working on an experimental 2D renderer that requires a <br class="">GPU, the project is open sourced on github at <a href="https://github.com/01" class="">https://github.com/01</a> <br class="">or g/fastuidraw. I gave a talk at the X Developers Conference this <br class="">year which can be seen from <br class=""><a href="https://www.x.org/wiki/Events/XDC2016/Progra" class="">https://www.x.org/wiki/Events/XDC2016/Progra</a><br class="">m/<br class="">rogovin_fast_ui_draw/ .<br class=""><br class="">I made a benchmark which makes heavy use of rotations and clipping <br class="">and ported to SKIA, Qt’s QPainter and Cairo. The benchmark and its <br class="">ports are in the git repo linked above under the branch <br class="">with_ports_of_painter-cells. It's performance advantage of <br class="">FastUIDraw against the other renderers was quite severe (against <br class="">Cairo and Qt's QPainter over 9 times and against SKIA about 5 times <br class="">faster).<br class=""><br class="">I would like to explore the option of using FastUIDraw to implement <br class="">a WebCore::GraphicsContext backend for the purpose of making drawing <br class="">faster and more efficient on Intel devices that are equipped with a <br class="">GPU. I also think that some minor modifications to WebKit’s use of <br class="">GraphicsContext will also give some benefits. I have worked on <br class="">WebKit a few years ago and knew/know my way around the rendering <br class="">code very well (atleast at that time).<br class=""><br class="">Looking forward to collaboration,<br class="">-Kevin Rogovin<br class=""><br class="">_______________________________________________<br class="">webkit-dev mailing list<br class=""><a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class=""><a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" class="">https://lists.webkit.org/mailman/listinfo/webkit-dev</a><br class=""><br class="">_______________________________________________<br class="">webkit-dev mailing list<br class="">webkit-dev@lists.webkit.org<br class="">https://lists.webkit.org/mailman/listinfo/webkit-dev<br class=""></blockquote></blockquote>_______________________________________________<br class="">webkit-dev mailing list<br class=""><a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class=""><a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" class="">https://lists.webkit.org/mailman/listinfo/webkit-dev</a><br class=""></blockquote><br class="">_______________________________________________<br class="">webkit-dev mailing list<br class=""><a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class=""><a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" class="">https://lists.webkit.org/mailman/listinfo/webkit-dev</a><br class=""></div></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">webkit-dev mailing list<br class=""><a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class=""><a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" class="">https://lists.webkit.org/mailman/listinfo/webkit-dev</a><br class=""></div></blockquote></div><br class=""></div></div>_______________________________________________<br class="">webkit-dev mailing list<br class=""><a href="mailto:webkit-dev@lists.webkit.org" class="">webkit-dev@lists.webkit.org</a><br class="">https://lists.webkit.org/mailman/listinfo/webkit-dev<br class=""></div></blockquote></div><br class=""></div></div></body></html>