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
Raster paint whole layer even only changed partial segment #65007
Comments
Hi @fredlee12345678 Please also share the actual vs expected results. Thank you |
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
// debugPaintLayerBordersEnabled = true;
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
// checkerboardOffscreenLayers: true,
checkerboardRasterCacheImages: true,
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: GridView.builder(
itemCount: 12,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 1,
mainAxisSpacing: 20.0,
crossAxisSpacing: 10.0,
childAspectRatio: 1.0),
itemBuilder: (context, index) {
return Image.asset('assets/$index');
}),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add,color: Colors.red,),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
} Here is my asset fils. you can copy it to your project➜ bin git:(stable) ✗ ./flutter doctor -v [✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.5 19F101, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2) [✓] Xcode - develop for iOS and macOS (Xcode 11.6) [✓] Android Studio (version 3.6) [✓] IntelliJ IDEA Ultimate Edition (version 2019.2) [✓] Connected device (2 available) • No issues found! ====================================== My expect: |
Sorry, where this picturelayer::paint is being called? Can you clarify how one can assert that (and where) is picturelayer::paint is being called? |
Possibly duplicate of #33939? |
@knopp yes, it's same issue, so we can close this issue |
Closing this one as a duplicate of #33939 |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Details
Target Platform: Android & IOS
Target OS version/browser:
Devices: All
Flutter Version : 1.17.5
Desctiption
I have a simple code is that :
Code:
body:GridView.builder(
itemCount: 500,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 1,
mainAxisSpacing: 20.0,
crossAxisSpacing: 10.0,
childAspectRatio: 1.0),
itemBuilder: (context, index) {
return Image.asset('assets/$index');}
If I have an animated image , I found that raster task will paint the whole layer , not the changed layer. I think it's very poor performance. Why not just only paint the changed segment? Thanks
The text was updated successfully, but these errors were encountered: