Merge new implementation of BitmapRegionDecoder.

This is a combination of the following 4 commits.

=====================================================================

Make SkBitmapRegionDecoder use SkAndroidCodec

The current implementation of SkBitmapRegionDecoder relies
on SkImageDecoder::decodeSubset() which itself relies on
forked copies of libjpeg and libpng.

This implementation has caused numerous correctness and memory
bugs, and also prevented us from updating to the latest
optimized versions of libjpeg-turbo and libpng.
https://docs.google.com/a/google.com/document/d/1w0vdC9sPPquwgJLY4wjBvzwm8QZIqIgg1q3tDEvOoUU/edit?usp=sharing

The SkAndroidCodec implementation fixes known correctness and
memory bugs, at least matches the performance of the
the old implementation (and in many cases improves upon it),
and uses standard copies of libjpeg-turbo and libpng.

In addition to improving region decodes, switching to new
copies of libjpeg-turbo and libpng will improve performance
of full image decodes significantly.  Jpeg, in particular,
will be about 2x faster.

Change-Id: Ia51645009b243607d3022d49e8e0c82ec4e959bc

=====================================================================

Make JavaPixelAllocator and RCPAllocator implement SkBRDAllocator

This will allow us to optimize decodes when destination memory
is zero initialized.

Change-Id: I1e56cd5410d1e9b6544b0e47aac8da740bca5252

=====================================================================

Fix build by using SkBRDAllocator

Change-Id: Icf031409f0e58496d80b9bdc91def8ff97f7d0d2

=====================================================================

Fix bug in RecyclingPixelAllocator::copyIfNecessary()

This was exposed by a new test that I hope to add to
the BitmapRegionDecoderTests.

Change-Id: Ic5a32e095ff3ce457abab7216a8da1acf17db27b

=====================================================================

Depends on adding libjpeg-turbo to the manifest.
Change-Id: Ic8ffa339722bfa9f40f44f68d03ce9a3faef1ee2

Depends on update to Skia.
Change-Id: I4bdaacb8a04e2dee5e3eccc58033601384c77b7d

BUG:25424175
BUG:25344771
http://skbug.com/1243
http://skbug.com/4475
https://code.google.com/p/android/issues/detail?id=77195
http://skbug.com/4417
https://code.google.com/p/android/issues/detail?id=162760
http://skbug.com/4264
https://code.google.com/p/android/issues/detail?id=76976
http://skbug.com/4418
http://skbug.com/1282
https://code.google.com/p/android/issues/detail?id=189248
https://code.google.com/p/android/issues/detail?id=80316
https://buganizer.corp.google.com/u/0/issues/20224409
http://skbug.com/4319
http://skbug.com/4361
https://code.google.com/p/android/issues/detail?id=165546
https://code.google.com/p/android/issues/detail?id=81068
https://buganizer.corp.google.com/u/0/issues/22527238
https://buganizer.corp.google.com/u/0/issues/23731509
https://code.google.com/p/skia/issues/detail?id=4469
http://skbug.com/4360
http://skbug.com/4489
http://skbug.com/4490
4 files changed