Fix various SkBitmap::copyTo() bugs
authorMatt Sarett <msarett@google.com>
Wed, 5 Apr 2017 19:41:53 +0000 (15:41 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Wed, 5 Apr 2017 20:22:11 +0000 (20:22 +0000)
commitd9836f44fb8b0482f6d0aaebf92d721200150c3d
tree6404d17a71e62bd09087213502b6fb78a7b57df7
parent2d2ac3d1629c10c31bf946681728297fcd7c7cdb
Fix various SkBitmap::copyTo() bugs

I believe that the best fix is to move this entire function into the
framework and call SkPixmap::readPixels() from there.  Given that,
we have already branched, I think this is the simplest fix.

(1) We never added F16 support.  Enable F16.  This involves assigning
    color spaces to src and dst pixmaps so that the conversion makes
    sense.
(2) SkPixmap::readPixels() does not support parametric transfer
    functions.  Fortunately, the framework never uses copyTo() to
    do color space conversions.  We should at least support the
    case where the src color space matches the dst color space.

Bug: skia:
Change-Id: I129b7c02249eed34a9ec4aa0ca736aadccc19777
Reviewed-on: https://skia-review.googlesource.com/11387
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
src/core/SkBitmap.cpp
tests/BitmapCopyTest.cpp