Skip to content

Commit ede7645

Browse files
chinmaygardednfield
authored andcommitted
Cleanup entity API.
1 parent ac10b79 commit ede7645

File tree

5 files changed

+2
-41
lines changed

5 files changed

+2
-41
lines changed

impeller/aiks/aiks_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ TEST_F(AiksTest, CanRenderCurvedStrokes) {
9494
paint.stroke_width = 25.0;
9595
paint.style = Paint::Style::kStroke;
9696
canvas.DrawPath(PathBuilder{}.AddCircle({500, 500}, 250).CreatePath(), paint);
97-
ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
97+
// ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture()));
9898
}
9999

100100
} // namespace testing

impeller/aiks/canvas.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ void Canvas::ClipPath(Path path) {
8080
Entity entity;
8181
entity.SetTransformation(GetCurrentTransformation());
8282
entity.SetPath(std::move(path));
83-
entity.SetIsClip(true);
8483
GetCurrentPass().PushEntity(std::move(entity));
8584
}
8685

impeller/entity/entity.cc

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,6 @@ void Entity::SetTransformation(const Matrix& transformation) {
1818
transformation_ = transformation;
1919
}
2020

21-
const Color& Entity::GetStrokeColor() const {
22-
return stroke_color_;
23-
}
24-
25-
void Entity::SetStrokeColor(const Color& strokeColor) {
26-
stroke_color_ = strokeColor;
27-
}
28-
29-
double Entity::GetStrokeSize() const {
30-
return stroke_size_;
31-
}
32-
33-
void Entity::SetStrokeSize(double strokeSize) {
34-
stroke_size_ = std::max(strokeSize, 0.0);
35-
}
36-
3721
const Path& Entity::GetPath() const {
3822
return path_;
3923
}
@@ -42,14 +26,6 @@ void Entity::SetPath(Path path) {
4226
path_ = std::move(path);
4327
}
4428

45-
void Entity::SetIsClip(bool is_clip) {
46-
is_clip_ = is_clip;
47-
}
48-
49-
bool Entity::IsClip() const {
50-
return is_clip_;
51-
}
52-
5329
void Entity::SetContents(std::shared_ptr<Contents> contents) {
5430
contents_ = std::move(contents);
5531
}

impeller/entity/entity.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,10 @@ class Entity {
2323

2424
void SetTransformation(const Matrix& transformation);
2525

26-
const Color& GetStrokeColor() const;
27-
28-
void SetStrokeColor(const Color& strokeColor);
29-
30-
double GetStrokeSize() const;
31-
32-
void SetStrokeSize(double strokeSize);
33-
3426
const Path& GetPath() const;
3527

3628
void SetPath(Path path);
3729

38-
void SetIsClip(bool is_clip);
39-
40-
bool IsClip() const;
41-
4230
void SetContents(std::shared_ptr<Contents> contents);
4331

4432
const std::shared_ptr<Contents>& GetContents() const;
@@ -47,9 +35,6 @@ class Entity {
4735
Matrix transformation_;
4836
std::shared_ptr<Contents> contents_;
4937
Path path_;
50-
Color stroke_color_;
51-
double stroke_size_ = 1.0;
52-
bool is_clip_ = false;
5338
};
5439

5540
} // namespace impeller

impeller/entity/shaders/solid_stroke.vert

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ in vec2 vertex_normal;
1717
out vec4 stroke_color;
1818

1919
void main() {
20+
// Push one vertex by the half stroke size along the normal vector.
2021
vec2 offset = vertex_normal * vec2(stroke_info.size * 0.5);
2122
gl_Position = frame_info.mvp * vec4(vertex_position + offset, 0.0, 1.0);
2223
stroke_color = stroke_info.color;

0 commit comments

Comments
 (0)