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 <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2017-06-08 11:07:18 -04:00 committed by Skia Commit-Bot
parent a6b2ba2153
commit 0ce3d43df9

View File

@ -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 {