aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkImageInfoPriv.h
Commit message (Collapse)AuthorAge
* Improve GrGLNonlinearColorSpaceXformEffect to support scRGBGravatar Stan Iliev2017-07-25
| | | | | | | | | | | | | | Improve GrGLNonlinearColorSpaceXformEffect to correctly implement scRGB transfer function and allow for negative colors. Relax SkSurface_Gpu::Valid to allow kRGBA_half_GrPixelConfig render target without a color space needed for legacy blending on Android. Bug: b/62347704 Change-Id: Ibc6144e69c26cdbdcbf29348c4f612fb6b639e01 Reviewed-on: https://skia-review.googlesource.com/26143 Commit-Queue: Stan Iliev <stani@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Index8 is dead, remove guarded codeGravatar Mike Reed2017-07-17
| | | | | | | | | | Needs google3 to be updated before this can land. Bug: skia:6828 Change-Id: I2c16be13c6937ffa48768cc24f9f980171c824d6 Reviewed-on: https://skia-review.googlesource.com/23940 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Guard to remove kIndex_8_SkColorTypeGravatar Mike Reed2017-07-13
| | | | | | | | | Bug: skia:6828 Change-Id: Ia942a36abb18213184f8d436555a658270d97d47 Reviewed-on: https://skia-review.googlesource.com/22721 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Allow numerical color spaces with legacy renderingGravatar Matt Sarett2017-05-15
| | | | | | | | Bug: 720083 Change-Id: Ibd4dbf6ee95ac14857e8280a441f81976710e5e8 Reviewed-on: https://skia-review.googlesource.com/16700 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Support numerical transfer functions in readPixels()Gravatar Matt Sarett2017-05-02
| | | | | | | | | | | | | Let's do this because: (1) We can. (2) Android and Chrome have asked for it. (3) It will simplify the implementation of SkImage::makeColorSpace(). Bug: skia: Change-Id: Ia3c322b8a58c79ad67cdebe744e0623bd59dcffd Reviewed-on: https://skia-review.googlesource.com/15148 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Add support for row-by-row jpeg encodingGravatar Matt Sarett2017-05-02
| | | | | | | | | | | Reland of: https://skia-review.googlesource.com/c/14641/ Bug: 713862 Change-Id: I9dca5ede4ebf569c5f80edcfb23a506b6cfa935e Reviewed-on: https://skia-review.googlesource.com/15144 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Add support for row-by-row jpeg encoding"Gravatar Leon Scroggins2017-05-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9b848d5749c5e34b56f927a3a3374c8ebafbd9db. Reason for revert: ASAN reports leaked memory [1]. Google3 reports a "delete size mismatch" [2], which I suspect is the same issue. [1] https://chromium-swarm.appspot.com/task?id=35e2c9fa9eac6310&refresh=10&show_raw=1 [2] https://test.corp.google.com/ui#cl=154838904&flags=CAMQBQ==&id=OCL:154838904:BASE:154839043:1493741642370:9c96115f&t=//chrome/skia/dm_wrapper:dm_wrapper Original change's description: > Add support for row-by-row jpeg encoding > > Bug: 713862 > Change-Id: I787b7c49662a00b89ae0ef35845dfbd6be3e6fb1 > Reviewed-on: https://skia-review.googlesource.com/14641 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Leon Scroggins <scroggo@google.com> > TBR=msarett@google.com,scroggo@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ic5a8d67e0d4a7733662586055ceff086a2ab335d Reviewed-on: https://skia-review.googlesource.com/15140 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* Add support for row-by-row jpeg encodingGravatar Matt Sarett2017-05-02
| | | | | | | | Bug: 713862 Change-Id: I787b7c49662a00b89ae0ef35845dfbd6be3e6fb1 Reviewed-on: https://skia-review.googlesource.com/14641 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Make raster pipeline support all pixel conversionsGravatar Matt Sarett2017-02-14
| | | | | | | | | | | BUG=skia: CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Idc76999d0f5591a567b3976cb9db829c350e4be2 Reviewed-on: https://skia-review.googlesource.com/8304 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Make header files self-sufficientGravatar Hal Canary2017-02-10
| | | | | | | Change-Id: Ice7d761b1023da77e50e5d6aa597964f7d9aa1d8 Reviewed-on: https://skia-review.googlesource.com/8302 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Pixel conversion refactors: use raster pipeline for 565 and grayGravatar Matt Sarett2017-02-09
| | | | | | | | | | | | | | | I'm trying not to do too much in one CL. But, in general, I hope to drop (non-performance important/optimized) special cases and use the pipeline. BUG=skia: CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: I724d3982f1467f6232371360b860484f13b1ede8 Reviewed-on: https://skia-review.googlesource.com/8271 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Revert "Disallow readPixels() conversions from untagged srcs to ↵Gravatar Matt Sarett2017-02-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tagged dsts"" This reverts commit 8461506c8b025522eb89cd754c63fb5dbf0cb7f1. Reason for revert: Fixed some Chrome code, let's try this again. Original change's description: > Revert "Disallow readPixels() conversions from untagged srcs to tagged dsts" > > This reverts commit ccfd1083a7b9d546735ddd1037f3240635cce72d. > > Reason for revert: Roll is failing. > > Original change's description: > > Disallow readPixels() conversions from untagged srcs to tagged dsts > > > > This might break the roll into Chrome. But let's see how. > > > > BUG=skia:6021 > > > > Change-Id: I2698b5d6fe72d01bed0dc64703b592a03d441a80 > > Reviewed-on: https://skia-review.googlesource.com/7127 > > Reviewed-by: Mike Reed <reed@google.com> > > Commit-Queue: Matt Sarett <msarett@google.com> > > > > TBR=msarett@google.com,brianosman@google.com,reed@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia:6021 > > Change-Id: I4b62178fd7c23f43cf69ca69fc14526ecd503956 > Reviewed-on: https://skia-review.googlesource.com/7205 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,brianosman@google.com,reed@google.com # Not skipping CQ checks because original CL landed > 1 day ago. BUG=skia:6021 Change-Id: I3f3f33fe6b84fbd5c537b60ed5c8b9201d529a6a Reviewed-on: https://skia-review.googlesource.com/8156 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Revert "Allow conversion from non-opaque to opaque"Gravatar Matt Sarett2017-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bfe8dca7dfdd9cafbccba0a637f2fcd58c7a54fb. Reason for revert: I believe I've fixed all the call sites, so this is now ok. Original change's description: > Allow conversion from non-opaque to opaque > > BUG:683787 > > Change-Id: I1b78cc8d1b5d3917a2a952da036b93022e99e053 > Reviewed-on: https://skia-review.googlesource.com/7374 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,robertphillips@google.com,reviews@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I2369c9b81321ca83a7063bb85e66ddbc03914d2b Reviewed-on: https://skia-review.googlesource.com/8073 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Reenable index8 dstsGravatar Matt Sarett2017-01-24
| | | | | | | | | | | | | | | | | | | This is causing problems with image-cacherator-from-ctable gm. In that gm, we use an index8->index8 readPixels() to take a subset. I think we need to keep this as long as we support index8 in the generator/cacherator. Though it's really strange because we don't really bother to verify that color tables are the same and we don't try to overwrite the dst color table... BUG=skia: Change-Id: Icf008caa571c4b81a52a23b8b7d9226789626ef5 Reviewed-on: https://skia-review.googlesource.com/7424 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Reland "Refactor trimming logic for read/writePixels()"Gravatar Matt Sarett2017-01-23
| | | | | | | | | | | | | | | | | | | | | | | Original CL: https://skia-review.googlesource.com/c/7326/ (1) Move trimming logic into Bitmap/Pixmap level for raster. Everything goes through here, so we'll only do the work once. (2) This means it also goes to GPU level. (3) Always use SkReadPixelsRec rather than inlining the logic. (4) Create an SkWritePixelsRec to encapsulate write trimming. (5) Disabled kIndex8 as a dst - always. CQ_INCLUDE_TRYBOTS=skia.primary:Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug BUG=skia:6021 Change-Id: I25a964e3c610c4e36d195a255e2150657baec649 Reviewed-on: https://skia-review.googlesource.com/7404 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Refactor trimming logic for read/writePixels()"Gravatar Matt Sarett2017-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 977f64cbfad1ecd7fd4b1231c694c7e828fda1f0. Reason for revert: Triggering nanobench asserts Original change's description: > Refactor trimming logic for read/writePixels() > > (1) Move trimming logic into Bitmap/Pixmap level for > raster. Everything goes through here, so we'll > only do the work once. > (2) This means it also goes to GPU level. > (3) Always use SkReadPixelsRec rather than inlining > the logic. > (4) Create an SkWritePixelsRec to encapsulate write > trimming. > (5) Disabled kIndex8 as a dst - always. > > BUG=skia:6021 > > Change-Id: I748f50c3b726f7c6de5462e2b1ccb54bc387a510 > Reviewed-on: https://skia-review.googlesource.com/7326 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,brianosman@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:6021 Change-Id: If9aacc6ce8b20e3dfe8a0f22ebca653f28356175 Reviewed-on: https://skia-review.googlesource.com/7379 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Allow conversion from non-opaque to opaqueGravatar Matt Sarett2017-01-23
| | | | | | | | | BUG:683787 Change-Id: I1b78cc8d1b5d3917a2a952da036b93022e99e053 Reviewed-on: https://skia-review.googlesource.com/7374 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Refactor trimming logic for read/writePixels()Gravatar Matt Sarett2017-01-23
| | | | | | | | | | | | | | | | | | | (1) Move trimming logic into Bitmap/Pixmap level for raster. Everything goes through here, so we'll only do the work once. (2) This means it also goes to GPU level. (3) Always use SkReadPixelsRec rather than inlining the logic. (4) Create an SkWritePixelsRec to encapsulate write trimming. (5) Disabled kIndex8 as a dst - always. BUG=skia:6021 Change-Id: I748f50c3b726f7c6de5462e2b1ccb54bc387a510 Reviewed-on: https://skia-review.googlesource.com/7326 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Disallow readPixels() conversions from untagged srcs to tagged dsts"Gravatar Matt Sarett2017-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ccfd1083a7b9d546735ddd1037f3240635cce72d. Reason for revert: Roll is failing. Original change's description: > Disallow readPixels() conversions from untagged srcs to tagged dsts > > This might break the roll into Chrome. But let's see how. > > BUG=skia:6021 > > Change-Id: I2698b5d6fe72d01bed0dc64703b592a03d441a80 > Reviewed-on: https://skia-review.googlesource.com/7127 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,brianosman@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:6021 Change-Id: I4b62178fd7c23f43cf69ca69fc14526ecd503956 Reviewed-on: https://skia-review.googlesource.com/7205 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Disallow readPixels() conversions from untagged srcs to tagged dstsGravatar Matt Sarett2017-01-18
| | | | | | | | | | | This might break the roll into Chrome. But let's see how. BUG=skia:6021 Change-Id: I2698b5d6fe72d01bed0dc64703b592a03d441a80 Reviewed-on: https://skia-review.googlesource.com/7127 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Revert "SkImageInfoValidConversion (part 2)""Gravatar Matt Sarett2017-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8dadd9e8936a1c8f44fccdfde7f883dfe2d89c96. Reason for revert: Fixed Chrome. This should roll now. Original change's description: > Revert "SkImageInfoValidConversion (part 2)" > > This reverts commit 94bd50cc5575b90eb60234399d69905b8651c27e. > > Reason for revert: Still breaking roll > > Original change's description: > > SkImageInfoValidConversion (part 2) > > > > Disabling non-opaque -> opaque should be fine now that the > > Chrome unit test has been fixed. > > > > BUG=skia:6021 > > > > Change-Id: I39f087e2695bdefacf793bd137931e3115ec58cb > > Reviewed-on: https://skia-review.googlesource.com/7121 > > Reviewed-by: Brian Osman <brianosman@google.com> > > Commit-Queue: Matt Sarett <msarett@google.com> > > > > TBR=msarett@google.com,brianosman@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia:6021 > > Change-Id: I79843ea6cf60ca94822446c548f3386706924ee6 > Reviewed-on: https://skia-review.googlesource.com/7164 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,brianosman@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:6021 Change-Id: I40a85ac2e407de15916f0893d55163aea44157cb Reviewed-on: https://skia-review.googlesource.com/7181 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Revert "SkImageInfoValidConversion (part 2)"Gravatar Matt Sarett2017-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 94bd50cc5575b90eb60234399d69905b8651c27e. Reason for revert: Still breaking roll Original change's description: > SkImageInfoValidConversion (part 2) > > Disabling non-opaque -> opaque should be fine now that the > Chrome unit test has been fixed. > > BUG=skia:6021 > > Change-Id: I39f087e2695bdefacf793bd137931e3115ec58cb > Reviewed-on: https://skia-review.googlesource.com/7121 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,brianosman@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:6021 Change-Id: I79843ea6cf60ca94822446c548f3386706924ee6 Reviewed-on: https://skia-review.googlesource.com/7164 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* SkImageInfoValidConversion (part 2)Gravatar Matt Sarett2017-01-17
| | | | | | | | | | | | Disabling non-opaque -> opaque should be fine now that the Chrome unit test has been fixed. BUG=skia:6021 Change-Id: I39f087e2695bdefacf793bd137931e3115ec58cb Reviewed-on: https://skia-review.googlesource.com/7121 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Reland "Add SkImageInfoValidConversion() and SkImageInfoIsValid"Gravatar Matt Sarett2017-01-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original is at: https://skia-review.googlesource.com/c/6887/ The only change to the original is to temporarily comment out a check in SkImageInfoPriv.h until a Chrome unit test can be fixed. The idea is share these standards for the following: SkImage::readPixels() SkCanvas::readPixels() SkCanvas::writePixels() SkBitmap::readPixels() SkPixmap::readPixels() On the raster side, SkPixmap::readPixels() is the right place to check, because all raster calls go through there eventually. Then at lower levels (ex: SkPixelInfo), we can assert. There's not really a unifying location for gpu calls, so I've added this in multiple places. I haven't really dug into the gpu code to SkASSERT() on invalid cases that we will have already caught. Follow-up work: Similar refactor for SkReadPixelRec::trim(). Code cleanup in SkPixelInfo::CopyPixels() BUG=skia:6021 Change-Id: I6a16f9479bc09e3c87e10c72b0378579f1a70866 Reviewed-on: https://skia-review.googlesource.com/7104 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Add SkImageInfoValidConversion() and SkImageInfoIsValid"Gravatar Brian Osman2017-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cf5d6caff7a58f1c7ecc36d9a91ccdada5fc7b78. Reason for revert: Chrome DEPS roll failing, based on the unit tests, I suspect this is the cause. Original change's description: > Add SkImageInfoValidConversion() and SkImageInfoIsValid > > The idea is share these standards for the following: > SkImage::readPixels() > SkCanvas::readPixels() > SkCanvas::writePixels() > SkBitmap::readPixels() > SkPixmap::readPixels() > > On the raster side, SkPixmap::readPixels() is the right > place to check, because all raster calls go through > there eventually. Then at lower levels (ex: SkPixelInfo), > we can assert. > > There's not really a unifying location for gpu calls, > so I've added this in multiple places. I haven't really > dug into the gpu code to SkASSERT() on invalid cases > that we will have already caught. > > Follow-up work: > Similar refactor for SkReadPixelRec::trim(). > Code cleanup in SkPixelInfo::CopyPixels() > > BUG=skia:6021 > > Change-Id: I91ecce10e46c1a6530f0af24a9eb8226dbecaaa2 > Reviewed-on: https://skia-review.googlesource.com/6887 > Reviewed-by: Brian Osman <brianosman@google.com> > Reviewed-by: Mike Reed <reed@google.com> > TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. BUG=skia:6021 Change-Id: I63b88e90bdbb3051a14de00ac73a8351ab776d25 Reviewed-on: https://skia-review.googlesource.com/7095 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Add SkImageInfoValidConversion() and SkImageInfoIsValidGravatar Matt Sarett2017-01-13
The idea is share these standards for the following: SkImage::readPixels() SkCanvas::readPixels() SkCanvas::writePixels() SkBitmap::readPixels() SkPixmap::readPixels() On the raster side, SkPixmap::readPixels() is the right place to check, because all raster calls go through there eventually. Then at lower levels (ex: SkPixelInfo), we can assert. There's not really a unifying location for gpu calls, so I've added this in multiple places. I haven't really dug into the gpu code to SkASSERT() on invalid cases that we will have already caught. Follow-up work: Similar refactor for SkReadPixelRec::trim(). Code cleanup in SkPixelInfo::CopyPixels() BUG=skia:6021 Change-Id: I91ecce10e46c1a6530f0af24a9eb8226dbecaaa2 Reviewed-on: https://skia-review.googlesource.com/6887 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com>