-
Notifications
You must be signed in to change notification settings - Fork 6k
Cached DisplayList opacity inheritance fix #39690
Cached DisplayList opacity inheritance fix #39690
Conversation
flow/raster_cache.cc
Outdated
| return entry.image != nullptr; | ||
| } | ||
|
|
||
| int RasterCache::MarkSeen(const RasterCacheKeyID& id, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
dnfield
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@zanderso do you know what the. malioc failure means? |
b91cde5 to
a224d6f
Compare
|
Rebased in an attempt to fix the malioc errors... |
* only indicate opacity inheritance when DL is actually cached * unit test * use CacheInfo struct to simplify return values
…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)
* only indicate opacity inheritance when DL is actually cached * unit test * use CacheInfo struct to simplify return values
|
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 |
* 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]>
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.