rust-skia

Rust Bindings for the Skia Graphics Library

MIT License

Downloads
1.7M
Stars
1.4K
Committers
39

Bot releases are hidden (Show)

rust-skia - 0.78.2 Latest Release

Published by pragmatrix 21 days ago

What's Changed

Full Changelog: https://github.com/rust-skia/rust-skia/compare/0.78.1...0.78.2

rust-skia - 0.78.1

Published by pragmatrix 23 days ago

This version fixes a build error with XCode 16 / Apple Clang 16 on macOS (#1033)

Thank you @tronical for reporting and tracking down this issue.

rust-skia - 0.78.0

Published by pragmatrix about 1 month ago

This release updates aligns the Rust bindings to Skia's milestone 129 in #993 #1007 and #1022 (Release Notes):

  • #1002 fixes a build with coretext, contributed by @tronical
  • #974 ports window examples to winit 0.30
  • #1010 removes an excess parameter from FontMgr::match_style, reported by @jianse in #1008
  • #1011 blocklists PFN_vkVoidFunction to fix an error on Android arm7, reported by @triniwiz in #1009
  • #1000 updated the windows crate dependency from 0.56.0 to 0.58.0
  • #1023 adds Vizia release code binaries, requested by @Greatness7 in #961
  • #1029 adds is_trivial_abi=false to Windows builds to avoid ABI issues, reported and contributed by @ennis in #1028

This release also fixes a problem with the recently introduced Arc type in release 0.75.0, reported by @WZY1999428 in #1026.

Thank you a lot for your contributions.

rust-skia - 0.75.0 Milestone 126

Published by pragmatrix 5 months ago

This release updates the Rust bindings to align with Skia's milestone 126 in #971 #979 (Release Notes):

  • #977 adds support for emscripten versions 3.1.57+, reported by @hzuo in #975.
  • #978 improves Clang / LLVM 18 build compatibility.
  • #981 adds support for Android NDK r26d.
  • #983 adds freetype-woff2 feature to support woff2, contributed by @namse.
  • #986 fixes a crash when emojis were used in Paragraphs. Reported by @marc2332 in #985 and contributed by @tronical in https://github.com/google/skia/pull/162.
rust-skia - 0.73.0

Published by pragmatrix 6 months ago

This release updates the Rust bindings to align with Skia's milestone 124 in #957 (Release Notes):

Furthermore:

  • #955 makes vk::ImageInfo image and alloc fields private and adds accessors because of a safety issue, reported by @Greatness7 in #953.
  • #954 simplifies the d3d-window example, contributed by @Greatness7.
  • #967 fixes failing testcases with SKIA_DEBUG=1.
  • #966 fixes SVG text rendering, which got broken in 0.70.0, reported by @triniwiz in #960.

Full Changelog: https://github.com/rust-skia/rust-skia/compare/0.72.0...0.73.0

rust-skia - 0.72.0

Published by pragmatrix 7 months ago

This release updates the Rust bindings to align with Skia's milestone 123 in #938 (Release Notes):

And also:

  • #943 unescapes ninja definitions, fixing a build problem with SKIA_DEBUG=1.
  • #944 makes the use of FreeType explicit. This prevents a warning when GN was set up.
  • #945 adds a skia-org example that loads a custom font. Inspired by @LFernandoMB in #942.
  • 0f8314e6981b9d92133afb15eff4164ba8ea79a1 makes the DirectWrite font manager the default on Windows, fixing a problem with variable fonts, reported by @marc2332 and @geom3trik in #948.
rust-skia - Milestone 122

Published by pragmatrix 8 months ago

This is release updates the Rust bindings to align with Skia's milestone 122 in #925 (Release Notes):

Furthermore:

  • #929 wraps SkCanvas::drawAtlas, noted by @triniwiz in #926.
  • #934 supports rendering PDFs to any Rust type that implements io::Write, requested by @giacomocariello in #584.

With milestone 122 the default font manager were removed from Skia. To keep it easier to access preinstalled system fonts, we tried to reproduce the behavior of pre 122 milestone releases here: https://github.com/rust-skia/rust-skia/blob/65d69e3427e3a085d1020564b7f92e362d9fe50d/skia-bindings/src/bindings.cpp#L1546-L1603. The replacement code got tested on the major desktop platforms and therefore may not work on other platforms like Android oder iOS. If you experience incompatibilities with typefaces and fonts compared to 0.70.0 (milestone 121), please drop us a note.

rust-skia - 0.70.0 Milestone 121

Published by pragmatrix 9 months ago

This is release updates the Rust bindings to align with Skia's milestone 121 in #902 (Release Notes):

Furthermore:

  • #894 Change winapi, wio to windows-rs, contributed by @namse, reported in #893
  • #907 Typo in Typeface::from_data deprecation warning, contributed by @warrd.
  • #912 Improve the safety of functions that expect text in different encodings, reported in #886 by @Caellian.
  • #918 Added some missing comments to wrap_backend_render_target, contributed by @FledgeXu.
  • #919 Disable framebufferOnly for CAMetalLayer, contributed by @FledgeXu.
  • #901 switch from ureq to curl for downloading binaries, contributed by @coderedart, as suggested in #897.
  • #916 Fix builds that enable textlayout and use system libraries, reported in #913 by @aimixsaka
  • #757 Add aarch64-unknown-linux-gnu qa and release CI jobs, reported by @zhengcan, @ctrlcctrlv, and @Subject38

Notable and breaking changes:

  • The Codec::Decoder trait that was introduced a while back was replaced by codecs::Decoder that actually encapsulates the underlying Skia type. This made it possible to create the wrapper Codec::from_stream. Details can be found in #902.
  • The switch from winapi to windows-rs introduces a number of incompatibilities for projects that use the d3d feature. Take a look at the changes of skia-safe/examples/d3d-window and skia-org in #894 to get an overview what's needed to update your application.
  • The parameter TextEncoding was removed from functions that support text in different encodings. For more details how text encoding is derived directly from the text, take a look at the implementations of the EncodedText trait in #912.
  • For downloading binaries and sources, the curl command line tool is now a prerequisite. This is currently experimental. So if you run into troubles, don't forget to open an issue or even better dive into #901.
  • The new aarch64-unknown-linux-gnu binaries are untested yet, so feedback is highly appreciated.

And then you should all take a look at @coderedart's ideas for building a lighter version of Skia bindings for Rust that are based on SkiaSharp's C bindings. Focusing on reducing build time and dependencies, the project progressed tremendously over the last few days. For an overview of what's behind that all, head over to https://github.com/rust-skia/rust-skia/discussions/897#discussioncomment-8135116.

Thank you for your contributions!

rust-skia - 0.69.0 Milestone 120

Published by pragmatrix 11 months ago

This is release updates the Rust bindings to align with Skia's milestone 120 in #865 (Release Notes):

And additionally:

  • @ynuwenhof reported in #866 that debug formatting of DirectContext was panicking, which got fixed in #867 by removing the deprecated resource_cache_limits function.
  • #871 updates the examples to use winit version 0.29.
  • @romanzes reported in #872 that an embedded SVG fails to render and fixed the problem in #873 by preserving the base64 padding for SVG embeddings.
  • @syrel changed Canvas::draw_shadow() so that it accepts a shared instead of a exclusive Canvas reference in #876. And after going through all impl Canvas items, a few more functions were adjusted accordingly in #878.
  • @Caellian noticed that SkData::MakeFromFileName misses a wrapper in #879, which got added in #881.
  • @akowi-sknobloch reported in #884 that the color parameter of the displacement_map should be an Option, which was fixed in #885.

Thank you for the contributions!

rust-skia - 0.68.0

Published by pragmatrix 12 months ago

This release updates Skia to milestone 119 in #843 (Release Notes):

And more:

  • @hack3ric improved support for RISC-V architectures in #851 and #854 and fixed a problem in which dependencies were not synchronized when SKIA_USE_SYSTEM_LIBRARIES was used on Linux in #852.
  • @tfemby added documentation to the skia-bindings readme to explain how to use prebuilt binaries in an offline environment #853.
  • #857 added has_foreground and has_background functions to the TextStyle type, which were reported missing by @romanzes in #856.
  • @tronical improved cross-compilation support for the FreeType library in #848.

Within the update to Milestone 119 in #843, there were some notable changes:

  • The minimum platform version for iOS was increases from 10.0 to 12.0.
  • macOS and iOS Metal GPU compilation got improved: Previously, the internal GR_METAL_SDK_VERSION preprocessor variable was set to the wrong value which may have caused unintended side effects.
  • More documentation was added to core/color_filter.rs core/color_type.rs, core/shader.rs, core/pdf_document.rs, effects/image_filters.rs, gpu/context_options.rs, and modules/paragraph/paragraph.rs.
rust-skia - 0.67.0

Published by pragmatrix about 1 year ago

This release updates Skia to Milestone 118 in #834 (Release Notes) and fixes two soundness bugs at the expense of some porting work:

  • #836 removes the Send and Sync traits from Paragraph (enabled with the feature textlayout). The type was initially intended to be thread safe, but while reading the related C++ code, I've found it isn't and posted a bug report which hasn't been attended to for years, so I've decided to represent that fact in Rust. Therefore, if you were crossing thread boundaries with a Paragraph value, you need to rethink your design.
  • In a response to #814 from @ennis, in which it was proven that two &mut Canvas references may point to the same address, I've decided in #816 to expose Canvas through a shared reference and leave the interior mutability to the C++ part. This makes it safe to use from Rust, but may also turn out to be confusing, because Canvas does use internal state, but also acts as a simple facade for the thing it renders to. The consequence is some - albeit simple - porting work, namely converting all &mut Canvas usages to &Canvas. This is something we won't roll back after the adoption of this release, so if there are objections or other ideas on how to tackle this, now is the time.

Also:

  • In #837 @Kethku contributed missing flags to util/shadow_utils.rs.
  • Reported by @syrel in #657, #838 fixed a probing problem with Python when the feature textlayout was enabled. Thank you, @Kethku, for reminding me of this long standing issue.
rust-skia - 0.66.3

Published by pragmatrix about 1 year ago

This is a hotfix release that updates Skia (#842) which in turn fixes a critical vulnerability in the libwebp library. This CVE affects all prior skia-safe and skia-bindings releases if one of the webp features were enabled.

For more details, take a look at issue #841 . And thank you a lot @marc2332 for the report.

rust-skia - 0.66.2

Published by pragmatrix about 1 year ago

This is a small maintenance release that fixes a build problem on Windows when the environment variable VCINSTALLDIR ends in a backslash character. Thankfully contributed by @tronical in #835.

rust-skia - 0.66.1

Published by pragmatrix about 1 year ago

This release fixes a problem with downloading the prebuilt binaries or - if they are not available - sources. Thankfully reported by @tronical in https://github.com/rust-skia/rust-skia/issues/720#issuecomment-1715288397

rust-skia -

Published by pragmatrix about 1 year ago

With this release a number of significant changes are arriving that may need some porting work. This release includes the updates to Skia's milestone's 116 (#820) and 117(#826), Skia release notes.

In detail:

  • There are new Rust wrappers: ColorTable, tiled_image_utils.
  • DeferredDisplayListRecorder, DeferredDisplayList, and the image filter, alpha_threshold were removed.
  • Deprecated flush* functions were removed from Surface, instead the flush_surface* functions in DirectContext should be used. The function resolve_msaa was moved to gpu::surfaces.
  • SurfaceCharacterization was removed.
  • Skia's script to locate the Clang library version directory can not handle single component version numbers as used in LLVM 16, so we've decided to get around that in locating the directory directly in build.rs and forward it to Skia's build as a gn argument. #830
  • Alongside the transition from Skia's Ganesh rendering engine to Graphite, several functions were moved around: If you get deprecated warnings or miss gpu functions, take a look in the gpu::surfaces, gpu::backend_formats, gpu::backend_textures, and gpu::backend_render_targets.
  • Wrappers were added for creating Paths from Paragraph lines and TextBlobs.

Furthermore:

  • New wrappers for Paragraph::visit and Paragraph::extended_visit were added. Requested by @giantpand2000 in #827.

This release is a bit late because there were difficulties in making milestone 116 compile in all feature configurations, which were resolved with Skia's update to milestone 117. Also diffing the API surface does not work at the moment, so if you experience unexpected difficulties porting code drop us a note.

rust-skia - 0.64.0

Published by pragmatrix about 1 year ago

This release aligns rust-skia with Skia's milestone 115 (#808, Skia release notes).

Some notable changes:

  • c1f4ce95b2e1a4363be746a42e3ae63e509c7179 adds support for contains for references of Point, IRect, and Rect
  • ca5c099de2256b92f468e1984f155398ceeb2e1c changes the signatures for functions that expect a optional DirectContext or RecordingContext. Before an Option<()> was used. With this version, non-gpu builds define DirectContext and RecordingContext as empty enums that can not be instantiated. This way, the function signatures for gpu and non-gpu stay the same.
  • c22ce78ab6d91cd5bb90ee6cfa1e20cfb4791bbb adds wrappers for several image format decoders that in turn add support for decoding images from Rust io::Read streams.

Further Contributions:

  • #810 adds missing textlayout decoration functions, reported by @Tropix126 in #809.
  • #811 and #813 improve the usability of set_decoration, specifically the bad default of thickness_multiplier, contributed by @marc2332.
  • #821 overrides the ar command when building with Emscripten, contributed by @tomb-msft.
rust-skia - 0.63.0

Published by pragmatrix over 1 year ago

This release aligns rust-skia with Skia's milestone 114 (#801, Skia release notes) and brings with it some bigger API changes.

  • If one or more of the GPU backend features are enabled, encode() functions may now need a gpu::DirectContext. For example, to encode an Image, retrieve the gpu::DirectContext from Surface::direct_context() and pass it to encode(). If no GPU features are enabled, gpu::DirectContext is just an alias for the () type, and the encode() functions ignore the parameter.
  • There are new wrappers for the JPEG, PNG, and WebP encoders, which can be found in the encode module.
  • Pixmap now has a lifetime that relates to the pixels it refers to. This should make it safer to use and removes the need for the Borrows wrapper.
  • A number of the functions that construct Images got deprecated and their implementation moved to gpu::images. This is part of the ongoing transition from the Ganesh to the Graphite rendering engine.

Furthermore:

  • #806 fixes the creation YUVABackendTextures. Contributed by @tronical.
  • #807 fixes a memory corruption when creating YUVABackendTextures that was introduced in #751. Contributed by @tronical
rust-skia - 0.62.0

Published by pragmatrix over 1 year ago

This release aligns rust-skia with Skia's milestone 113 (#776, #787). Skia release notes can be found here.

Furthermore:

  • #783 changes the gl-window example so that it uses the minimum number of samples which disables MSAA. Problems with using the maximum number of samples were reported in #764 by @Speykious and in #782 by @marc2332.
  • #785 fixes a resizing problem in the gl-window example. Contributed by @marc2332
  • #786 adds bindings for SkFontMgr::RefEmpty(). Contributed by @wecing
  • #692 added documentation to core/surface.rs.
  • #645 added support for file:// paths to the SKIA_BINARIES_URL environment variable. This was suggested in #644 by @FancyFlame to help out in areas with a bad network connection.
  • #791 adds Codec::get_frame_info(), contribued by @Eywek.
  • #793 adds rudimentary documentation to the textlayout module (skparagraph), requested in #792 by @FancyFlame.
  • #796 adds support for building rust-skia from a non-git repository. Contributed by @antonsmetanin.
  • #798 writes the bindings.rs to the target directory. Previously, we generated bindings.rs in the src directory, because the popular Rust IDEs (CLion and VSCode) were not able to resolve symbols when the bindings were pulled in by using the !include macro.

Thank you all for your contributions!

rust-skia - 0.60.0

Published by pragmatrix over 1 year ago

This release aligns rust-skia with Skia's milestone 111 (#749, #772, Skia release notes)

Also:

  • #760 @freqmod updated skia-safe's gl-window example to work with glutin 0.30.
  • #762 @tronical added new_load_with_cstr to the gl::interface simplifying the interopability with the latest glutin versions.
  • #746, #767 @tronical added unit tests for the skia-bindings build scripts.
  • #778 fixes a memory leak and potential undefined behavior (UB) in the Codec type. Reported by @Eywek.

Thank you for the contributions.

rust-skia - 0.58.0

Published by pragmatrix almost 2 years ago

This release aligns rust-skia with Skia's milestone 109 (#732, Skia release notes)

Furthermore:

  • #744 fixes compilation with meta-rust in Yocto, contributed by @tronical.
  • #745 fixes external library linkage (freetype, etc.) when building against Yocto, contributed by @tronical.
  • #751 uses RefHandle instead of Handle to represent a GrBackendTexture in Rust, reported by @DorianRudolph in #750.
  • And because the new Freya binaries (#737) were missing in 0.57.0, 3e3c012335c2258c0e1008475bc72cd7abb3a608 updates the GitHub workflows, reported by @marc2332.
Package Rankings
Top 3.74% on Crates.io
Badges
Extracted from project README
crates.io license Windows QA Linux QA macOS QA Rust-skia icon