Changes to make SkPDiff more robost.

bitmap_to_cielab now returns a boolean. Instead of asserting that the
config is 8888, copy to 8888 (and return false on failure). This allows
skpdiff to work on Index8 bitmaps (without changing the code that does
the real work). If it returns false, do not attempt to create a pmetric.

In pmetric, exit early if maxLevels is <= 2, since this would crash later
in the function (creation of an ImageL3D if maxLevels is 0, and then the
creation of an array of a negative number of entries). maxLevels is small
if the width or height of the image is small (i.e. a bitmap with width 1
has maxLevels of 0).

R=djsollen@google.com

Review URL: https://codereview.chromium.org/65253002

git-svn-id: http://skia.googlecode.com/svn/trunk@12239 2bbb7eff-a529-9590-31e7-b0007b416f81
1 file changed