Commit Graph

9 Commits

Author SHA1 Message Date
Brian Osman
8915058264 readpixels GM uses GPU image in GPU configs
This now demonstrates that readPixels does not do color sapce conversion
in Ganesh (and fails completely for unpremul F16). Next: fix those issues.

BUG=skia:5853

Change-Id: If3bd1882249ae85b4738ef72e16cfb87b06b9363
Reviewed-on: https://skia-review.googlesource.com/9904
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-03-21 12:47:03 +00:00
Brian Osman
b1168a7c9a Improvements to readpixels GM
We don't support unpremultiplied images. Therefore:
- Don't test unpremul source images.
- After doing an unpremultiplying read, make sure to premul before drawing

For this to work with F16, add support for F16 sources to
SkColorSpaceXform.

Public API change is comments-only.
TBR=reed@google.com

BUG=skia:

Change-Id: Ie05b58231e99ca88cd7792b65ffbb4f390b01726
Reviewed-on: https://skia-review.googlesource.com/9900
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-03-20 18:53:57 +00:00
Matt Sarett
9df70bb74d Picture backed images must have a bit depth and color space
Enforce that picture backed images created by the public API
must have a non-null SkColorSpace.

SkPictureShader uses a private call to get around this restriction.

BUG=skia:

Change-Id: I2fc11a8ffe583035d09e83abf40b827fbf575321
Reviewed-on: https://skia-review.googlesource.com/8415
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-02-14 21:32:10 +00:00
Matt Sarett
77a7a1b57c SkColorSpace: remove named API, add gamut API
Reland from: https://skia-review.googlesource.com/c/8021/

BUG=skia:

Change-Id: I18985f130587b15fccbc86b76b2bb5c49ba5ba8a
Reviewed-on: https://skia-review.googlesource.com/8136
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-02-07 19:33:37 +00:00
Matt Sarett
1f2fff2544 Revert "SkColorSpace: remove named API, add gamut API"
This reverts commit ecaaf6f1c1.

Reason for revert: Breaks everything

Original change's description:
> SkColorSpace: remove named API, add gamut API
> 
> BUG=skia:
> 
> Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6
> Reviewed-on: https://skia-review.googlesource.com/8021
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
> 

TBR=msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Change-Id: Ief5a0a4eeabe75a21f7512e23fc15309151066c4
Reviewed-on: https://skia-review.googlesource.com/8127
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-02-07 17:06:24 +00:00
Matt Sarett
ecaaf6f1c1 SkColorSpace: remove named API, add gamut API
BUG=skia:

Change-Id: I01c5e1874c9a034febc64e25b3aaafb5050393a6
Reviewed-on: https://skia-review.googlesource.com/8021
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-02-07 17:00:58 +00:00
Matt Sarett
34855f9e1c Add readPixels() tests for generator backed images
Good news:
Everything seems to work as it is supposed to.  That's why this
CL is just tests.

Bad news:
Picture is a bit strange in that the caching behavior may affect
how the output looks.  Ex: If we choose to cache, we will first
draw into the picture's colorSpace and then convert that to the
dstColorSpace.  If we choose not to cache, we will draw directly
into the dstColorSpace.
And then untagged pictures seem like they really shouldn't work
very well...  We are caching a legacy draw and then drawing that
into the dstColorSpace?  Maybe this isn't the most critical
thing to think about right now though, given Florin's work.

Remaining TODOs:
Color space support for gpu-backed images.
I still plan to clarify conversions that are allowed vs. not
allowed and share that code between all SkImages.

BUG=skia:6021

Change-Id: I9557ca1c00ff6854848fe59c3a67abd2af91bb46
Reviewed-on: https://skia-review.googlesource.com/6853
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-11 14:48:53 +00:00
Matt Sarett
578f52c6cf Fix iOS build
BUG=skia:

Change-Id: I914cd75c84bbe57401ab65352d4e8b3dc413dce1
Reviewed-on: https://skia-review.googlesource.com/6418
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2016-12-22 18:43:56 +00:00
Matt Sarett
909d3791f5 Improve color space support in SkImage::readPixels()
Correct handling of kGray, k565, k4444 etc. is still a TODO.
SkImage_Generator and SkImage_Gpu are still TODOs.

BUG=skia:6021

Change-Id: Ib53d97d3a866b2b4934fd85c10100855743a8fab
Reviewed-on: https://skia-review.googlesource.com/6396
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2016-12-22 17:47:08 +00:00