| Flutter Impeller |

ellipse_geometry.cc
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 #include <algorithm>
6
7 #include "flutter/impeller/entity/geometry/ellipse_geometry.h"
8
9 #include "flutter/impeller/entity/geometry/line_geometry.h"
10
11 namespace impeller {
12
13 EllipseGeometry::EllipseGeometry(Rect bounds) : bounds_(bounds) {}
14
15 GeometryResult EllipseGeometry::GetPositionBuffer(
16 const ContentContext& renderer,
17 const Entity& entity,
18 RenderPass& pass) const {
19 return ComputePositionGeometry(
20 renderer,
21 renderer.GetTessellator().FilledEllipse(entity.GetTransform(), bounds_),
22 entity, pass);
23 }
24
25 std::optional<Rect> EllipseGeometry::GetCoverage(
26 const Matrix& transform) const {
27 return bounds_.TransformBounds(transform);
28 }
29
30 bool EllipseGeometry::CoversArea(const Matrix& transform,
31 const Rect& rect) const {
32 return false;
33 }
34
35 bool EllipseGeometry::IsAxisAlignedRect() const {
36 return false;
37 }
38
39 StrokeEllipseGeometry::StrokeEllipseGeometry(const Rect& bounds,
40 const StrokeParameters& parameters)
41 : StrokePathSourceGeometry(parameters), ellipse_source_(bounds) {}
42
43 const PathSource& StrokeEllipseGeometry::GetSource() const {
44 return ellipse_source_;
45 }
46
47 } // namespace impeller
impeller::ContentContext
Definition: content_context.h:138
impeller::ContentContext::GetTessellator
Tessellator & GetTessellator() const
Definition: content_context.cc:935
impeller::EllipseGeometry::EllipseGeometry
EllipseGeometry(Rect bounds)
Definition: ellipse_geometry.cc:13
impeller::EllipseGeometry::CoversArea
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...
Definition: ellipse_geometry.cc:30
impeller::EllipseGeometry::IsAxisAlignedRect
bool IsAxisAlignedRect() const override
Definition: ellipse_geometry.cc:35
impeller::Entity
Definition: entity.h:26
impeller::Entity::GetTransform
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
Definition: entity.cc:44
impeller::Geometry::ComputePositionGeometry
static GeometryResult ComputePositionGeometry(const ContentContext &renderer, const Tessellator::VertexGenerator &generator, const Entity &entity, RenderPass &pass)
Definition: geometry.cc:26
impeller::PathSource
Definition: path_source.h:55
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:30
impeller::StrokeEllipseGeometry::GetSource
const PathSource & GetSource() const override
Definition: ellipse_geometry.cc:43
impeller::StrokeEllipseGeometry::StrokeEllipseGeometry
StrokeEllipseGeometry(const Rect &rect, const StrokeParameters &parameters)
Definition: ellipse_geometry.cc:39
impeller::StrokePathSourceGeometry
An abstract Geometry base class that produces fillable vertices representing the stroked outline from...
Definition: stroke_path_geometry.h:94
impeller::Tessellator::FilledEllipse
EllipticalVertexGenerator FilledEllipse(const Matrix &view_transform, const Rect &bounds)
Create a |VertexGenerator| that can produce vertices for a filled ellipse inscribed within the given ...
Definition: tessellator.cc:606
ellipse_geometry.h
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:214
line_geometry.h
impeller
Definition: allocation.cc:12
impeller::GeometryResult
Definition: geometry.h:21
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::StrokeParameters
A structure to store all of the parameters related to stroking a path or basic geometry object.
Definition: stroke_parameters.h:28
impeller::TRect< Scalar >
impeller::TRect::TransformBounds
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
Definition: rect.h:476