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 
8 
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 {
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 
31  const Rect& rect) const {
32  return false;
33 }
34 
36  return false;
37 }
38 
40  const StrokeParameters& parameters)
41  : StrokePathSourceGeometry(parameters), ellipse_source_(bounds) {}
42 
44  return ellipse_source_;
45 }
46 
47 } // namespace impeller
Tessellator & GetTessellator() const
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...
bool IsAxisAlignedRect() const override
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
Definition: entity.cc:44
static GeometryResult ComputePositionGeometry(const ContentContext &renderer, const Tessellator::VertexGenerator &generator, const Entity &entity, RenderPass &pass)
Definition: geometry.cc:26
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:30
const PathSource & GetSource() const override
StrokeEllipseGeometry(const Rect &rect, const StrokeParameters &parameters)
An abstract Geometry base class that produces fillable vertices representing the stroked outline from...
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
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
A structure to store all of the parameters related to stroking a path or basic geometry object.
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
Definition: rect.h:476