10 : p0_(p0), p1_(p1), width_(
width), cap_(cap) {
16 auto determinant =
transform.GetDeterminant();
17 if (determinant == 0) {
26 bool allow_zero_length)
const {
32 auto along = p1_ - p0_;
35 if (!allow_zero_length) {
39 return {stroke_half_width, 0};
41 return along * stroke_half_width /
length;
45bool LineGeometry::ComputeCorners(
Point corners[4],
47 bool extend_endpoints)
const {
48 auto along = ComputeAlongVector(
transform, extend_endpoints);
53 auto across =
Vector2(along.y, -along.x);
54 corners[0] = p0_ - across;
55 corners[1] = p1_ - across;
56 corners[2] = p0_ + across;
57 corners[3] = p1_ + across;
58 if (extend_endpoints) {
67GeometryResult LineGeometry::GetPositionBuffer(
const ContentContext&
renderer,
69 RenderPass& pass)
const {
70 using VT = SolidFillVertexShader::PerVertexData;
76 std::shared_ptr<Tessellator> tessellator =
renderer.GetTessellator();
77 auto generator = tessellator->RoundCapLine(
transform, p0_, p1_, radius);
86 auto& host_buffer =
renderer.GetTransientsBuffer();
89 BufferView vertex_buffer = host_buffer.Emplace(
90 count *
sizeof(VT),
alignof(VT), [&corners](uint8_t*
buffer) {
91 auto vertices =
reinterpret_cast<VT*
>(
buffer);
92 for (
auto& corner : corners) {
99 return GeometryResult{
103 .vertex_buffer = vertex_buffer,
104 .vertex_count =
count,
107 .transform = entity.GetShaderTransform(pass),
111std::optional<Rect> LineGeometry::GetCoverage(
const Matrix&
transform)
const {
117 for (
int i = 0;
i < 4;
i++) {
132 return cap_ !=
Cap::kRound && (p0_.x == p1_.
x || p0_.y == p1_.
y);
static GeometryResult ComputePositionGeometry(const ContentContext &renderer, const Tessellator::VertexGenerator &generator, const Entity &entity, RenderPass &pass)
LineGeometry(Point p0, Point p1, Scalar width, Cap cap)
static Scalar ComputePixelHalfWidth(const Matrix &transform, Scalar width)
bool IsAxisAlignedRect() const override
bool CoversArea(const Matrix &transform, const Rect &rect) const override
Determines if this geometry, transformed by the given transform, will completely cover all surface ar...
static const char * begin(const StringSlice &s)
#define FML_DCHECK(condition)
static float max(float r, float g, float b)
sk_sp< SkBlender > blender SkRect rect
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
@ kNone
Does not use the index buffer.
constexpr float kEhCloseEnough
static const GeometryResult kEmptyResult
SK_API sk_sp< PrecompileColorFilter > Matrix()
SIN Vec< N, float > abs(const Vec< N, float > &x)
SIN Vec< N, float > sqrt(const Vec< N, float > &x)
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
A 4x4 matrix using column-major storage.
static constexpr std::optional< TRect > MakePointBounds(const U &value)