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

Eliminate ShellTestPlatformView::BackendType::kDefaultBackendType #56744

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

cbracken
Copy link
Member

@cbracken cbracken commented Nov 22, 2024

kDefaultBackendType is intended to make life easier for authors of tests, but in any switch statement where it's used (currently just a single location), we rely on ordering it first and #ifdefing out all backends that aren't available.

Instead, we define a static function that returns the default that callers can invoke instead. This avoids reliance on case ordering and fallthrough.

In #56722 we split backends out into separate translation units, and should remove the #ifdefs, which means we can't rely on this trick anymore.

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.

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.

RSLGTM

@cbracken cbracken force-pushed the eliminate-default-backendtype branch from cb6ff1a to 31232ee Compare November 22, 2024 04:52
`kDefaultBackendType` is intended to make life easier for authors of
tests, but in any switch statement where it's used (currently just a
single location), we rely on ordering it first and `#ifdef`ing out all
backends that aren't available.

Instead, we define a static function that returns the default that
callers can invoke instead. This avoids relinace on case ordering and
fallthrough.

In flutter#56722 we split backends out
into separate translation units, and remove the `#ifdef`s which means we
can't rely on this trick anymore.
@cbracken cbracken force-pushed the eliminate-default-backendtype branch from 31232ee to a83a572 Compare November 22, 2024 05:05
@cbracken cbracken added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 22, 2024
@auto-submit auto-submit bot merged commit 0dd1cba into flutter:main Nov 22, 2024
31 checks passed
@cbracken cbracken deleted the eliminate-default-backendtype branch November 22, 2024 06:59
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 22, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 22, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Nov 22, 2024
…159345)

flutter/engine@6f941c9...202506d

2024-11-22 jonahwilliams@google.com [Impeller] cache and reuse openGL
framebuffer attachments. (flutter/engine#56746)
2024-11-22 skia-flutter-autoroll@skia.org Roll Skia from 700e685861c8 to
e7caf38140ce (25 revisions) (flutter/engine#56756)
2024-11-22 skia-flutter-autoroll@skia.org Roll Dart SDK from
c1106f7e4cde to 141291fd570d (1 revision) (flutter/engine#56748)
2024-11-22 jonahwilliams@google.com [engine] more consistently flush
dart event loop, run vsync callback immediately (flutter/engine#56738)
2024-11-22 chris@bracken.jp Extract backend-specific code in
ShellTestPlatformView (flutter/engine#56722)
2024-11-22 chris@bracken.jp Eliminate
ShellTestPlatformView::BackendType::kDefaultBackendType
(flutter/engine#56744)
2024-11-22 skia-flutter-autoroll@skia.org Roll Skia from 2614590b4f32 to
700e685861c8 (1 revision) (flutter/engine#56725)
2024-11-22 skia-flutter-autoroll@skia.org Roll Dart SDK from
b36e4d731d67 to c1106f7e4cde (12 revisions) (flutter/engine#56742)
2024-11-22 chinmaygarde@google.com [Impeller] libImpeller: A C++ wrapper
to the Impeller API. (flutter/engine#56682)
2024-11-21 chinmaygarde@google.com [Impeller] Run simulator tests with
Impeller enabled. (flutter/engine#56740)

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 aaclarke@google.com,zra@google.com 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
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Nov 22, 2024
…visions) (#159345)" (#159360)

<!-- start_original_pr_link -->
Reverts: #159345
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: hannah-hyj
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: tree is red on " Linux_build_test
flutter_gallery__transition_perf_hybrid" after engine auto roll
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: engine-flutter-autoroll
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {fluttergithubbot}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:

flutter/engine@6f941c9...202506d

2024-11-22 jonahwilliams@google.com [Impeller] cache and reuse openGL
framebuffer attachments. (flutter/engine#56746)
2024-11-22 skia-flutter-autoroll@skia.org Roll Skia from 700e685861c8 to
e7caf38140ce (25 revisions) (flutter/engine#56756)
2024-11-22 skia-flutter-autoroll@skia.org Roll Dart SDK from
c1106f7e4cde to 141291fd570d (1 revision) (flutter/engine#56748)
2024-11-22 jonahwilliams@google.com [engine] more consistently flush
dart event loop, run vsync callback immediately (flutter/engine#56738)
2024-11-22 chris@bracken.jp Extract backend-specific code in
ShellTestPlatformView (flutter/engine#56722)
2024-11-22 chris@bracken.jp Eliminate
ShellTestPlatformView::BackendType::kDefaultBackendType
(flutter/engine#56744)
2024-11-22 skia-flutter-autoroll@skia.org Roll Skia from 2614590b4f32 to
700e685861c8 (1 revision) (flutter/engine#56725)
2024-11-22 skia-flutter-autoroll@skia.org Roll Dart SDK from
b36e4d731d67 to c1106f7e4cde (12 revisions) (flutter/engine#56742)
2024-11-22 chinmaygarde@google.com [Impeller] libImpeller: A C++ wrapper
to the Impeller API. (flutter/engine#56682)
2024-11-21 chinmaygarde@google.com [Impeller] Run simulator tests with
Impeller enabled. (flutter/engine#56740)

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 aaclarke@google.com,zra@google.com 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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 23, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 23, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Nov 23, 2024
…159364)

flutter/engine@6f941c9...f776c3a

2024-11-22 skia-flutter-autoroll@skia.org Roll Skia from e7caf38140ce to
c3d9596a93f8 (2 revisions) (flutter/engine#56765)
2024-11-22 98614782+auto-submit[bot]@users.noreply.github.com Reverts
"[engine] more consistently flush dart event loop, run vsync callback
immediately (#56738)" (flutter/engine#56767)
2024-11-22 skia-flutter-autoroll@skia.org Roll Dart SDK from
8b65a7a628e2 to eb01a0430f72 (2 revisions) (flutter/engine#56764)
2024-11-22 jonahwilliams@google.com [Impeller] delete Impeller sim opt
out. (flutter/engine#56706)
2024-11-22 jason-simmons@users.noreply.github.com [Impeller] Ensure that
SnapshotControllerImpeller has a rendering context before creating the
snapshot (flutter/engine#56743)
2024-11-22 flar@google.com [DisplayList] migrate DlColorSource objects
to Impeller geometry (flutter/engine#56735)
2024-11-22 chinmaygarde@google.com [Impeller] libImpeller: Tinker on the
README. (flutter/engine#56761)
2024-11-22 jonahwilliams@google.com [Impeller] dont create temp vec for
discard. (flutter/engine#56759)
2024-11-22 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from
zhFzwYCH-N_wasTnM... to D5CBHuB2c-v3Zai-c... (flutter/engine#56757)
2024-11-22 skia-flutter-autoroll@skia.org Roll Dart SDK from
141291fd570d to 8b65a7a628e2 (1 revision) (flutter/engine#56755)
2024-11-22 jonahwilliams@google.com [Impeller] cache and reuse openGL
framebuffer attachments. (flutter/engine#56746)
2024-11-22 skia-flutter-autoroll@skia.org Roll Skia from 700e685861c8 to
e7caf38140ce (25 revisions) (flutter/engine#56756)
2024-11-22 skia-flutter-autoroll@skia.org Roll Dart SDK from
c1106f7e4cde to 141291fd570d (1 revision) (flutter/engine#56748)
2024-11-22 jonahwilliams@google.com [engine] more consistently flush
dart event loop, run vsync callback immediately (flutter/engine#56738)
2024-11-22 chris@bracken.jp Extract backend-specific code in
ShellTestPlatformView (flutter/engine#56722)
2024-11-22 chris@bracken.jp Eliminate
ShellTestPlatformView::BackendType::kDefaultBackendType
(flutter/engine#56744)
2024-11-22 skia-flutter-autoroll@skia.org Roll Skia from 2614590b4f32 to
700e685861c8 (1 revision) (flutter/engine#56725)
2024-11-22 skia-flutter-autoroll@skia.org Roll Dart SDK from
b36e4d731d67 to c1106f7e4cde (12 revisions) (flutter/engine#56742)
2024-11-22 chinmaygarde@google.com [Impeller] libImpeller: A C++ wrapper
to the Impeller API. (flutter/engine#56682)
2024-11-21 chinmaygarde@google.com [Impeller] Run simulator tests with
Impeller enabled. (flutter/engine#56740)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from zhFzwYCH-N_w to D5CBHuB2c-v3

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 aaclarke@google.com,zra@google.com 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
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
…utter/engine#56744)

`kDefaultBackendType` is intended to make life easier for authors of tests, but in any switch statement where it's used (currently just a single location), we rely on ordering it first and `#ifdef`ing out all backends that aren't available.

Instead, we define a static function that returns the default that callers can invoke instead. This avoids relinace on case ordering and fallthrough.

In flutter/engine#56722 we split backends out into separate translation units, and ideally should remove the `#ifdef`s, which means we can't rely on this trick anymore.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants