Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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:
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 Scalar ComputeAlphaCoverage(const Entity& entity) const override;
32
33 private:
34 // |Geometry|
35 GeometryResult GetPositionBuffer(const ContentContext& renderer,
36 const Entity& entity,
37 RenderPass& pass) const override;
38
39 // |Geometry|
40 GeometryResult::Mode GetResultMode() const override;
41
42 // |Geometry|
43 std::optional<Rect> GetCoverage(const Matrix& transform) const override;
44
45 // Private for benchmarking and debugging
46 static std::vector<SolidFillVertexShader::PerVertexData>
47 GenerateSolidStrokeVertices(const Path::Polyline& polyline,
49 Scalar miter_limit,
50 Join stroke_join,
51 Cap stroke_cap,
53
56
57 bool SkipRendering() const;
58
59 Path path_;
60 Scalar stroke_width_;
61 Scalar miter_limit_;
62 Cap stroke_cap_;
63 Join stroke_join_;
64
66
67 StrokePathGeometry& operator=(const StrokePathGeometry&) = delete;
68};
69
70} // namespace impeller
71
72#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:52
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.
Scalar ComputeAlphaCoverage(const Entity &entity) const override
StrokePathGeometry(const Path &path, Scalar stroke_width, Scalar miter_limit, Cap stroke_cap, Join stroke_join)
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
Definition: switches.h:57
Join
Definition: path.h:24
float Scalar
Definition: scalar.h:18
Cap
Definition: path.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