[go: nahoru, domu]

Skip to content

Commit

Permalink
Only emit image painting events in debug & profile modes. (#118872)
Browse files Browse the repository at this point in the history
* Only emit image painting events in debug & profile modes.

These events were being emitted in release mode, which was showing up in the
profiler for my app as taking up a noticeable amount of build time (still
well within the frame budget, but this code was near the top of the list).

* Review comment
  • Loading branch information
tvolkert committed Jan 25, 2023
1 parent 426cdd9 commit 83c3a61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/painting/decoration_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ void paintImage({
return true;
}());
// Avoid emitting events that are the same as those emitted in the last frame.
if (!_lastFrameImageSizeInfo.contains(sizeInfo)) {
if (!kReleaseMode && !_lastFrameImageSizeInfo.contains(sizeInfo)) {
final ImageSizeInfo? existingSizeInfo = _pendingImageSizeInfo[sizeInfo.source];
if (existingSizeInfo == null || existingSizeInfo.displaySizeInBytes < sizeInfo.displaySizeInBytes) {
_pendingImageSizeInfo[sizeInfo.source!] = sizeInfo;
Expand Down

0 comments on commit 83c3a61

Please sign in to comment.