[skif] Use SkBitmapDevice::Create in Backend::makeDevice
Create has a lot more validation than just tryAlloc on SkBitmap,
in particular, tryAlloc will return true if you try to allocate
storage for an empty bitmap.
Upstream logic in AutoSurface assumes that empty bounds would fail
to have a Device created. For raster backend, we'd end up drawing into
it (a no-op), but then try to snap an SkSpecialImage from it, which
then hits an assert.
This was causing crashes in https://chromium-review.googlesource.com/c/chromium/src/+/4976837,
which I could reproduce by running a captured SKP in viewer and
moving the content offscreen.
Bug: b/40042615
Bug: b/40042366
Bug: b/40040587
Change-Id: I9bbb3f7f178491ca2002d895472c490a21c1ecbc
Bug: b/40040587
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/771897
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
1 file changed