Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
stroke_path_geometry.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_STROKE_PATH_GEOMETRY_H_
6#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_STROKE_PATH_GEOMETRY_H_
7
9
10namespace impeller {
11
12/// @brief A geometry that is created from a stroked path object.
13class StrokePathGeometry final : public Geometry {
14 public:
15 StrokePathGeometry(const Path& path,
17 Scalar miter_limit,
18 Cap stroke_cap,
19 Join stroke_join);
20
22
23 Scalar GetStrokeWidth() const;
24
25 Scalar GetMiterLimit() const;
26
27 Cap GetStrokeCap() const;
28
29 Join GetStrokeJoin() const;
30
31 private:
32 // |Geometry|
34 const Entity& entity,
35 RenderPass& pass) const override;
36
37 // |Geometry|
38 GeometryResult::Mode GetResultMode() const override;
39
40 // |Geometry|
41 std::optional<Rect> GetCoverage(const Matrix& transform) const override;
42
43 // Private for benchmarking and debugging
44 static std::vector<SolidFillVertexShader::PerVertexData>
45 GenerateSolidStrokeVertices(const Path::Polyline& polyline,
47 Scalar miter_limit,
48 Join stroke_join,
49 Cap stroke_cap,
51
54
55 bool SkipRendering() const;
56
57 Path path_;
58 Scalar stroke_width_;
59 Scalar miter_limit_;
60 Cap stroke_cap_;
61 Join stroke_join_;
62
64
65 StrokePathGeometry& operator=(const StrokePathGeometry&) = delete;
66};
67
68} // namespace impeller
69
70#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_STROKE_PATH_GEOMETRY_H_
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
Definition path.h:51
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition render_pass.h:33
A geometry that is created from a stroked path object.
GeometryResult::Mode GetResultMode() const override
std::optional< Rect > GetCoverage(const Matrix &transform) const override
GeometryResult GetPositionBuffer(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
float Scalar
Definition scalar.h:18
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition p3.cpp:47
const Scalar stroke_width
const Scalar scale
const Path::Polyline & polyline
A 4x4 matrix using column-major storage.
Definition matrix.h:37