Repository navigation
Revert: Reland "[android]: prewarms shaders when the context is created" - #196575
Conversation
…ed" (flutter#196549)" This reverts commit 0c46d96.
There was a problem hiding this comment.
Code Review
This pull request removes the pipeline warming mechanism, including WarmDefaultPipelines and StartWarmingDefaultPipelines, from Impeller and the Android platform view, refactoring ContentContext to initialize its pipelines directly in its constructor. It also removes associated unit tests and mock classes. Feedback on the changes highlights a potential null pointer dereference in the ContentContext constructor, where context_ is dereferenced in the initializer list prior to the null check.
| ContentContext::ContentContext( | ||
| std::shared_ptr<Context> context, | ||
| std::shared_ptr<TypographerContext> typographer_context, | ||
| std::shared_ptr<RenderTargetAllocator> render_target_allocator) | ||
| : context_(std::move(context)), | ||
| lazy_glyph_atlas_( | ||
| std::make_shared<LazyGlyphAtlas>(std::move(typographer_context))), | ||
| pipelines_(new Pipelines()), | ||
| tessellator_(std::make_shared<Tessellator>( | ||
| context_->GetCapabilities()->Supports32BitPrimitiveIndices())), | ||
| render_target_cache_(render_target_allocator == nullptr | ||
| ? std::make_shared<RenderTargetCache>( | ||
| context_->GetResourceAllocator()) | ||
| : std::move(render_target_allocator)), | ||
| data_host_buffer_(HostBuffer::Create( | ||
| context_->GetResourceAllocator(), | ||
| context_->GetIdleWaiter(), | ||
| context_->GetCapabilities()->GetMinimumUniformAlignment(), | ||
| context_->GetSubmissionTracker())), | ||
| text_shadow_cache_(std::make_unique<TextShadowCache>()) { | ||
| if (!context_ || !context_->IsValid()) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
The constructor's initializer list dereferences context_ (via context_->GetCapabilities() and context_->GetResourceAllocator()) before the null check if (!context_ || !context_->IsValid()) on line 550 is executed. If context is null, this will result in a guaranteed null pointer dereference crash.\n\nTo prevent this, we should move the initialization of tessellator_, render_target_cache_, and data_host_buffer_ into the constructor body, after the safety check.
ContentContext::ContentContext(\n std::shared_ptr<Context> context,\n std::shared_ptr<TypographerContext> typographer_context,\n std::shared_ptr<RenderTargetAllocator> render_target_allocator)\n : context_(std::move(context)),\n lazy_glyph_atlas_(\n std::make_shared<LazyGlyphAtlas>(std::move(typographer_context))),\n pipelines_(new Pipelines()),\n text_shadow_cache_(std::make_unique<TextShadowCache>()) {\n if (!context_ || !context_->IsValid()) {\n return;\n }\n\n tessellator_ = std::make_shared<Tessellator>(\n context_->GetCapabilities()->Supports32BitPrimitiveIndices());\n render_target_cache_ = render_target_allocator == nullptr\n ? std::make_shared<RenderTargetCache>(\n context_->GetResourceAllocator())\n : std::move(render_target_allocator);\n data_host_buffer_ = HostBuffer::Create(\n context_->GetResourceAllocator(),\n context_->GetIdleWaiter(),\n context_->GetCapabilities()->GetMinimumUniformAlignment(),\n context_->GetSubmissionTracker());|
Detected the If you add the The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue". |
flutter/flutter@1b95854...d8bd864 2026-11-16 [email protected] Roll Skia from f2790b0ea630 to 118eaff3deb4 (8 revisions) (flutter/flutter#196661) 2026-11-16 [email protected] [native_assets] Keep a dylib's install name in flutter test when its path does not fit (flutter/flutter#194802) 2026-11-16 [email protected] Reland "[android]: prewarms shaders when the context is created" (flutter/flutter#196579) 2026-11-16 [email protected] [flutter_tools] Bound Browser.close in Chromium.close (flutter/flutter#196211) 2026-11-16 [email protected] Roll Skia from e8ff7a4187ec to f2790b0ea630 (13 revisions) (flutter/flutter#196652) 2026-11-14 [email protected] Revert: Balance web_canvaskit_tests and web_skwasm_tests subshards by duration (flutter/flutter#196580) 2026-11-14 [email protected] Revert: Reland "[android]: prewarms shaders when the context is created" (flutter/flutter#196575) 2026-11-14 [email protected] [flutter_tools] Guard ExtensionManager initialization against concurrent disposal (flutter/flutter#196459) 2026-11-14 [email protected] [ImpellerC] Escape spaces in depfile paths (flutter/flutter#196555) 2026-11-14 [email protected] Reland "[android]: prewarms shaders when the context is created" (flutter/flutter#196549) 2026-11-14 [email protected] Balance web_canvaskit_tests and web_skwasm_tests subshards by duration (flutter/flutter#196260) 2026-11-13 [email protected] Safely return null on malformed stack trace line in StackFrame.fromStackTraceLine (flutter/flutter#194673) 2026-11-13 [email protected] Clarify that super.dispose() must be called synchronously (flutter/flutter#193416) 2026-11-13 [email protected] Consolidate exit-code parameters on runCommand with ExpectedExit (flutter/flutter#196479) 2026-11-13 [email protected] Support multi-view apps in widget test binding (flutter/flutter#194480) 2026-11-13 [email protected] Document using a ListView inside a Column (flutter/flutter#195145) 2026-11-13 [email protected] Add didChangeAlwaysUse24HourFormat to WidgetsBinding and update MediaQuery (flutter/flutter#196117) 2026-11-13 [email protected] Build local engine wasm configs on 32-core Linux bots (flutter/flutter#196284) 2026-11-13 [email protected] [Android] Fix Hybrid Composition resize deadlock (flutter/flutter#196255) 2026-11-13 [email protected] Roll Skia from 11f46cfe8838 to e8ff7a4187ec (9 revisions) (flutter/flutter#196557) 2026-11-13 [email protected] [Impeller] Fix SurfaceContextVK submission tracking and double HostBuffer reset (flutter/flutter#196064) 2026-11-13 [email protected] Manual roll Packages from 14f9933 to 015df97 (5 revisions) (flutter/flutter#196558) 2026-11-13 [email protected] Remove routes_transition_test from widgets (flutter/flutter#186620) 2026-11-13 [email protected] [flutter_tools] Replace TargetPlatform.simpleName with cpuArch (flutter/flutter#196264) 2026-11-13 [email protected] Add a deferred platform-view-created path to the shell and use it on Android (flutter/flutter#196342) 2026-11-13 [email protected] Optimize RenderSliverVariedExtentList and introduce protected itemExtentOf API in RenderSliverFixedExtentBoxAdaptor (flutter/flutter#192384) 2026-11-13 [email protected] Revert: [android]: prewarms shaders when the context is created (flutter/flutter#196468) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
Reverts: Reland "[android]: prewarms shaders when the context is created"
Initiated by: @gaaclarke
Reason for reverting: merge conflict with #196342 causing post submit failures ( example)
Original PR Author: @gaaclarke
Reviewed By: @andywolff
The original PR description is provided below:
relands #196069
Additions since relanding:A test has been added to duplicate the failure in the android test runnerA flush was added to the io thread when the io thread's context is setThe warmup is now limited to opengles since we got mixed results from vulkan.Additions since relanding:
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.