Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
circle_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_CIRCLE_GEOMETRY_H_
6#define FLUTTER_IMPELLER_ENTITY_GEOMETRY_CIRCLE_GEOMETRY_H_
7
9
10namespace impeller {
11
12// Geometry class that can generate vertices (with or without texture
13// coordinates) for either filled or stroked circles
14class CircleGeometry final : public Geometry {
15 public:
16 explicit CircleGeometry(const Point& center, Scalar radius);
17
18 explicit CircleGeometry(const Point& center,
19 Scalar radius,
21
22 ~CircleGeometry() = default;
23
24 // |Geometry|
25 bool CoversArea(const Matrix& transform, const Rect& rect) const override;
26
27 // |Geometry|
28 bool IsAxisAlignedRect() const override;
29
30 private:
31 // |Geometry|
33 const Entity& entity,
34 RenderPass& pass) const override;
35
36 // |Geometry|
37 std::optional<Rect> GetCoverage(const Matrix& transform) const override;
38
39 Point center_;
40 Scalar radius_;
41 Scalar stroke_width_;
42
43 CircleGeometry(const CircleGeometry&) = delete;
44
45 CircleGeometry& operator=(const CircleGeometry&) = delete;
46};
47
48} // namespace impeller
49
50#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_CIRCLE_GEOMETRY_H_
static SkScalar center(float pos0, float pos1)
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...
GeometryResult GetPositionBuffer(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
bool IsAxisAlignedRect() const override
std::optional< Rect > GetCoverage(const Matrix &transform) const override
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition render_pass.h:33
float Scalar
Definition scalar.h:18
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition p3.cpp:47
const Scalar stroke_width
A 4x4 matrix using column-major storage.
Definition matrix.h:37