Commit 8e204125 authored by Weiliang Chen's avatar Weiliang Chen Committed by Commit Bot

overlay: SkiaRenderer Android Classis Early Return if Video not Ready

In Android pre-SurfaceControl, we might encounter cases where the video
resource is not ready when we first re-open chromium. Match the behavior
of GLRenderer, and early return without crashing in SkiaRenderer.

Bug: 1016528
Change-Id: I28aae1c46e724c4c97cea4313c395a66f2af13b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1913168Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Commit-Queue: weiliangc <weiliangc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714948}
parent 5ef1a556
...@@ -1535,11 +1535,21 @@ void SkiaOutputSurfaceImplOnGpu::SendOverlayPromotionNotification( ...@@ -1535,11 +1535,21 @@ void SkiaOutputSurfaceImplOnGpu::SendOverlayPromotionNotification(
for (auto& denied : promotion_denied) { for (auto& denied : promotion_denied) {
auto shared_image_overlay = auto shared_image_overlay =
shared_image_representation_factory_->ProduceOverlay(denied); shared_image_representation_factory_->ProduceOverlay(denied);
// When display is re-opened, the first few frames might not have video
// resource ready. Possible investigation crbug.com/1023971.
if (!shared_image_overlay)
continue;
shared_image_overlay->NotifyOverlayPromotion(false, gfx::Rect()); shared_image_overlay->NotifyOverlayPromotion(false, gfx::Rect());
} }
for (auto& possible : possible_promotions) { for (auto& possible : possible_promotions) {
auto shared_image_overlay = auto shared_image_overlay =
shared_image_representation_factory_->ProduceOverlay(possible.first); shared_image_representation_factory_->ProduceOverlay(possible.first);
// When display is re-opened, the first few frames might not have video
// resource ready. Possible investigation crbug.com/1023971.
if (!shared_image_overlay)
continue;
shared_image_overlay->NotifyOverlayPromotion(true, possible.second); shared_image_overlay->NotifyOverlayPromotion(true, possible.second);
} }
#endif #endif
...@@ -1552,6 +1562,11 @@ void SkiaOutputSurfaceImplOnGpu::RenderToOverlay( ...@@ -1552,6 +1562,11 @@ void SkiaOutputSurfaceImplOnGpu::RenderToOverlay(
auto shared_image_overlay = auto shared_image_overlay =
shared_image_representation_factory_->ProduceOverlay( shared_image_representation_factory_->ProduceOverlay(
overlay_candidate_mailbox); overlay_candidate_mailbox);
// When display is re-opened, the first few frames might not have video
// resource ready. Possible investigation crbug.com/1023971.
if (!shared_image_overlay)
return;
// In current implementation, the BeginReadAccess will ends up calling // In current implementation, the BeginReadAccess will ends up calling
// CodecImage::RenderToOverlay. Currently this code path is only used for // CodecImage::RenderToOverlay. Currently this code path is only used for
// Android Classic video overlay, where update of the overlay plane is within // Android Classic video overlay, where update of the overlay plane is within
......
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