-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] null check drawable. #47488
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
|
||
| auto* mtl_layer = (CAMetalLayer*)layer; | ||
|
|
||
| auto drawable = impeller::SurfaceMTL::GetMetalDrawableAndValidate( |
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.
This can be nullptr, see
engine/impeller/renderer/backend/metal/surface_mtl.mm
Lines 26 to 39 in 47465eb
| if (context == nullptr || !context->IsValid() || layer == nil) { | |
| return nullptr; | |
| } | |
| id<CAMetalDrawable> current_drawable = nil; | |
| { | |
| TRACE_EVENT0("impeller", "WaitForNextDrawable"); | |
| current_drawable = [layer nextDrawable]; | |
| } | |
| if (!current_drawable) { | |
| VALIDATION_LOG << "Could not acquire current drawable."; | |
| return nullptr; | |
| } |
|
Should this have a test, or does it need a test exemption? |
|
Based on our discussion this week, this needs a test and I plan on adding one ... a bit later. :) |
|
I have added tests. |
shell/gpu/BUILD.gn
Outdated
| sources += [ "gpu_surface_metal_impeller_unittests.mm" ] | ||
| } | ||
|
|
||
| if (is_mac) { |
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.
Consider combining back-to-back if (is_mac)
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.
Done
matanlurey
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.
L GEE TEE EM
|
Tests are working for real! |
|
nvm still not working. |
…138096) flutter/engine@117d47a...b0310da 2023-11-08 jonahwilliams@google.com [Impeller] null check drawable. (flutter/engine#47488) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC bdero@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Speculative fix for the first crash noted in flutter/flutter#136628 (comment)
nextDrawble can return null if the method times out.
Fixes flutter/flutter#136525