Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend-specific EmbedderTestBackingStoreProducers #56638

Merged

Conversation

cbracken
Copy link
Member

Extracts backend-specific subclasses of EmbedderTestBackingStoreProducer for OpenGL, Metal, Software, and Vulkan.

Issue: flutter/flutter#158998

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 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.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@cbracken cbracken force-pushed the refactor-embedder-test-backingstore-producer branch from 744da5a to cb479bc Compare November 16, 2024 00:14

GrMtlTextureInfo skia_texture_info;
skia_texture_info.fTexture.reset(SkCFSafeRetain(texture_info.texture));
GrBackendTexture backend_texture = GrBackendTextures::MakeMtl(
Copy link
Member

Choose a reason for hiding this comment

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

Nothing to do here, but all these tests/test harness that use Skia types directly like this will need to either be rewritten or deleted next year

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup. I suspect there's a non-zero amount of Skia-specific code in the embedder_unittests source too for that matter.

Refactoring all this stuff out into backend-specific classes hopefully makes either of those options easier.

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@cbracken cbracken force-pushed the refactor-embedder-test-backingstore-producer branch 3 times, most recently from 314b7d9 to 0c6c4d3 Compare November 16, 2024 00:53
// Ideally this would be set in the constructor, however we can't do that
// without introducing different constructors depending on different graphics
// APIs, which is a bit ugly.
test_egl_context_ = std::move(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.

Turns out introducing different constructors is less ugly.

@cbracken cbracken force-pushed the refactor-embedder-test-backingstore-producer branch from 0c6c4d3 to c82578b Compare November 16, 2024 00:58
#ifdef SHELL_ENABLE_GL
std::shared_ptr<TestEGLContext> egl_context_ = nullptr;
#endif

Copy link
Member Author

Choose a reason for hiding this comment

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

Last ifdef of the file, gone.

Extracts backend-specific subclasses of EmbedderTestBackingStoreProducer
for OpenGL, Metal, Software, and Vulkan.

Issue: flutter/flutter#158998
@cbracken cbracken force-pushed the refactor-embedder-test-backingstore-producer branch from c82578b to fce8036 Compare November 16, 2024 01:01
@cbracken cbracken added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 16, 2024
@auto-submit auto-submit bot merged commit 98c3b7f into flutter:main Nov 16, 2024
31 checks passed
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 16, 2024
@cbracken cbracken deleted the refactor-embedder-test-backingstore-producer branch November 16, 2024 03:17
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 16, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Nov 16, 2024
…159017)

flutter/engine@f238321...98c3b7f

2024-11-16 [email protected] Backend-specific
EmbedderTestBackingStoreProducers (flutter/engine#56638)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure
that a human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants