Commit 388d2254 authored by Justin Novosad's avatar Justin Novosad Committed by Commit Bot

Fix crash in OffscreenCanvas frame dispatch.

Crash happens when a the frame to be presents fails to be uploaded
to a texture (e.g. exceeds max texture size)

BUG=793651

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I7fd6373cbc6bd4d070de8fd0f4731068846242d1
Reviewed-on: https://chromium-review.googlesource.com/820159Reviewed-by: default avatarOlivia Lai <xlai@chromium.org>
Commit-Queue: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523490}
parent 4aff0098
...@@ -205,10 +205,13 @@ void OffscreenCanvasFrameDispatcherImpl::DispatchFrame( ...@@ -205,10 +205,13 @@ void OffscreenCanvasFrameDispatcherImpl::DispatchFrame(
if (SharedGpuContext::IsGpuCompositingEnabled()) { if (SharedGpuContext::IsGpuCompositingEnabled()) {
// Case 3: canvas is not gpu-accelerated, but compositor is. // Case 3: canvas is not gpu-accelerated, but compositor is.
commit_type = kCommitSoftwareCanvasGPUCompositing; commit_type = kCommitSoftwareCanvasGPUCompositing;
scoped_refptr<StaticBitmapImage> accelerated_image =
image->MakeAccelerated(SharedGpuContext::ContextProviderWrapper());
if (!accelerated_image)
return;
offscreen_canvas_resource_provider_ offscreen_canvas_resource_provider_
->SetTransferableResourceToStaticBitmapImage( ->SetTransferableResourceToStaticBitmapImage(resource,
resource, image->MakeAccelerated( accelerated_image);
SharedGpuContext::ContextProviderWrapper()));
} else { } else {
// Case 4: both canvas and compositor are not gpu accelerated. // Case 4: both canvas and compositor are not gpu accelerated.
commit_type = kCommitSoftwareCanvasSoftwareCompositing; commit_type = kCommitSoftwareCanvasSoftwareCompositing;
......
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