Make SkImageInfo::validRowBytes consider alignment

SkSurface will already reject a rowBytes that does not align on a pixel
boundary. Push that check into SkImageInfo. This will make SkBitmap,
SkPixmap, SkMallocPixelRef, and SkImage_Raster, which already call
validRowBytes, make the same check. If an SkSurface cannot use a
non-pixel-aligned rowBytes, then an SkCanvas wrapping an SkBitmap should
not either.

Update MallocPixelRefTest to use a rowBytes that is still valid.

Change-Id: I848d94dbeab8b58b92877104dd67ea23a9d19ca8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265599
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
6 files changed