Skip to content

Commit

Permalink
[Impeller] Don't do texture passthrough when opacity needs to be appl…
Browse files Browse the repository at this point in the history
…ied (flutter#36337)
  • Loading branch information
bdero authored Sep 22, 2022
1 parent fd15b06 commit ac6cb9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion impeller/entity/contents/texture_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "impeller/entity/entity.h"
#include "impeller/entity/texture_fill.frag.h"
#include "impeller/entity/texture_fill.vert.h"
#include "impeller/geometry/constants.h"
#include "impeller/geometry/path_builder.h"
#include "impeller/renderer/formats.h"
#include "impeller/renderer/render_pass.h"
Expand Down Expand Up @@ -72,7 +73,8 @@ std::optional<Snapshot> TextureContents::RenderToSnapshot(

// Passthrough textures that have simple rectangle paths and complete source
// rects.
if (is_rect_ && source_rect_ == Rect::MakeSize(texture_->GetSize())) {
if (is_rect_ && source_rect_ == Rect::MakeSize(texture_->GetSize()) &&
opacity_ >= 1 - kEhCloseEnough) {
auto scale = Vector2(bounds->size / Size(texture_->GetSize()));
return Snapshot{.texture = texture_,
.transform = entity.GetTransformation() *
Expand Down

0 comments on commit ac6cb9f

Please sign in to comment.