Thanks to visit codestin.com
Credit goes to github.com

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

[Impeller] Support external textures on iOS #36498

Merged
merged 11 commits into from
Oct 19, 2022

Conversation

ColdPaleLight
Copy link
Member

@ColdPaleLight ColdPaleLight commented Sep 29, 2022

fix flutter/flutter#112364

  1. Introduce Texture::PaintContext to pass parameters.
  2. Support BGRA format external textures on iOS.

I have tested this patch locally and it works well.

Note that external textures in YUV format are not yet supported, I will support it in the PR #36685.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See [testing the engine] for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the [CLA].
  • All existing and new tests are passing.

@ColdPaleLight ColdPaleLight changed the title Impeller external texture ios [Impeller] Support external textures on iOS Sep 29, 2022
@ColdPaleLight ColdPaleLight marked this pull request as draft September 29, 2022 10:34
@chinmaygarde
Copy link
Member

Ping @ColdPaleLight. Is there anything to do to unblock making progress on this? We'd really like to work on this as it is a high priority task but don't want to step on your toes :)

@ColdPaleLight ColdPaleLight marked this pull request as ready for review October 7, 2022 01:13
@ColdPaleLight ColdPaleLight removed the Work in progress (WIP) Not ready (yet) for review! label Oct 7, 2022
@ColdPaleLight
Copy link
Member Author

@chinmaygarde I think this PR is ready for review now :)

Copy link
Member

@chinmaygarde chinmaygarde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. Thank you so much. Apologies for the late reply. The team was out for an offsite recently but things should start picking back now.

grContext:grContext
width:textureSize.width()
height:textureSize.height()];
#if IMPELLER_SUPPORTS_RENDERING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the ifdef check necessary at all on Darwin TUs? AFAIK, only Fuchsia has this off.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

context:(flutter::Texture::PaintContext&)context {
#if IMPELLER_SUPPORTS_RENDERING
if (_enableImpeller) {
IMPELLER_UNIMPLEMENTED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a validation log here instead and also add a followup bug for its implementation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

/**
* MTLDevice that is backing this context.s
*/
@property(nonatomic, readonly) id<MTLDevice> device;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this redundant? It could just as easily be accessed via the context below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

/**
* Impeller context;
*/
@property(nonatomic, readonly) std::shared_ptr<impeller::Context> context;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps make this ContextMTL so callers don't have to cast. There is no way this can be anything else in the Darwin context.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@ColdPaleLight ColdPaleLight added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 19, 2022
@auto-submit auto-submit bot merged commit 7d18d70 into flutter:main Oct 19, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 20, 2022
zanderso pushed a commit to flutter/flutter that referenced this pull request Oct 20, 2022
…113766)

* 7d18d7007 [Impeller] Support external textures on iOS (flutter/engine#36498)

* d07919654 [Impeller] Implement RuntimeEffectContents (flutter/engine#36866)

* 119e839ef Revert "[Impeller] Implement RuntimeEffectContents (#36866)" (flutter/engine#36883)

* bcd83df4e [Impeller] Reland RuntimeEffectContents (flutter/engine#36884)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller embedder Related to the embedder API platform-android platform-ios platform-macos
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Impeller] Support external textures on iOS.
2 participants