Skip to content

Conversation

@robert-ancell
Copy link
Contributor

There didn't seem to be any examples on how to do this.

I've only shown the Linux implementation, others may want to follow this PR up with support for other platforms.

@flutter-dashboard flutter-dashboard bot added a: text input Entering text in a text field or keyboard related problems d: examples Sample code and demos c: contributor-productivity Team-specific productivity, code health, technical debt. labels Mar 16, 2023
@robert-ancell
Copy link
Contributor Author

Example program - the square is drawn as a texture and clicking the buttons requests the texture is redrawn in that color.

Screenshot from 2023-03-16 17-20-28

@robert-ancell
Copy link
Contributor Author

The example shows building a texture using FlPixelBufferTexture which is the higher level texture API. It might be worth using FlTextureGL (will require more boilerplate code) or both?

@loic-sharma loic-sharma added the a: desktop Running on desktop label Mar 23, 2023
@robert-ancell robert-ancell force-pushed the texture-example branch 2 times, most recently from 580bac9 to e5294e1 Compare March 23, 2023 21:06
@robert-ancell robert-ancell removed the a: text input Entering text in a text field or keyboard related problems label Mar 23, 2023
@robert-ancell robert-ancell force-pushed the texture-example branch 8 times, most recently from d798b6a to 2807a96 Compare March 27, 2023 02:50
@stuartmorgan-g
Copy link
Contributor

@cbracken Do you know how we decide what examples to support here? This seems like a reasonable thing to have an example of, but I don't know if there are specific criteria. (If we do want to do this, we should definitely have a plan for filling in the other platforms.)

@cbracken
Copy link
Member

We discussed a bit in yesterday's meeting. Now that https://github.com/flutter/samples exists, we should probably decide what to do with this directory altogether. These fall into two main categories:

  • Sample code that is used to demonstrate some API/feature, typically in a fairly minimalistic way. However, in these cases we often inline the sample code right into e.g. a window controller, something we wouldn't encourage developers to do in real apps.
  • Code that was a sample, but because it was handy to do so, we built integration tests on it, so the code now serves a sort of dual purpose. Things that were designed to be integration tests from the start are now located in dev/devicelab/integration_tests instead.

@redbrogdon @domesticmouse now that we have the flutter/samples repo, should the flutter/flutter examples directory even exist anymore? Do any of the samples in here make sense to move to flutter/samples? If not, perhaps we should move these to the devicelab integration tests directory?

@domesticmouse
Copy link
Contributor

There is at least one level on which this directory is different to the flutter/samples repo. This directory is maintained at head, whereas flutter/samples is mainly at stable. The other different is about who owns the code. I take no responsibility for maintaining what is here.

I'm just in the process of starting to tidy up the samples repo, looking to delete old cruft and think about what needs to be added. I'm unsure about taking on a bunch of new sample code while I'm paying down current tech debt.

@gspencergoog
Copy link
Contributor

The flutter examples/api directory definitely needs to continue to exist in the repo, at least.

@robert-ancell What is the intent of this sample: is it intended to be an example for how to use external textures, or is it meant to be more of a manual test for code in the repo? If it's the latter, we have a place for that in dev/manual_tests.

(Desktop Triage)

@robert-ancell
Copy link
Contributor Author

The intent is to be an example of how to use external textures.

@wanjm

This comment was marked as off-topic.

@gspencergoog
Copy link
Contributor

IMO, putting it in the examples directory is fine. We can always move it out later if we change our minds: it's not part of the API.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

lgtm modulo one nit.

@robert-ancell
Copy link
Contributor Author

Second PR is showing the same failures.

@robert-ancell
Copy link
Contributor Author

robert-ancell commented Jun 16, 2023

I think I've fixed the dependencies again as pointed out by @godofredoc. These constantly get out of sync with master. But the remaining build failures I can't see the issue - @godofredoc can you look again?

@loic-sharma
Copy link
Member

@reidbaker It looks like these CI failures might be caused by changes in: #125323

I'm not sure why this pull request is running into these issues, but it looks like there may be Gradle settings issues and ci.yaml tasks that need to be updated to JDK 17.

@reidbaker
Copy link
Contributor

Spot checking https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8777565447134219249/+/u/run_test.dart_for_build_tests_shard_and_subshard_1_3/test_stdout

I seeWelcome to Gradle 7.5 but your new example does not define a gradle wrapper file so I think that is the host version of gradle. That said 7.5 should build.

The pr you linked I dont think can be rolled back. It was needed to support the latest google shipped tooling and I dont think these tests are failing on master.

@reidbaker
Copy link
Contributor

It is possible that more tests need to be migrated to java 17. That pr was an attempt to get at least some testing migrated. I am not opposed to more (maybe even all?) of our testing migrated to java 17.

@gmackall
Copy link
Member

gmackall commented Jun 26, 2023

A guess at what might be happening here:
The distribution of the particular tests that are failing across shards is random, but with a fixed seed. So if the list of tests stays fixed, the distribution stays fixed. But this new example introduces a new item into the list, which means tests get re-distributed across shards.

This change made it so that some of the shards use jdk 17, while the rest use 11. This interacts with the tests in two ways:

  1. Some of the tests are using very old versions of AGP (android gradle plugin). They have been running on a shard with jdk 11, and suddenly get kicked onto a shard with jdk 17 and start failing, because they don't support this newer jdk.
    (These are the tests failing with java.lang.reflect.InaccessibleObjectException: Unable to make field private final...)
  2. Some examples are using AGP 8.0, which requires jdk 17. If they get kicked onto a shard running with jdk 11, they also start failing.
    (These are the tests failing with Android Gradle plugin requires Java 17 to run.)

If this is what is happening, it would be fixable by changing all the shards to use jdk 17, and upgrading all AGP versions in examples/ and integration_tests/ to >=7.3.0.

@gmackall
Copy link
Member

If this is what is happening, it would be fixable by changing all the shards to use jdk 17, and upgrading all AGP versions in examples/ and integration_tests/ to >=7.3.0.

The PR to do this was just merged, so if this was the cause updating the branch should hopefully fix the test failures!

@robert-ancell
Copy link
Contributor Author

It worked!! :)

@robert-ancell robert-ancell merged commit 9760bb0 into flutter:master Jul 3, 2023
@robert-ancell robert-ancell deleted the texture-example branch July 3, 2023 01:54
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 4, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 4, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jul 4, 2023
flutter/flutter@aa5f4a2...590ef2d

2023-07-04 [email protected] Roll Packages from cdae854 to a03b900 (1 revision) (flutter/flutter#129957)
2023-07-03 [email protected] Roll Packages from 53ed5a0 to cdae854 (9 revisions) (flutter/flutter#129918)
2023-07-03 [email protected] Roll Flutter Engine from e6b8292705a8 to 987b621eac4e (1 revision) (flutter/flutter#129863)
2023-07-03 [email protected] Add an example showing how to use textures (flutter/flutter#122779)
2023-07-01 [email protected] Update links to old linter site to dart.dev (flutter/flutter#129866)

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

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

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop a: text input Entering text in a text field or keyboard related problems c: contributor-productivity Team-specific productivity, code health, technical debt. d: examples Sample code and demos

Projects

None yet

Development

Successfully merging this pull request may close these issues.