Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1280,8 +1280,6 @@ FILE: ../../../flutter/impeller/entity/shaders/rrect_blur.frag
FILE: ../../../flutter/impeller/entity/shaders/rrect_blur.vert
FILE: ../../../flutter/impeller/entity/shaders/solid_fill.frag
FILE: ../../../flutter/impeller/entity/shaders/solid_fill.vert
FILE: ../../../flutter/impeller/entity/shaders/solid_stroke.frag
FILE: ../../../flutter/impeller/entity/shaders/solid_stroke.vert
FILE: ../../../flutter/impeller/entity/shaders/srgb_to_linear_filter.frag
FILE: ../../../flutter/impeller/entity/shaders/srgb_to_linear_filter.vert
FILE: ../../../flutter/impeller/entity/shaders/sweep_gradient_fill.frag
Expand Down
2 changes: 0 additions & 2 deletions impeller/entity/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ impeller_shaders("entity_shaders") {
"shaders/rrect_blur.frag",
"shaders/solid_fill.frag",
"shaders/solid_fill.vert",
"shaders/solid_stroke.frag",
"shaders/solid_stroke.vert",
"shaders/srgb_to_linear_filter.frag",
"shaders/srgb_to_linear_filter.vert",
"shaders/sweep_gradient_fill.frag",
Expand Down
2 changes: 0 additions & 2 deletions impeller/entity/contents/content_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,6 @@ ContentContext::ContentContext(std::shared_ptr<Context> context)
CreateDefaultPipeline<LinearToSrgbFilterPipeline>(*context_);
srgb_to_linear_filter_pipelines_[{}] =
CreateDefaultPipeline<SrgbToLinearFilterPipeline>(*context_);
solid_stroke_pipelines_[{}] =
CreateDefaultPipeline<SolidStrokePipeline>(*context_);
glyph_atlas_pipelines_[{}] =
CreateDefaultPipeline<GlyphAtlasPipeline>(*context_);
glyph_atlas_sdf_pipelines_[{}] =
Expand Down
10 changes: 0 additions & 10 deletions impeller/entity/contents/content_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
#include "impeller/entity/rrect_blur.vert.h"
#include "impeller/entity/solid_fill.frag.h"
#include "impeller/entity/solid_fill.vert.h"
#include "impeller/entity/solid_stroke.frag.h"
#include "impeller/entity/solid_stroke.vert.h"
#include "impeller/entity/srgb_to_linear_filter.frag.h"
#include "impeller/entity/srgb_to_linear_filter.vert.h"
#include "impeller/entity/sweep_gradient_fill.frag.h"
Expand Down Expand Up @@ -145,8 +143,6 @@ using LinearToSrgbFilterPipeline =
using SrgbToLinearFilterPipeline =
RenderPipelineT<SrgbToLinearFilterVertexShader,
SrgbToLinearFilterFragmentShader>;
using SolidStrokePipeline =
RenderPipelineT<SolidStrokeVertexShader, SolidStrokeFragmentShader>;
using GlyphAtlasPipeline =
RenderPipelineT<GlyphAtlasVertexShader, GlyphAtlasFragmentShader>;
using GlyphAtlasSdfPipeline =
Expand Down Expand Up @@ -271,11 +267,6 @@ class ContentContext {
return GetPipeline(srgb_to_linear_filter_pipelines_, opts);
}

std::shared_ptr<Pipeline<PipelineDescriptor>> GetSolidStrokePipeline(
ContentContextOptions opts) const {
return GetPipeline(solid_stroke_pipelines_, opts);
}

std::shared_ptr<Pipeline<PipelineDescriptor>> GetClipPipeline(
ContentContextOptions opts) const {
return GetPipeline(clip_pipelines_, opts);
Expand Down Expand Up @@ -420,7 +411,6 @@ class ContentContext {
color_matrix_color_filter_pipelines_;
mutable Variants<LinearToSrgbFilterPipeline> linear_to_srgb_filter_pipelines_;
mutable Variants<SrgbToLinearFilterPipeline> srgb_to_linear_filter_pipelines_;
mutable Variants<SolidStrokePipeline> solid_stroke_pipelines_;
mutable Variants<ClipPipeline> clip_pipelines_;
mutable Variants<GlyphAtlasPipeline> glyph_atlas_pipelines_;
mutable Variants<GlyphAtlasSdfPipeline> glyph_atlas_sdf_pipelines_;
Expand Down
21 changes: 8 additions & 13 deletions impeller/entity/contents/solid_stroke_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static VertexBuffer CreateSolidStrokeVertices(
const SolidStrokeContents::JoinProc& join_proc,
Scalar miter_limit,
const SmoothingApproximation& smoothing) {
using VS = SolidStrokeVertexShader;
using VS = SolidFillVertexShader;

VertexBufferBuilder<VS::PerVertexData> vtx_builder;
auto polyline = path.CreatePolyline();
Expand Down Expand Up @@ -187,9 +187,6 @@ bool SolidStrokeContents::Render(const ContentContext& renderer,
return true;
}

using VS = SolidStrokePipeline::VertexShader;
using FS = SolidStrokePipeline::FragmentShader;

VS::VertInfo vert_info;
vert_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) *
entity.GetTransformation();
Expand All @@ -209,7 +206,7 @@ bool SolidStrokeContents::Render(const ContentContext& renderer,
options.stencil_compare = CompareFunction::kEqual;
options.stencil_operation = StencilOperation::kIncrementClamp;
}
cmd.pipeline = renderer.GetSolidStrokePipeline(options);
cmd.pipeline = renderer.GetSolidFillPipeline(options);
cmd.stencil_reference = entity.GetStencilDepth();

auto smoothing = SmoothingApproximation(
Expand Down Expand Up @@ -255,7 +252,6 @@ Scalar SolidStrokeContents::GetStrokeMiter() {
void SolidStrokeContents::SetStrokeCap(Cap cap) {
cap_ = cap;

using VS = SolidStrokeVertexShader;
switch (cap) {
case Cap::kButt:
cap_proc_ = [](VertexBufferBuilder<VS::PerVertexData>& vtx_builder,
Expand All @@ -266,7 +262,7 @@ void SolidStrokeContents::SetStrokeCap(Cap cap) {
cap_proc_ = [](VertexBufferBuilder<VS::PerVertexData>& vtx_builder,
const Point& position, const Point& offset,
const SmoothingApproximation& smoothing) {
SolidStrokeVertexShader::PerVertexData vtx;
VS::PerVertexData vtx;

Point forward(offset.y, -offset.x);
Point forward_normal = forward.Normalize();
Expand All @@ -293,7 +289,7 @@ void SolidStrokeContents::SetStrokeCap(Cap cap) {
cap_proc_ = [](VertexBufferBuilder<VS::PerVertexData>& vtx_builder,
const Point& position, const Point& offset,
const SmoothingApproximation& smoothing) {
SolidStrokeVertexShader::PerVertexData vtx;
VS::PerVertexData vtx;
vtx.position = position;

Point forward(offset.y, -offset.x);
Expand All @@ -316,11 +312,11 @@ SolidStrokeContents::Cap SolidStrokeContents::GetStrokeCap() {
}

static Scalar CreateBevelAndGetDirection(
VertexBufferBuilder<SolidStrokeVertexShader::PerVertexData>& vtx_builder,
VertexBufferBuilder<SolidFillVertexShader::PerVertexData>& vtx_builder,
const Point& position,
const Point& start_offset,
const Point& end_offset) {
SolidStrokeVertexShader::PerVertexData vtx;
SolidFillVertexShader::PerVertexData vtx;
vtx.position = position;
vtx_builder.AppendVertex(vtx);

Expand All @@ -336,7 +332,6 @@ static Scalar CreateBevelAndGetDirection(
void SolidStrokeContents::SetStrokeJoin(Join join) {
join_ = join;

using VS = SolidStrokeVertexShader;
switch (join) {
case Join::kBevel:
join_proc_ = [](VertexBufferBuilder<VS::PerVertexData>& vtx_builder,
Expand Down Expand Up @@ -371,7 +366,7 @@ void SolidStrokeContents::SetStrokeJoin(Join join) {
}

// Outer miter point.
SolidStrokeVertexShader::PerVertexData vtx;
VS::PerVertexData vtx;
vtx.position = position + miter_point * dir;
vtx_builder.AppendVertex(vtx);
};
Expand Down Expand Up @@ -409,7 +404,7 @@ void SolidStrokeContents::SetStrokeJoin(Join join) {
middle_handle, middle)
.CreatePolyline(smoothing);

SolidStrokeVertexShader::PerVertexData vtx;
VS::PerVertexData vtx;
for (const auto& point : arc_points) {
vtx.position = position + point * dir;
vtx_builder.AppendVertex(vtx);
Expand Down
31 changes: 18 additions & 13 deletions impeller/entity/contents/solid_stroke_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
#include <vector>

#include "flutter/fml/macros.h"
#include "impeller/entity/contents/content_context.h"
#include "impeller/entity/contents/contents.h"
#include "impeller/entity/solid_stroke.vert.h"
#include "impeller/entity/solid_fill.frag.h"
#include "impeller/entity/solid_fill.vert.h"
#include "impeller/geometry/color.h"
#include "impeller/geometry/path_component.h"
#include "impeller/geometry/point.h"

namespace impeller {

class SolidStrokeContents final : public Contents {
using VS = SolidFillVertexShader;
using FS = SolidFillFragmentShader;

public:
enum class Cap {
kButt,
Expand All @@ -31,18 +36,18 @@ class SolidStrokeContents final : public Contents {
kBevel,
};

using CapProc = std::function<void(
VertexBufferBuilder<SolidStrokeVertexShader::PerVertexData>& vtx_builder,
const Point& position,
const Point& offset,
const SmoothingApproximation& smoothing)>;
using JoinProc = std::function<void(
VertexBufferBuilder<SolidStrokeVertexShader::PerVertexData>& vtx_builder,
const Point& position,
const Point& start_offset,
const Point& end_offset,
Scalar miter_limit,
const SmoothingApproximation& smoothing)>;
using CapProc =
std::function<void(VertexBufferBuilder<VS::PerVertexData>& vtx_builder,
const Point& position,
const Point& offset,
const SmoothingApproximation& smoothing)>;
using JoinProc =
std::function<void(VertexBufferBuilder<VS::PerVertexData>& vtx_builder,
const Point& position,
const Point& start_offset,
const Point& end_offset,
Scalar miter_limit,
const SmoothingApproximation& smoothing)>;

SolidStrokeContents();

Expand Down
14 changes: 0 additions & 14 deletions impeller/entity/shaders/solid_stroke.frag

This file was deleted.

14 changes: 0 additions & 14 deletions impeller/entity/shaders/solid_stroke.vert

This file was deleted.