Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1422)

Unified Diff: cc/resources/gpu_rasterizer.cc

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/display_list_recording_source.cc ('k') | cc/resources/layer_quad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/gpu_rasterizer.cc
diff --git a/cc/resources/gpu_rasterizer.cc b/cc/resources/gpu_rasterizer.cc
index 6e318edabbe80a2c670eef3baf96abf9dd36d990..d810386da94a2c9ff36475e59590e2d79ed92787 100644
--- a/cc/resources/gpu_rasterizer.cc
+++ b/cc/resources/gpu_rasterizer.cc
@@ -120,9 +120,16 @@ void GpuRasterizer::RasterizeSource(
write_lock->InitSkSurface(use_worker_context, use_distance_field_text,
raster_source->CanUseLCDText(),
msaa_sample_count_);
+
+ SkSurface* sk_surface = write_lock->sk_surface();
+
+ // Allocating an SkSurface will fail after a lost context. Pretend we
+ // rasterized, as the contents of the resource don't matter anymore.
+ if (!sk_surface)
+ return;
+
SkMultiPictureDraw multi_picture_draw;
- multi_picture_draw.add(write_lock->sk_surface()->getCanvas(),
- picture.get());
+ multi_picture_draw.add(sk_surface->getCanvas(), picture.get());
multi_picture_draw.draw(msaa_sample_count_ > 0);
write_lock->ReleaseSkSurface();
}
@@ -169,6 +176,9 @@ void GpuRasterizer::AddToMultiPictureDraw(const Tile* tile,
msaa_sample_count_);
SkSurface* sk_surface = lock->sk_surface();
+
+ // Allocating an SkSurface will fail after a lost context. Pretend we
+ // rasterized, as the contents of the resource don't matter anymore.
if (!sk_surface)
return;
« no previous file with comments | « cc/resources/display_list_recording_source.cc ('k') | cc/resources/layer_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698