Rust Bindings for the Skia Graphics Library
MIT License
Bot releases are visible (Hide)
Full Changelog: https://github.com/rust-skia/rust-skia/compare/0.78.1...0.78.2
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.
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):
FontMgr::match_style
, reported by @jianse in #1008is_trivial_abi=false
to Windows builds to avoid ABI issues, reported and contributed by @ennis in #1028This 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.
Published by pragmatrix 5 months ago
This release updates the Rust bindings to align with Skia's milestone 126 in #971 #979 (Release Notes):
freetype-woff2
feature to support woff2, contributed by @namse.Paragraph
s. Reported by @marc2332 in #985 and contributed by @tronical in https://github.com/google/skia/pull/162.Published by pragmatrix 6 months ago
This release updates the Rust bindings to align with Skia's milestone 124 in #957 (Release Notes):
Furthermore:
vk::ImageInfo
image
and alloc
fields private and adds accessors because of a safety issue, reported by @Greatness7 in #953.SKIA_DEBUG=1
.Full Changelog: https://github.com/rust-skia/rust-skia/compare/0.72.0...0.73.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:
SKIA_DEBUG=1
.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:
SkCanvas::drawAtlas
, noted by @triniwiz in #926.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.
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:
winapi
, wio
to windows-rs
, contributed by @namse, reported in #893Typeface::from_data
deprecation warning, contributed by @warrd.wrap_backend_render_target
, contributed by @FledgeXu.framebufferOnly
for CAMetalLayer
, contributed by @FledgeXu.textlayout
and use system libraries, reported in #913 by @aimixsakaaarch64-unknown-linux-gnu
qa and release CI jobs, reported by @zhengcan, @ctrlcctrlv, and @Subject38Notable and breaking changes:
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.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.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.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.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!
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:
DirectContext
was panicking, which got fixed in #867 by removing the deprecated resource_cache_limits
function.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.SkData::MakeFromFileName
misses a wrapper in #879, which got added in #881.color
parameter of the displacement_map
should be an Option
, which was fixed in #885.Thank you for the contributions!
Published by pragmatrix 12 months ago
This release updates Skia to milestone 119 in #843 (Release Notes):
And more:
SKIA_USE_SYSTEM_LIBRARIES
was used on Linux in #852.has_foreground
and has_background
functions to the TextStyle
type, which were reported missing by @romanzes in #856.Within the update to Milestone 119 in #843, there were some notable changes:
GR_METAL_SDK_VERSION
preprocessor variable was set to the wrong value which may have caused unintended side effects.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
.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:
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.&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:
util/shadow_utils.rs
.textlayout
was enabled. Thank you, @Kethku, for reminding me of this long standing issue.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.
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.
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
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:
ColorTable
, tiled_image_utils
.DeferredDisplayListRecorder
, DeferredDisplayList
, and the image filter, alpha_threshold
were removed.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.build.rs
and forward it to Skia's build as a gn
argument. #830gpu
functions, take a look in the gpu::surfaces
, gpu::backend_formats
, gpu::backend_textures
, and gpu::backend_render_targets
.Path
s from Paragraph
lines and TextBlob
s.Furthermore:
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.
Published by pragmatrix about 1 year ago
This release aligns rust-skia with Skia's milestone 115 (#808, Skia release notes).
Some notable changes:
contains
for references of Point
, IRect
, and Rect
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.io::Read
streams.Further Contributions:
set_decoration
, specifically the bad default of thickness_multiplier
, contributed by @marc2332.ar
command when building with Emscripten, contributed by @tomb-msft.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.
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.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.Image
s 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:
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:
SkFontMgr::RefEmpty()
. Contributed by @wecingcore/surface.rs
.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.Codec::get_frame_info()
, contribued by @Eywek.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!
Published by pragmatrix over 1 year ago
This release aligns rust-skia with Skia's milestone 111 (#749, #772, Skia release notes)
Also:
gl-window
example to work with glutin 0.30.new_load_with_cstr
to the gl::interface
simplifying the interopability with the latest glutin versions.Thank you for the contributions.
Published by pragmatrix almost 2 years ago
This release aligns rust-skia with Skia's milestone 109 (#732, Skia release notes)
Furthermore:
RefHandle
instead of Handle
to represent a GrBackendTexture
in Rust, reported by @DorianRudolph in #750.0.57.0
, 3e3c012335c2258c0e1008475bc72cd7abb3a608 updates the GitHub workflows, reported by @marc2332.