| 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 } // namespace impeller
impeller::EllipseGeometry::EllipseGeometry
EllipseGeometry(Rect bounds)
Definition: ellipse_geometry.cc:13
impeller::Entity::GetTransform
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
Definition: entity.cc:47
impeller::TRect::TransformBounds
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
Definition: rect.h:466
impeller::Geometry::ComputePositionGeometry
static GeometryResult ComputePositionGeometry(const ContentContext &renderer, const Tessellator::VertexGenerator &generator, const Entity &entity, RenderPass &pass)
Definition: geometry.cc:24
impeller::Entity
Definition: entity.h:20
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:213
impeller::GeometryResult
Definition: geometry.h:26
ellipse_geometry.h
impeller::ContentContext::GetTessellator
std::shared_ptr< Tessellator > GetTessellator() const
Definition: content_context.cc:546
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:33
line_geometry.h
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
Definition: allocation.cc:12
impeller::ContentContext
Definition: content_context.h:366
impeller::TRect< Scalar >
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37