Skip to content

Conversation

@gowsikraja
Copy link
Contributor

Summary

This PR improves the API documentation for ImageFilter.shader and isShaderFilterSupported by making the Impeller requirement more explicit and visible.

What was changed

Added an “Important” notice to clearly state that these APIs are only supported with Impeller.
Updated the doc comments to front-load this detail instead of placing it later in the text.
Added cross-reference notes explaining how isShaderFilterSupported relates to Impeller.
Why this change is helpful

Developers frequently run into confusion when using shader-based filters without realizing they require Impeller. This change makes the requirement obvious and easier to discover.

Issue reference

Fixes #178767

@github-actions github-actions bot added the engine flutter/engine related. See also e: labels. label Dec 3, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the API documentation for ImageFilter.shader and isShaderFilterSupported to make the Impeller rendering engine requirement more explicit. The changes move the warning about Impeller to the top of the documentation for ImageFilter.shader and add a similar warning to isShaderFilterSupported, both using a [!WARNING] block. An example of how to use isShaderFilterSupported is also added. I have one minor suggestion to fix a typo in the documentation formatting.

@chinmaygarde
Copy link
Contributor

LGTM but the analysis is not able to complete successfully.

@gowsikraja
Copy link
Contributor Author

@chinmaygarde @jason-simmons I am attempting to merge my PR, but I am encountering an issue and am unsure of the root cause.

As this is my first contribution to the project, I would appreciate any guidance or assistance you could provide to resolve this.

Thanks in advance for your help!

@gowsikraja gowsikraja force-pushed the docs/imagefilter-impeller branch from b90edb5 to c04fc05 Compare December 22, 2025 05:57
@jason-simmons
Copy link
Member

The Linux analyze check is failing because the Dart analyzer did not recognize some of the types used in the example code within the documentation. The code snippet analyzer script expects dart:ui types to be prefixed with ui.

(See the messages around the ERROR #1 log in the Linux analyze output:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8694805203061075377/+/u/run_test.dart_for_analyze_shard_and_subshard_None/stdout)

Change the lines at https://github.com/flutter/flutter/pull/179387/files#diff-005152dcaaa555ef138ebdd1580cea316c59e82d12563cdb4c8b5bd16c7e6b6dR4314 to something like:

  /// Example usage:
  /// ```dart
  /// void useShaderFilter(ui.FragmentShader myShader) {
  ///   if (ui.ImageFilter.isShaderFilterSupported) {
  ///     final filter = ui.ImageFilter.shader(myShader);
  ///     // Use the filter...
  ///   }
  /// }
  /// ```

@chinmaygarde chinmaygarde added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 5, 2026
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 5, 2026
@auto-submit
Copy link
Contributor

auto-submit bot commented Jan 5, 2026

autosubmit label was removed for flutter/flutter/179387, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR.

@jason-simmons jason-simmons force-pushed the docs/imagefilter-impeller branch from 39ab447 to d37fe11 Compare January 5, 2026 19:36
@jason-simmons jason-simmons added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 5, 2026
@auto-submit auto-submit bot added this pull request to the merge queue Jan 5, 2026
Merged via the queue into flutter:master with commit fa8898f Jan 5, 2026
178 of 179 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 5, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve doc comments RE ImageFilter.shader and . isShaderFilterSupported

3 participants