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

[macOS] Merge FlutterSurfaceManager classes #37701

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

cbracken
Copy link
Member

@cbracken cbracken commented Nov 17, 2022

Previously, FlutterSurfaceManager was a protocol with two concrete implementations: FlutterGLSurfaceManager and FlutterMetalSurfaceManager. Most of the implementation was in a shared superclass, FlutterIOSurfaceManager, which called into the OpenGL or Metal-specific subclass when backend-specific operations (such as allocating textures) was required. It did so via a delegate pattern, wherein the subclasses both implemented the FlutterIOSurfaceManagerDelegate protocol that exposed the backend-specific functionality.

Now that only the Metal implementation remains, the delegate code can be inlined into the calling functions, and the class hierarchy can be squashed into a single concrete implementation class, FlutterSurfaceManager, similar to how it was originally implemented in #21525 before we had two backends.

Issue: flutter/flutter#108304
Issue: flutter/flutter#114445

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.

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

@cbracken cbracken force-pushed the merge-surface-manager branch from 6b5a29c to a7b3128 Compare November 17, 2022 04:32
@cbracken cbracken changed the title [macOS] Merge FlutterSurfaceManager and impls [macOS] Merge FlutterSurfaceManager classes Nov 17, 2022
@cbracken cbracken force-pushed the merge-surface-manager branch 3 times, most recently from ccba787 to 7aeb7be Compare November 17, 2022 16:18
Previously, FlutterSurfaceManager was a protocol with two concrete
implementations: FlutterGLSurfaceManager and FlutterMetalSurfaceManager.
Most of the implementation was in a shared superclass,
FlutterIOSurfaceManager, which called into the OpenGL or Metal-specific
subclass when backend-specific operations (such as allocating textures)
was required. It did so via a delegate pattern, wherein the subclasses
both implemented the FlutterIOSurfaceManagerDelegate protocol that
exposed the backend-specific functionality.

Now that only the Metal implementation remains, the delegate code can be
inlined into the calling functions, and the class hierarchy can be
squashed into a single concrete implementation class,
FlutterSurfaceManager, similar to how it was originally implemented in
flutter#21525 before we had two backends.

Issue: flutter/flutter#108304
Issue: flutter/flutter#114445
@cbracken cbracken force-pushed the merge-surface-manager branch from 7aeb7be to 65061e6 Compare November 17, 2022 17:59
@cbracken cbracken merged commit d955a72 into flutter:main Nov 17, 2022
@cbracken cbracken deleted the merge-surface-manager branch November 17, 2022 19:46
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 17, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 17, 2022
…115589)

* 556e0415a Revert "[Impeller] Reland: Refactor color source resolution to use explicit factory types (#37677)" (flutter/engine#37720)

* 5b31f4f0d Reland layer state stack 2 (flutter/engine#37394)

* d955a72c5 [macOS] Merge FlutterSurfaceManager and impls (flutter/engine#37701)
shogohida pushed a commit to shogohida/flutter that referenced this pull request Dec 7, 2022
…lutter#115589)

* 556e0415a Revert "[Impeller] Reland: Refactor color source resolution to use explicit factory types (flutter#37677)" (flutter/engine#37720)

* 5b31f4f0d Reland layer state stack 2 (flutter/engine#37394)

* d955a72c5 [macOS] Merge FlutterSurfaceManager and impls (flutter/engine#37701)
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#115589)

* 556e0415a Revert "[Impeller] Reland: Refactor color source resolution to use explicit factory types (flutter#37677)" (flutter/engine#37720)

* 5b31f4f0d Reland layer state stack 2 (flutter/engine#37394)

* d955a72c5 [macOS] Merge FlutterSurfaceManager and impls (flutter/engine#37701)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants