From 0ce3d43df9cbada290008efcb183cedbcbe0aeed Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Thu, 8 Jun 2017 11:07:18 -0400 Subject: Fix native_image_to_raster_surface crash in ANGLE msaa configs We only support MSAA with RGBA (not BGRA), on ANGLE, so we were failing to construct the GPU surface. Instead, use the original canvas' info to make the image surface (but always use N32 to make the raster surface). I think this will fix the Ubuntu Intel glesmsaa4 crashes, too, although I don't have a machine to test on right now. Bug: skia:6457 skia:6401 Change-Id: Icfc47845e97ef0806fb6d875f454d3920020ffbd Reviewed-on: https://skia-review.googlesource.com/19054 Reviewed-by: Brian Salomon Commit-Queue: Brian Osman --- bench/ImageBench.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bench/ImageBench.cpp') diff --git a/bench/ImageBench.cpp b/bench/ImageBench.cpp index fbfce05a66..d8260e7ca2 100644 --- a/bench/ImageBench.cpp +++ b/bench/ImageBench.cpp @@ -30,13 +30,14 @@ protected: // void onPerCanvasPreDraw(SkCanvas* canvas) override { // create an Image reflecting the canvas (gpu or cpu) - SkImageInfo info = SkImageInfo::MakeN32Premul(100, 100); + SkImageInfo info = canvas->imageInfo().makeWH(100, 100); auto surface(canvas->makeSurface(info)); canvas->drawColor(SK_ColorRED); fImage = surface->makeImageSnapshot(); // create a cpu-backed Surface - fRasterSurface = SkSurface::MakeRaster(info); + SkImageInfo n32Info = SkImageInfo::MakeN32Premul(100, 100); + fRasterSurface = SkSurface::MakeRaster(n32Info); } void onPerCanvasPostDraw(SkCanvas*) override { -- cgit v1.2.3