Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit c27fb8f

Browse files
committed
Don't skip transparent draw calls
1 parent 0082b6d commit c27fb8f

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

impeller/entity/contents/solid_color_contents.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ VertexBuffer SolidColorContents::CreateSolidFillVertices(const Path& path,
6363
bool SolidColorContents::Render(const ContentContext& renderer,
6464
const Entity& entity,
6565
RenderPass& pass) const {
66-
if (color_.IsTransparent()) {
67-
return true;
68-
}
69-
7066
using VS = SolidFillPipeline::VertexShader;
7167

7268
Command cmd;

impeller/entity/contents/solid_stroke_contents.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ void SolidStrokeContents::SetPath(Path path) {
3535

3636
std::optional<Rect> SolidStrokeContents::GetCoverage(
3737
const Entity& entity) const {
38+
if (color_.IsTransparent()) {
39+
return std::nullopt;
40+
}
41+
3842
auto path_bounds = path_.GetBoundingBox();
3943
if (!path_bounds.has_value()) {
4044
return std::nullopt;
@@ -173,7 +177,7 @@ static VertexBuffer CreateSolidStrokeVertices(
173177
bool SolidStrokeContents::Render(const ContentContext& renderer,
174178
const Entity& entity,
175179
RenderPass& pass) const {
176-
if (color_.IsTransparent() || stroke_size_ <= 0.0) {
180+
if (stroke_size_ <= 0.0) {
177181
return true;
178182
}
179183

impeller/entity/contents/texture_contents.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "texture_contents.h"
66

7+
#include <optional>
8+
79
#include "impeller/entity/contents/content_context.h"
810
#include "impeller/entity/entity.h"
911
#include "impeller/entity/texture_fill.frag.h"
@@ -35,6 +37,9 @@ void TextureContents::SetOpacity(Scalar opacity) {
3537
}
3638

3739
std::optional<Rect> TextureContents::GetCoverage(const Entity& entity) const {
40+
if (opacity_ == 0) {
41+
return std::nullopt;
42+
}
3843
return path_.GetTransformedBoundingBox(entity.GetTransformation());
3944
};
4045

0 commit comments

Comments
 (0)