Commit 253d61fc authored by Daniel Nicoara's avatar Daniel Nicoara Committed by Commit Bot

cast: Invalidate displays on configuration change

If the GPU process gets killed, display configuration changes. Ozone
signals when the previous display configuration is invalidated. Use the
signal to invalidate the cached state otherwise any display related call
in between invalidation and the new state would cause a crash.

Bug: b/167033029
Test: CQ
Change-Id: Ib65dbb8141f70c24d9619400f3c8ebd236143c70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2385757Reviewed-by: default avatarSean Topping <seantopping@chromium.org>
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803623}
parent 05c7f958
......@@ -126,6 +126,10 @@ void CastDisplayConfigurator::OnConfigurationChanged() {
false /* force_initial_configure */));
}
void CastDisplayConfigurator::OnDisplaySnapshotsInvalidated() {
display_ = nullptr;
}
void CastDisplayConfigurator::EnableDisplay(
display::ConfigureCallback callback) {
if (!delegate_ || !display_)
......
......@@ -45,7 +45,7 @@ class CastDisplayConfigurator : public display::NativeDisplayObserver {
// display::NativeDisplayObserver implementation
void OnConfigurationChanged() override;
void OnDisplaySnapshotsInvalidated() override {}
void OnDisplaySnapshotsInvalidated() override;
void EnableDisplay(display::ConfigureCallback callback);
void DisableDisplay(display::ConfigureCallback callback);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment