Change SkSpecialImage::makeSurface and makeTightSurface to take output
authorbrianosman <brianosman@google.com>
Fri, 23 Sep 2016 15:11:55 +0000 (08:11 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 23 Sep 2016 15:11:55 +0000 (08:11 -0700)
commit53c38087949252d27cde668368a3eeb59cc2eb00
tree9d005cd6e6037f4b64d1140786e4e687f062f063
parent27a3aa5921b2aaf95314f955285c3cba91e4c19a
Change SkSpecialImage::makeSurface and makeTightSurface to take output
properties (color space), bounds, and (optional) alphaType.

We were being pretty inconsistent before. Raster was honoring all
components of the info. GPU was using the supplied color type, but
propagating the source's color space. All call sites were saying N32.

What we want to do is propagate the original device's color space, and
pick a good format from that. Rather than force all the clients to
jump through hoops constructing an SkImageInfo that meets our criteria,
just have them supply the few bits we care about, and do everything else
internally.

This also lets us always use RGBA on GPU, but N32 on raster.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2349373004

Review-Url: https://codereview.chromium.org/2349373004
15 files changed:
src/core/SkImageFilter.cpp
src/core/SkMatrixImageFilter.cpp
src/core/SkSpecialImage.cpp
src/core/SkSpecialImage.h
src/effects/SkColorFilterImageFilter.cpp
src/effects/SkDisplacementMapEffect.cpp
src/effects/SkDropShadowImageFilter.cpp
src/effects/SkImageSource.cpp
src/effects/SkMergeImageFilter.cpp
src/effects/SkOffsetImageFilter.cpp
src/effects/SkPaintImageFilter.cpp
src/effects/SkPictureImageFilter.cpp
src/effects/SkTileImageFilter.cpp
src/effects/SkXfermodeImageFilter.cpp
tests/SpecialImageTest.cpp