Skip to content

Commit

Permalink
Check for a non-null GrContext on the media::Context3D during paint.
Browse files Browse the repository at this point in the history
The code checks that a ContextProvider was able to be found by checking
the |gl| field. But if the ContextProvider was created but lost, and
GrContext was not created yet, then it will fail to initialize and be
null. We should avoid trying to use this context then (and not crash).

[email protected]
BUG=612087

Review-Url: https://codereview.chromium.org/2003833002
Cr-Commit-Position: refs/heads/master@{#395222}
  • Loading branch information
danakj authored and Commit bot committed May 21, 2016
1 parent 65d368f commit 53f7ec9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions media/blink/webmediaplayer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,10 @@ void WebMediaPlayerImpl::paint(blink::WebCanvas* canvas,
if (video_frame.get() && video_frame->HasTextures()) {
if (!context_3d_cb_.is_null())
context_3d = context_3d_cb_.Run();
// GPU Process crashed.
if (!context_3d.gl)
return;
return; // Unable to get/create a shared main thread context.
if (!context_3d.gr_context)
return; // The context has been lost since and can't setup a GrContext.
}
skcanvas_video_renderer_.Paint(video_frame, canvas, gfx::RectF(gfx_rect),
alpha, mode, pipeline_metadata_.video_rotation,
Expand Down

0 comments on commit 53f7ec9

Please sign in to comment.