Commit Graph

1745 Commits

Author SHA1 Message Date
bors-servo 981677976e
Auto merge of #366 - pcwalton:outline-merge, r=pcwalton
Add a function to merge two outlines
2020-06-24 20:12:23 -04:00
Sebastian K 3486d55565 Add a function to merge two outlines 2020-06-24 17:11:07 -07:00
bors-servo 89067a9ab7
Auto merge of #364 - pcwalton:c-api-gl4, r=pcwalton
Expose OpenGL 4.x in the C bindings

Closes #352.
2020-06-24 14:48:21 -04:00
Patrick Walton bc0b37c56a Panic when invalid arguments are passed to the C API.
Closes #352.
2020-06-24 11:45:47 -07:00
Patrick Walton 4877e0da57 Expose OpenGL 4.x in the C bindings 2020-06-24 11:34:28 -07:00
bors-servo bf50e74396
Auto merge of #363 - pcwalton:cargo-c, r=pcwalton
Use `cargo-c`, and update the README.

Closes #343.
2020-06-23 20:41:09 -04:00
Patrick Walton db80dd8aaa Use `cargo-c`, and update the README.
Closes #343.
2020-06-23 17:37:59 -07:00
bors-servo b3232265b4
Auto merge of #362 - pcwalton:nested-svg, r=pcwalton
`usvg` should never have nested `<svg>` nodes, so remove code that (doesn't) handle that case.

Closes #349.
2020-06-23 18:24:55 -04:00
Patrick Walton dc73e12473 `usvg` should never have nested `<svg>` nodes, so remove code that (doesn't)
handle that case.

Closes #349.
2020-06-23 15:23:43 -07:00
Patrick Walton 3dc70e0111
Merge pull request #350 from pcwalton/gpu-tiling-dicing
Add a rendering path for Direct3D 11-class hardware that uses compute shader for most stages.
2020-06-23 14:58:38 -07:00
Patrick Walton e3a966cc99 Update `Cargo.lock` 2020-06-23 13:31:53 -07:00
Patrick Walton a2d87a6624 Update the C canvas example 2020-06-23 13:31:53 -07:00
Patrick Walton 9ff46b39cd Update examples 2020-06-23 13:31:53 -07:00
Patrick Walton 423a91ea1a Update the demo for the D3D11 backend 2020-06-23 13:15:59 -07:00
Patrick Walton 72cdef2c2a Update the C backend 2020-06-23 13:15:59 -07:00
Patrick Walton 7a1db16340 Update the WebGL backend 2020-06-23 13:15:59 -07:00
Patrick Walton 769dae4a9c Update various front-end libraries 2020-06-23 13:15:59 -07:00
Patrick Walton 13b2c91dde Update the scene proxy 2020-06-23 13:15:59 -07:00
Patrick Walton f92c631f97 Rework the tile builder for D3D11 2020-06-23 13:15:59 -07:00
Patrick Walton 17356311d6 Rework renderer options 2020-06-23 13:15:59 -07:00
Patrick Walton 7a996d330c Update `pathfinder_renderer::{paint, scene}` 2020-06-23 13:15:59 -07:00
Patrick Walton df15c855c4 Significantly rework the GPU renderer for the D3D11 backend 2020-06-23 13:15:59 -07:00
Patrick Walton 58a76f0f16 Update `gpu_data` 2020-06-23 13:15:59 -07:00
Patrick Walton eabe1b239d Update `pathfinder_content` 2020-06-23 13:15:59 -07:00
Patrick Walton 385272851a Remove the separate `z_buffer` module 2020-06-23 13:15:59 -07:00
Patrick Walton b8055c38c1 Update `pathfinder_geometry` 2020-06-23 13:15:59 -07:00
Patrick Walton 23c171fb6f Refactor GPU a bit more 2020-06-23 13:15:59 -07:00
Patrick Walton 3bb4a47757 Remove old shaders 2020-06-23 13:15:59 -07:00
Patrick Walton 79326025af Rework the blit shader 2020-06-23 13:15:59 -07:00
Patrick Walton 661da5e12b Refactor GPU performance measurement 2020-06-23 13:15:59 -07:00
Patrick Walton 61833168e5 Update the debug UI 2020-06-23 13:15:59 -07:00
Patrick Walton ff7c13c8fb Add a new compute-based D3D11 backend 2020-06-23 13:10:06 -07:00
Patrick Walton 4091fe7ce1 Update the Metal backend 2020-06-23 13:10:06 -07:00
Patrick Walton 21a82ae049 Update the OpenGL backend 2020-06-23 13:10:06 -07:00
Patrick Walton 7771fd877d Add a unified GPU allocator 2020-06-23 13:10:06 -07:00
Patrick Walton 754a44ae22 Rename the existing renderer to `d3d9` in preparation for the D3D11 branch 2020-06-23 13:10:05 -07:00
Sebastian K 6b6a3b324d add Outline::{len, from_rect_rounded} 2020-06-17 09:04:27 +03:00
Sebastian K 29ef4229a9 Add inv, phi and angle_to to Vector2F 2020-06-17 08:59:17 +03:00
Sebastian K d954cbd05c add Contour::{from_rect_rounded, push_svg_arc} 2020-06-17 08:49:14 +03:00
Sebastian K 26e41b82ff add Outline::with_capacity, Contour::transformed and a small fix 2020-06-17 08:49:07 +03:00
Sebastian K 7e05972549 add mirror_and_close path operator 2020-06-17 08:48:35 +03:00
Sebastian K 636d5da589 add Outline::transformed 2020-06-17 08:45:07 +03:00
Sebastian K 541ad28f64 add Outline::merge to combine two outlines 2020-06-17 08:44:52 +03:00
bors-servo 5e3fb5fed0
Auto merge of #356 - linkmauve:c-resources-path, r=pcwalton
Expose creating a resource loader from a path to C

This is useful when Pathfinder is shipped by a Linux distribution, and not with everything bundled.
2020-06-16 12:11:35 -04:00
bors-servo 22d5dbc26a
Auto merge of #353 - linkmauve:no-foreign-types, r=pcwalton
Only use foreign-types on macOS in the C API

Its only use is for `CoreAnimationLayerRef::from_ptr()` in `PFMetalDeviceCreate`, so this fixes a warning on other platforms.

The last time I tried to fix this warning I didn’t notice that it was actually used, and thus 2d2bc14e5c broke the macOS build in #257.
2020-06-16 11:54:58 -04:00
bors-servo 1b63996fef
Auto merge of #347 - as-cii:metal-manifest, r=pcwalton
Add missing Metal shader to resources/MANIFEST

This fixes an issue that caused `pathfinder_metal` to panic when [attempting to load shaders](0f35009215/metal/src/lib.rs (L854)) using the embedded resource loader.

/cc: @nathansobo
2020-06-16 11:37:25 -04:00
Patrick Walton a47c703518
Merge pull request #358 from windexlight/scalar-u32x2-fix
Implement BitAnd, BitOr, and Not for U32x2 in scalar version.
2020-06-16 08:37:02 -07:00
Sam Schanken 714421b3c6 Implement BitAnd, BitOr, and Not for U32x2 in scalar version. 2020-06-13 17:18:49 -07:00
Emmanuel Gil Peyrot 5e8c20e78c Expose creating a resource loader from a path to C 2020-06-11 16:02:09 +02:00
Emmanuel Gil Peyrot f2c0aba352 C API: Only use foreign-types on macOS
Its only use is for CoreAnimationLayerRef::from_ptr() in
PFMetalDeviceCreate, so this fixes a warning on other platforms.

The last time I tried to fix this warning I didn’t notice that it was
actually used, and thus 2d2bc14e5c broke
the macOS build in #257.
2020-06-05 17:12:35 +02:00
Antonio Scandurra cc54fa6e03 Add missing Metal shader to resources/MANIFEST
Co-Authored-By: Nathan Sobo <nathansobo@gmail.com>
2020-05-28 16:11:23 +02:00
bors-servo 0f35009215
Auto merge of #342 - pcwalton:listener-lifetime, r=pcwalton
Don't restrict render command listeners to the static lifetime
2020-05-16 14:05:57 -04:00
bors-servo 523734d95e
Auto merge of #341 - pcwalton:new-tiling-simd, r=pcwalton
Use SIMD a bit more in the new tiling code.
2020-05-16 13:49:38 -04:00
Sebastian K 18d2b006ac Don't restrict render command listeners to the static lifetime 2020-05-16 10:47:06 -07:00
Patrick Walton 13f9fdc96c Use SIMD a bit more in the new tiling code. 2020-05-16 10:38:34 -07:00
bors-servo 28c4bc194d
Auto merge of #340 - pcwalton:new-tiling, r=pcwalton
Replace the tiling algorithm with the one from "Random Access Vector Graphics".

This is a significant improvement in CPU time, as well as an overall
simplification.
2020-05-15 22:38:27 -04:00
Patrick Walton abecb697be Quit the NanoVG demo when pressing Escape, not any key.
The previous setup was making it hard to take screenshots.
2020-05-15 19:14:32 -07:00
Patrick Walton deee2436c1 Make the NanoVG demo use the filesystem resource loader.
The embedded resource loader doesn't have the needed fonts.
2020-05-15 19:14:08 -07:00
Patrick Walton 6ed3237b10 Remove path rect clipping, since it's no longer required 2020-05-15 19:13:18 -07:00
Patrick Walton 37c993eee6 Remove monotonic conversion, since it's no longer required 2020-05-15 19:12:46 -07:00
Patrick Walton 440510a126 Add an `abs` method to `Vector2F` 2020-05-15 19:11:39 -07:00
Patrick Walton 3433545a76 Minor cleanup in the `line_segment` module 2020-05-15 19:10:56 -07:00
Patrick Walton a67b4dd5b7 Replace the tiling algorithm with the one from "Random Access Vector Graphics".
This is a significant improvement in CPU time, as well as an overall
simplification.
2020-05-15 19:10:12 -07:00
Patrick Walton c61f3e5ae8 Add some new operators to `RectI` 2020-05-15 19:08:39 -07:00
bors-servo 1630a3b97c
Auto merge of #338 - servo:jdm-patch-1, r=jdm
Add homu webhook.
2020-05-13 11:13:11 -04:00
Josh Matthews 3f201e4729
Add homu webhook. 2020-05-13 10:43:48 -04:00
Patrick Walton 8808bfda63
Merge pull request #337 from pcwalton/macos-radeon
Associate texture parameters in shaders with specific texture units, to work around a macOS Radeon driver bug.
2020-05-12 22:08:12 -07:00
Patrick Walton ef0c0e0679 Associate texture parameters in shaders with specific texture units, to work
around a macOS Radeon driver bug.

Also, ensure there is always a dummy texture bound to every parameter in the
OpenGL backend.

These together stop the macOS Radeon drivers from recompiling the shader on
every drawcall.

Possibly addresses #300.
2020-05-12 21:40:38 -07:00
Patrick Walton 33cd3798d7
Merge pull request #335 from Veedrac/master
Change how point_queue and active_edges are sorted for performance
2020-05-11 15:24:59 -07:00
Veedrac 033a150639 Order and sample gradient correctly
Zero-width gradient sections should be ‘ignored’.
The visible endpoints should be precisely the first
and last colors added at that point.

https://html.spec.whatwg.org/multipage/canvas.html#interpolation
2020-05-11 21:47:39 +01:00
Veedrac 6d8a89b8c5 Cleanup: remode redundant ops in tiles.rs 2020-05-11 21:47:39 +01:00
Veedrac 1c48e8900e Faster sorting strategy, remove SortedVector
point_queue is only sorted by y coordinate to coordinate
work to one strip at a time. This is more efficiently handled
by punting later work into a next_point_queue,
and never explicitly sorting the data.

active_edges is only sorted by x coordinate for the tile-by-tile
work in process_old_active_edges. It is much more efficient
to sort once inside that function.
2020-05-11 21:47:35 +01:00
Patrick Walton cbceee85e6
Merge pull request #336 from Veedrac/hidpi_fix
Fix non-integer HiDPI support in demo
2020-05-11 11:19:06 -07:00
Veedrac faea46b9f6 Fix non-integer HiDPI support in demo 2020-05-11 13:14:54 +01:00
Patrick Walton 5ed26819bb
Merge pull request #331 from frewsxcv/frewsxcv-rect
Implement {Add,Sub,Mul}Assign for RectF
2020-05-10 21:33:47 -07:00
Patrick Walton fc515f950f
Merge pull request #329 from frewsxcv/frewsxcv-colors
Promote ColorU functions to `const`.
2020-05-10 21:33:23 -07:00
Patrick Walton 116b528e4e
Merge pull request #330 from frewsxcv/frewsxcv-embedded
Switch to the embedded loader for the examples.
2020-05-10 21:33:04 -07:00
Corey Farwell 9f71feb545
Update main.rs 2020-05-09 12:49:43 -04:00
Corey Farwell e993e350e2 Implement {Add,Sub,Mul}Assign for RectF 2020-05-08 21:25:45 -04:00
Corey Farwell e1ec307b3f Switch to the embedded loader for the examples. 2020-05-08 21:17:23 -04:00
Corey Farwell e26338835b Promote ColorU functions to `const`. 2020-05-08 21:09:38 -04:00
Patrick Walton aa1279d692
Merge pull request #328 from pcwalton/precision-highp
Only define `precision highp sampler2D` in OpenGL ES.
2020-05-08 17:16:35 -07:00
Patrick Walton 2ad02b0b78 Only define `precision highp sampler2D` in OpenGL ES.
Closes #309.
2020-05-08 16:59:40 -07:00
Patrick Walton 1a37b7f819
Merge pull request #327 from pcwalton/glfw-c-example
Add an example showing how to use the Pathfinder C API with GLFW
2020-05-08 16:53:06 -07:00
Patrick Walton feb6cca419
Merge pull request #326 from pcwalton/c-font-context-docs
Document `PFCanvasFontContextCreateWithFonts()`.
2020-05-08 15:10:07 -07:00
Patrick Walton bbf4c88d0d Add an example showing how to use the Pathfinder C API with GLFW
Closes #258.
2020-05-08 15:09:21 -07:00
Patrick Walton fd57193442
Merge pull request #325 from pcwalton/update-embedded
Update the resource manifest for recent changes
2020-05-08 14:33:53 -07:00
Patrick Walton b669cc7087 Document `PFCanvasFontContextCreateWithFonts()`.
Closes #247.
2020-05-08 14:27:41 -07:00
Patrick Walton d039e9009e
Merge pull request #324 from pcwalton/metal-layer-non-macos
Provide a placeholder definition of `CAMetalLayer` in the C API.
2020-05-08 14:18:00 -07:00
Patrick Walton 84cd92aea4 Update the resource manifest for recent changes 2020-05-08 14:17:13 -07:00
Patrick Walton 9998fe49bd Provide a placeholder definition of `CAMetalLayer` in the C API.
Closes #260.
2020-05-08 14:07:06 -07:00
Patrick Walton d3ceef749f
Merge pull request #323 from pcwalton/surfmanup
Upgrade to the latest master surfman
2020-05-08 13:17:52 -07:00
Patrick Walton 41c0c5f071 Upgrade to the latest master surfman 2020-05-08 12:47:58 -07:00
Patrick Walton e4edb23360
Merge pull request #322 from pcwalton/surfman-x11
Switch to using surfman in X11 mode.
2020-05-08 12:45:32 -07:00
Patrick Walton 5362d3a51e
Merge pull request #321 from pcwalton/default-compute
Enable compute shader by default if the OpenGL version is high enough.
2020-05-08 12:28:41 -07:00
Patrick Walton 90fb36f199 Switch to using surfman in X11 mode.
Partially addresses #310.
2020-05-08 12:22:46 -07:00
Patrick Walton 2421de6616 Enable compute shader by default if the OpenGL version is high enough. 2020-05-08 12:16:31 -07:00
Patrick Walton e766721f37 Update `README.md` 2020-05-07 21:46:13 -07:00
Patrick Walton 46070914be
Merge pull request #320 from pcwalton/painting-nothing
Clear the canvas to the background color if no drawing command did so.
2020-05-07 21:45:23 -07:00
Patrick Walton 6299d2c36b Clear the canvas to the background color if no drawing command did so.
Closes #318.
2020-05-07 21:36:13 -07:00