This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Impeller] Implement tiled texture contents for image color source#35264
Merged
auto-submit[bot] merged 5 commits intoflutter:mainfrom Aug 11, 2022
Merged
[Impeller] Implement tiled texture contents for image color source#35264auto-submit[bot] merged 5 commits intoflutter:mainfrom
auto-submit[bot] merged 5 commits intoflutter:mainfrom
Conversation
2930f21 to
dff0d8d
Compare
bdero
reviewed
Aug 11, 2022
| void SetTexture(std::shared_ptr<Texture> texture); | ||
|
|
||
| void SetTileModes(Entity::TileMode horizontal_tile_mode, | ||
| Entity::TileMode vertical_tile_mode); |
Contributor
There was a problem hiding this comment.
Any reason we can't just add this new option to the existing TextureContents instead? We can always add more specialized shaders later when optimizing for common cases, but I don't think it would necessitate a separate command factory.
Member
Author
There was a problem hiding this comment.
If we add the new option to TextureContents, we probably also need to add a Type to TextureContents to identify whether it is a kDefault type or kTiled type,because the way they calculate texture_coords is very different:
TextureContents
const auto tess_result = Tessellator{}.Tessellate(
path_.GetFillType(), path_.CreatePolyline(),
[this, &vertex_builder, &coverage_rect, &texture_size](Point vtx) {
VS::PerVertexData data;
data.position = vtx;
auto coverage_coords =
(vtx - coverage_rect->origin) / coverage_rect->size;
data.texture_coords =
(source_rect_.origin + source_rect_.size * coverage_coords) /
texture_size;
vertex_builder.AppendVertex(data);
});
TiledTextureContents (matrix is not supported yet)
const auto tess_result =
Tessellator{}.Tessellate(path_.GetFillType(), path_.CreatePolyline(),
[&vertex_builder, &texture_size](Point vtx) {
VS::PerVertexData data;
data.position = vtx;
data.texture_coords = vtx / texture_size;
vertex_builder.AppendVertex(data);
});
Contributor
There was a problem hiding this comment.
Interesting -- I see the other reason for the difference: The UVs don't get mapped to the coverage rect.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Aug 11, 2022
emilyabest
pushed a commit
to emilyabest/engine
that referenced
this pull request
Aug 12, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix flutter/flutter#109224
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.