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: 2 additions & 0 deletions impeller/aiks/paint_pass_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ std::shared_ptr<Contents> PaintPassDelegate::CreateContentsForSubpassTarget(
const Matrix& effect_transform) {
auto contents = TextureContents::MakeRect(Rect::MakeSize(target->GetSize()));
contents->SetTexture(target);
contents->SetLabel("Subpass");
contents->SetSourceRect(Rect::MakeSize(target->GetSize()));
contents->SetOpacity(paint_.color.alpha);
contents->SetDeferApplyingOpacity(true);
Expand Down Expand Up @@ -134,6 +135,7 @@ OpacityPeepholePassDelegate::CreateContentsForSubpassTarget(
std::shared_ptr<Texture> target,
const Matrix& effect_transform) {
auto contents = TextureContents::MakeRect(Rect::MakeSize(target->GetSize()));
contents->SetLabel("Subpass");
contents->SetTexture(target);
contents->SetSourceRect(Rect::MakeSize(target->GetSize()));
contents->SetOpacity(paint_.color.alpha);
Expand Down
12 changes: 6 additions & 6 deletions impeller/entity/contents/texture_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "texture_contents.h"
#include "impeller/entity/contents/texture_contents.h"

#include <memory>
#include <optional>
Expand Down Expand Up @@ -105,13 +105,13 @@ std::optional<Snapshot> TextureContents::RenderToSnapshot(
}

static TextureFillVertexShader::PerVertexData ComputeVertexData(
const Point& vtx,
const Point& position,
const Rect& coverage_rect,
const ISize& texture_size,
const Rect& source_rect) {
TextureFillVertexShader::PerVertexData data;
data.position = vtx;
auto coverage_coords = (vtx - coverage_rect.origin) / coverage_rect.size;
data.position = position;
auto coverage_coords = (position - coverage_rect.origin) / coverage_rect.size;
data.texture_coords =
(source_rect.origin + source_rect.size * coverage_coords) / texture_size;
return data;
Expand All @@ -131,9 +131,9 @@ bool TextureContents::Render(const ContentContext& renderer,
}

VertexBufferBuilder<VS::PerVertexData> vertex_builder;
for (const auto vtx : rect_.GetPoints()) {
for (const auto position : rect_.GetPoints()) {
vertex_builder.AppendVertex(ComputeVertexData(
vtx, coverage_rect, texture_->GetSize(), source_rect_));
position, coverage_rect, texture_->GetSize(), source_rect_));
}

auto& host_buffer = pass.GetTransientsBuffer();
Expand Down
1 change: 1 addition & 0 deletions impeller/entity/entity_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ bool EntityPass::Render(ContentContext& renderer,
contents->SetTexture(
offscreen_target.GetRenderTarget().GetRenderTargetTexture());
contents->SetSourceRect(size_rect);
contents->SetLabel("Root pass blit");

Entity entity;
entity.SetContents(contents);
Expand Down