Beginning work to refactor jpeg tile decoding.

Keep common code together, so we can fix bugs in tile and normal decode
simultaneously.

Convert if-then chains to switch statements for readability.

Add getBitmapConfig, common to both normal and tile decode, which
ensures that they behave the same. getBitmapConfig uses the code
originally in onDecode, so subsetting grayscale into A8 now works.

In getBitmapConfig, handle JCS_YCCK properly.

Fix a bug where requesting A8 from a JCS_CMYK image would
result in a total failure to decode, since we would change
out_color_space to an invalid choice.

Factor common code for applying dither and changing the
out_color_space into apply_dither_mode (final name TBD). Skips
CMYK like normal decoding did before.

BUG=skia:1472
BUG=https://b.corp.google.com/issue?id=9466275
BUG=https://b.corp.google.com/issue?id=9189955
R=mtklein@google.com

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

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