Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@flar
Copy link
Contributor

@flar flar commented Feb 16, 2023

Fixes flutter/flutter#120455

There is a small chance that the new FML_DCHECK will trigger in examples that we haven't seen yet, but that would point out more problems like this one that need to be fixed anyway.

This would be a good candidate to cherry-pick to any release that shipped with the original code in #34562.

@flar flar requested review from JsouLiang and dnfield February 16, 2023 21:02
return entry.image != nullptr;
}

int RasterCache::MarkSeen(const RasterCacheKeyID& id,
Copy link
Member

Choose a reason for hiding this comment

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

Super minor nit: Not sure about the out parameter. Perhaps a tuple or struct return. But your call.

Copy link
Contributor

Choose a reason for hiding this comment

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

Make this return std::tuple<int, bool>.

Callers can then do

int accesses;
bool has_image;
std::tie(accesses, has_image) = foo->MarkSeen(...);

and you don't have the out parameter anymore.

Copy link
Contributor Author

@flar flar Feb 17, 2023

Choose a reason for hiding this comment

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

I don't like returning unnamed parameters like that. Having the caller name them is bad practice - the API should describe its own return values. I used a struct instead.

@chinmaygarde
Copy link
Member

chinmaygarde commented Feb 16, 2023

I agree this should be cherry-picked. Seems low risk and high impact. cc @zanderso for cherry-picks guidance.

@flar: to any release with #34562

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM

@dnfield
Copy link
Contributor

dnfield commented Feb 17, 2023

@zanderso do you know what the. malioc failure means?

@flar flar force-pushed the cached-DL-opacity-inheritance-fix branch from b91cde5 to a224d6f Compare February 17, 2023 03:37
@flar
Copy link
Contributor Author

flar commented Feb 17, 2023

Rebased in an attempt to fix the malioc errors...

@flar flar added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 17, 2023
@auto-submit auto-submit bot merged commit 27696d2 into flutter:main Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
zanderso pushed a commit to zanderso/engine that referenced this pull request Feb 17, 2023
* only indicate opacity inheritance when DL is actually cached

* unit test

* use CacheInfo struct to simplify return values
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 17, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 17, 2023
…121004)

* 6a2a46a28 Roll Dart SDK from 3ec7f1f92216 to 7642080abaf7 (2 revisions) (flutter/engine#39702)

* f6bb7ae5f Roll Skia from d0df677ffd5e to ba60fed7f075 (6 revisions) (flutter/engine#39703)

* 27696d2b7 Cached DisplayList opacity inheritance fix (flutter/engine#39690)

* 1ae94738d Roll Dart SDK from 7642080abaf7 to 42829b6f80b1 (1 revision) (flutter/engine#39707)

* 676201790 Roll Fuchsia Linux SDK from yT4JLKTCWWwbRwB0l... to tMm2Lzb-LE20Rxwm9... (flutter/engine#39709)

* 26f1f251f Roll Skia from ba60fed7f075 to 5637cd56be32 (3 revisions) (flutter/engine#39710)

* 4b0b8f053 Roll Dart SDK from 42829b6f80b1 to c7ec16304216 (1 revision) (flutter/engine#39711)

* 1f7aad3a4 Roll Fuchsia Mac SDK from haDvcC5VzWVdQs9Rs... to _wymybZYKzX_3iFd6... (flutter/engine#39715)

* 067369d22 Migrate skia png codec call to public interface (flutter/engine#39714)

* 7e190a49c Roll Dart SDK from c7ec16304216 to 8a7dc36cadf6 (1 revision) (flutter/engine#39716)

* 83a896250 Roll Skia from 5637cd56be32 to 02890036028e (2 revisions) (flutter/engine#39717)

* 6d9387433 [linux] Eliminate mirrors support (flutter/engine#39701)

* adc0ebd97 Adds a Linux Fuchsia FEMU config that enables CSO (flutter/engine#39718)

* 0378b3406 [impeller] support generating mip-maps on Vulkan (flutter/engine#39689)

* 5212ac439 [Impeller] Device default attachment pixel formats (flutter/engine#39655)

* bd37a3992 Rollback Dart SDK to unblock the roller (flutter/engine#39722)
zanderso pushed a commit to zanderso/engine that referenced this pull request Mar 1, 2023
* only indicate opacity inheritance when DL is actually cached

* unit test

* use CacheInfo struct to simplify return values
@flar
Copy link
Contributor Author

flar commented Mar 1, 2023

Note that this fix creates a chicken-and-egg situation where an opacity parent with picture children that can only inherit opacity when they successfully cache themselves stalemate against each other in the decision as to who should do the caching. See flutter/flutter#121740

itsjustkevin pushed a commit that referenced this pull request Mar 2, 2023
* Cached DisplayList opacity inheritance fix (#39690)

* only indicate opacity inheritance when DL is actually cached

* unit test

* use CacheInfo struct to simplify return values

* Add const

* Update display_list_layer_unittests.cc

---------

Co-authored-by: Jim Graham <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flickering when adding a fully transparent spinner to a grid view

3 participants