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

Defer Image Decode unavailable on OPPO A57 when scroll fast #58762

Open
fredlee12345678 opened this issue Jun 5, 2020 · 6 comments
Open

Defer Image Decode unavailable on OPPO A57 when scroll fast #58762

fredlee12345678 opened this issue Jun 5, 2020 · 6 comments
Labels
e: device-specific Only manifests on certain devices engine flutter/engine repository. See also e: labels. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@fredlee12345678
Copy link

fredlee12345678 commented Jun 5, 2020

Flutter Version

Flutter 1.17.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision f7a6a7906b • 2020-05-12 18:39:00 -0700
Engine • revision 6bc433c6b6
Tools • Dart 2.8.2

Target OS version/browser:
6.0.1
Devices:
OPPO A57

Logs

I create a gridview to load image from asset, when I scroll very fast I notice the velocity of gridview is 0, so Image.dart will decode all image.

@fredlee12345678 fredlee12345678 added the from: performance template Issues created via a performance issue template label Jun 5, 2020
@iapicca
Copy link
Contributor

iapicca commented Jun 5, 2020

Hi @fredlee12345678
Please take a look at the docs and this video
also see https://flutter.dev/community for resources and asking questions like this,
you may also get some help if you post it on Stack Overflow and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
Closing, as this isn't an issue with Flutter itself. If you disagree, please write in the comments and I will reopen it.
Thank you

@iapicca iapicca closed this as completed Jun 5, 2020
@fredlee12345678
Copy link
Author

hi @iapicca

Thanks for your response, but I can't agree with you it's not a issue.

According to #49389. When I scrolling very fast, the velocity of gridview should be very large not zero. So I don't know why you mean this is not a issue. If you need me give more details like code, please tell me ,Thanks very much

@iapicca iapicca reopened this Jun 5, 2020
@iapicca
Copy link
Contributor

iapicca commented Jun 5, 2020

Hi @fredlee12345678
Can you please provide your a minimal complete reproducible code sample.
Thank you

@iapicca iapicca added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds and removed from: performance template Issues created via a performance issue template labels Jun 5, 2020
@fredlee12345678
Copy link
Author

fredlee12345678 commented Jun 8, 2020

 Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Auto Scroll'),
        actions: <Widget>[
          // NEW
          IconButton(
            // NEW
              icon: Icon(Icons.arrow_downward),
              onPressed: showImage) // NEW
        ], // NEW
      ),

      body: GridView.builder(
          itemCount: 500,
          gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
              crossAxisCount: 3,
              mainAxisSpacing: 20.0,
              crossAxisSpacing: 10.0,
              childAspectRatio: 1.0),
          itemBuilder: (context, index) {
            final int imageindex = index % 74;
            final String imageurl =
                'https://picsum.photos/250?image=$imageindex';
            String imagename = 'assets/' + imageindex.toString();
            return Container(
              color: Color.fromARGB(255, 255, 0, 0),
              child: Image.network(imageurl),
            );

          }),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
        },
        tooltip: 'push',
        child: Icon(Icons.add),
      ),
    );
  }

@iapicca , And I print velocity at scroll_physics.dart:

 bool recommendDeferredLoading(double velocity, ScrollMetrics metrics, BuildContext context) {
    assert(velocity != null);
    assert(metrics != null);
    assert(context != null);
    if (parent == null) {
      final double maxPhysicalPixels = WidgetsBinding.instance.window.physicalSize.longestSide;
      debugPrint('velocity : $velocity');  // Print velocity here
      return velocity.abs() > maxPhysicalPixels;
    }
    return parent.recommendDeferredLoading(velocity, metrics, context);
  }

Here is Log:

06-08 14:21:17.676 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6962.726182351891
06-08 14:21:17.676 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6962.726182351891
06-08 14:21:17.676 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6962.726182351891
06-08 14:21:17.729 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.729 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.729 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.729 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.729 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.730 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.730 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.730 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.730 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.730 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.730 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.730 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6541.947152248591
06-08 14:21:17.744 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.745 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
06-08 14:21:17.746 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6438.872011182599
**06-08 14:21:17.763 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.763 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.763 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.763 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.763 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.764 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.764 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.764 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.764 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.764 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.764 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.764 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.765 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.765 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.765 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.796 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.796 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.797 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.810 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.811 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.811 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0**
06-08 14:21:17.844 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7298.204568270825
06-08 14:21:17.844 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7298.204568270825
06-08 14:21:17.844 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7298.204568270825
06-08 14:21:17.860 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7190.79740037913
06-08 14:21:17.860 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7190.79740037913
06-08 14:21:17.860 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7190.79740037913
06-08 14:21:17.860 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7190.79740037913
06-08 14:21:17.861 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7190.79740037913
06-08 14:21:17.861 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7190.79740037913
06-08 14:21:17.876 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7084.206071311112
06-08 14:21:17.877 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7084.206071311112
06-08 14:21:17.877 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7084.206071311112
06-08 14:21:17.877 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7084.206071311112
06-08 14:21:17.877 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7084.206071311112
06-08 14:21:17.877 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 7084.206071311112
06-08 14:21:17.903 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6978.443368701475
06-08 14:21:17.904 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6978.443368701475
06-08 14:21:17.904 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6978.443368701475
06-08 14:21:17.904 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6978.443368701475
06-08 14:21:17.904 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6978.443368701475
06-08 14:21:17.904 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6978.443368701475
06-08 14:21:17.904 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6978.443368701475
06-08 14:21:17.904 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6978.443368701475
06-08 14:21:17.905 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 6978.443368701475
**06-08 14:21:17.965 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.965 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.965 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.965 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.966 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.966 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.966 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.966 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0
06-08 14:21:17.966 22665-22679/kuaishou.com.testimagedemo1171 I/flutter: velocity : 0.0**

To reproduce this case, I think you need to find a low performance mobile. this case not reproduced on Pixel 3XL.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jun 8, 2020
@iapicca iapicca added a: images Loading, displaying, rendering images e: device-specific Only manifests on certain devices engine flutter/engine repository. See also e: labels. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically found in release: 1.17 Found to occur in 1.17 has reproducible steps The issue has been confirmed reproducible and is ready to work on and removed in triage Presently being triaged by the triage team labels Jun 8, 2020
@goderbauer
Copy link
Member

/cc @dnfield

@dnfield dnfield removed the a: images Loading, displaying, rendering images label Jun 10, 2020
@dnfield
Copy link
Contributor

dnfield commented Jun 10, 2020

This seems like it is probably a bug on that specific phone for pointer data/touch input stuff. I'm removing the images label based on that.

@fredlee12345678 - are you able to instrument

void _handlePointerDataPacket(ui.PointerDataPacket packet) {
to see if you can figure out if there are differences in the pointer data packages on a Pixel vs. the OPPO?

@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label Dec 11, 2020
@TahaTesser TahaTesser added passed first triage and removed found in release: 1.17 Found to occur in 1.17 has reproducible steps The issue has been confirmed reproducible and is ready to work on labels Jan 29, 2021
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-android Owned by Android platform team triaged-android Triaged by Android platform team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e: device-specific Only manifests on certain devices engine flutter/engine repository. See also e: labels. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests

7 participants