diff --git a/impeller/entity/contents/vertices_contents.cc b/impeller/entity/contents/vertices_contents.cc index f789228972be2..d34f48e109fd5 100644 --- a/impeller/entity/contents/vertices_contents.cc +++ b/impeller/entity/contents/vertices_contents.cc @@ -25,7 +25,7 @@ std::optional VerticesContents::GetCoverage(const Entity& entity) const { return geometry_->GetCoverage(entity.GetTransformation()); }; -void VerticesContents::SetGeometry(std::unique_ptr geometry) { +void VerticesContents::SetGeometry(std::unique_ptr geometry) { geometry_ = std::move(geometry); } diff --git a/impeller/entity/contents/vertices_contents.h b/impeller/entity/contents/vertices_contents.h index 191214168c935..b509b0a3b39fe 100644 --- a/impeller/entity/contents/vertices_contents.h +++ b/impeller/entity/contents/vertices_contents.h @@ -26,7 +26,7 @@ class VerticesContents final : public Contents { ~VerticesContents() override; - void SetGeometry(std::unique_ptr geometry); + void SetGeometry(std::unique_ptr geometry); void SetColor(Color color); @@ -42,7 +42,7 @@ class VerticesContents final : public Contents { public: Color color_; - std::unique_ptr geometry_; + std::unique_ptr geometry_; BlendMode blend_mode_ = BlendMode::kSource; FML_DISALLOW_COPY_AND_ASSIGN(VerticesContents); diff --git a/impeller/entity/geometry.cc b/impeller/entity/geometry.cc index 5389506f12e05..aed7ce69e632d 100644 --- a/impeller/entity/geometry.cc +++ b/impeller/entity/geometry.cc @@ -17,7 +17,7 @@ Geometry::Geometry() = default; Geometry::~Geometry() = default; // static -std::unique_ptr Geometry::MakeVertices(Vertices vertices) { +std::unique_ptr Geometry::MakeVertices(Vertices vertices) { return std::make_unique(std::move(vertices)); } @@ -175,7 +175,8 @@ GeometryResult VerticesGeometry::GetPositionUVBuffer( const ContentContext& renderer, const Entity& entity, RenderPass& pass) { - // TODO(jonahwilliams): support texture coordinates in vertices. + // TODO(jonahwilliams): support texture coordinates in vertices + // https://github.com/flutter/flutter/issues/109956 return {}; } @@ -226,24 +227,6 @@ GeometryResult FillPathGeometry::GetPositionBuffer( }; } -GeometryResult FillPathGeometry::GetPositionColorBuffer( - const ContentContext& renderer, - const Entity& entity, - RenderPass& pass, - Color paint_color, - BlendMode blend_mode) { - // TODO(jonahwilliams): support per-color vertex in path geometry. - return {}; -} - -GeometryResult FillPathGeometry::GetPositionUVBuffer( - const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) { - // TODO(jonahwilliams): support texture coordinates in path geometry. - return {}; -} - GeometryVertexType FillPathGeometry::GetVertexType() const { return GeometryVertexType::kPosition; } @@ -597,24 +580,6 @@ GeometryResult StrokePathGeometry::GetPositionBuffer( }; } -GeometryResult StrokePathGeometry::GetPositionColorBuffer( - const ContentContext& renderer, - const Entity& entity, - RenderPass& pass, - Color paint_color, - BlendMode blend_mode) { - // TODO(jonahwilliams): support per-color vertex in path geometry. - return {}; -} - -GeometryResult StrokePathGeometry::GetPositionUVBuffer( - const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) { - // TODO(jonahwilliams): support texture coordinates in path geometry. - return {}; -} - GeometryVertexType StrokePathGeometry::GetVertexType() const { return GeometryVertexType::kPosition; } @@ -673,24 +638,6 @@ GeometryResult CoverGeometry::GetPositionBuffer(const ContentContext& renderer, }; } -GeometryResult CoverGeometry::GetPositionColorBuffer( - const ContentContext& renderer, - const Entity& entity, - RenderPass& pass, - Color paint_color, - BlendMode blend_mode) { - // TODO(jonahwilliams): support per-color vertex in cover geometry. - return {}; -} - -GeometryResult CoverGeometry::GetPositionUVBuffer( - const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) { - // TODO(jonahwilliams): support texture coordinates in cover geometry. - return {}; -} - GeometryVertexType CoverGeometry::GetVertexType() const { return GeometryVertexType::kPosition; } @@ -724,23 +671,6 @@ GeometryResult RectGeometry::GetPositionBuffer(const ContentContext& renderer, }; } -GeometryResult RectGeometry::GetPositionColorBuffer( - const ContentContext& renderer, - const Entity& entity, - RenderPass& pass, - Color paint_color, - BlendMode blend_mode) { - // TODO(jonahwilliams): support per-color vertex in rect geometry. - return {}; -} - -GeometryResult RectGeometry::GetPositionUVBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) { - // TODO(jonahwilliams): support texture coordinates in rect geometry. - return {}; -} - GeometryVertexType RectGeometry::GetVertexType() const { return GeometryVertexType::kPosition; } diff --git a/impeller/entity/geometry.h b/impeller/entity/geometry.h index 2ca2e61fc406d..799a77c7de74f 100644 --- a/impeller/entity/geometry.h +++ b/impeller/entity/geometry.h @@ -42,13 +42,15 @@ enum class Join { kBevel, }; +class VerticesGeometry; + class Geometry { public: Geometry(); virtual ~Geometry(); - static std::unique_ptr MakeVertices(Vertices vertices); + static std::unique_ptr MakeVertices(Vertices vertices); static std::unique_ptr MakeFillPath(Path path); @@ -67,16 +69,6 @@ class Geometry { const Entity& entity, RenderPass& pass) = 0; - virtual GeometryResult GetPositionColorBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass, - Color paint_color, - BlendMode blend_mode) = 0; - - virtual GeometryResult GetPositionUVBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) = 0; - virtual GeometryVertexType GetVertexType() const = 0; virtual std::optional GetCoverage(const Matrix& transform) const = 0; @@ -89,30 +81,28 @@ class VerticesGeometry : public Geometry { ~VerticesGeometry(); - private: - // |Geometry| - GeometryResult GetPositionBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) override; - - // |Geometry| GeometryResult GetPositionColorBuffer(const ContentContext& renderer, const Entity& entity, RenderPass& pass, Color paint_color, - BlendMode blend_mode) override; + BlendMode blend_mode); - // |Geometry| GeometryResult GetPositionUVBuffer(const ContentContext& renderer, const Entity& entity, - RenderPass& pass) override; + RenderPass& pass); // |Geometry| - GeometryVertexType GetVertexType() const override; + GeometryResult GetPositionBuffer(const ContentContext& renderer, + const Entity& entity, + RenderPass& pass) override; // |Geometry| std::optional GetCoverage(const Matrix& transform) const override; + // |Geometry| + GeometryVertexType GetVertexType() const override; + + private: Vertices vertices_; FML_DISALLOW_COPY_AND_ASSIGN(VerticesGeometry); @@ -131,18 +121,6 @@ class FillPathGeometry : public Geometry { const Entity& entity, RenderPass& pass) override; - // |Geometry| - GeometryResult GetPositionColorBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass, - Color paint_color, - BlendMode blend_mode) override; - - // |Geometry| - GeometryResult GetPositionUVBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) override; - // |Geometry| GeometryVertexType GetVertexType() const override; @@ -194,18 +172,6 @@ class StrokePathGeometry : public Geometry { const Entity& entity, RenderPass& pass) override; - // |Geometry| - GeometryResult GetPositionColorBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass, - Color paint_color, - BlendMode blend_mode) override; - - // |Geometry| - GeometryResult GetPositionUVBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) override; - // |Geometry| GeometryVertexType GetVertexType() const override; @@ -253,18 +219,6 @@ class CoverGeometry : public Geometry { const Entity& entity, RenderPass& pass) override; - // |Geometry| - GeometryResult GetPositionColorBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass, - Color paint_color, - BlendMode blend_mode) override; - - // |Geometry| - GeometryResult GetPositionUVBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) override; - // |Geometry| GeometryVertexType GetVertexType() const override; @@ -286,18 +240,6 @@ class RectGeometry : public Geometry { const Entity& entity, RenderPass& pass) override; - // |Geometry| - GeometryResult GetPositionColorBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass, - Color paint_color, - BlendMode blend_mode) override; - - // |Geometry| - GeometryResult GetPositionUVBuffer(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) override; - // |Geometry| GeometryVertexType GetVertexType() const override;