aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkConvertPixels.cpp
Commit message (Collapse)AuthorAge
* remove append_from_srgb()Gravatar Mike Klein2017-12-18
| | | | | | | | | | | It's now no different than append(from_srgb). Bug: skia:7419 Change-Id: I97c59b6987f033ec2f1859db40ca3056b87b370a Reviewed-on: https://skia-review.googlesource.com/86741 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* add gamma stageGravatar Mike Klein2017-08-09
| | | | | | | | | | | | | | | | Until now we've been using 3 separate parametric stages to apply gamma to r,g,b. That works fine, but is kind of unnecessarily slow, and again less clear in a stack trace than seeing "gamma". The new bench runs in about 60% of the time the old one does on my Trashcan. BUG=skia:6939 Change-Id: I079698d3009b081f1c23a2e27fc26e373b439610 Reviewed-on: https://skia-review.googlesource.com/32721 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "remove another SkConvertPixels "fast path""Gravatar Mike Klein2017-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 706a076879359207b1da292e5ee7750083e50152. Reason for revert: this looks less a "fast path" and more "completely essential path" according to Chrome roll tests and some layout tests (most are small diffs, but some are radical). Original change's description: > remove another SkConvertPixels "fast path" > > SkColorSpaceXform now uses the same mechanism as our default path, > SkRasterPipeline. There's no real reason to jump out to it as a > special case any more. > > Change-Id: I19490de5b331267209cf117534942fb175c624c9 > Reviewed-on: https://skia-review.googlesource.com/29900 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,brianosman@google.com Change-Id: I92b17fe0d44e609d8c06e8fa2933f1f572a98094 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/30160 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove another SkConvertPixels "fast path"Gravatar Mike Klein2017-08-02
| | | | | | | | | | | SkColorSpaceXform now uses the same mechanism as our default path, SkRasterPipeline. There's no real reason to jump out to it as a special case any more. Change-Id: I19490de5b331267209cf117534942fb175c624c9 Reviewed-on: https://skia-review.googlesource.com/29900 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Remove unused code for index 8Gravatar Brian Osman2017-08-01
| | | | | | | | Bug: skia: Change-Id: I0d421874e7ab71a39e2708575314f5b3615882e4 Reviewed-on: https://skia-review.googlesource.com/29221 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Fix premul state in from_srgb in convert_with_pipelineGravatar Christopher Cameron2017-07-31
| | | | | | | | | | | | | | Without this patch, the pipeline 1. converts to unpremultiplied 2. applies the sRGB transfer assuming the pixel is premultiplied In step 2, we should assume the pixel is unpremultiplied. Bug:738517 Change-Id: Ic11fcf64faa423577ccb1cfc0cfe96feb57db09a Reviewed-on: https://skia-review.googlesource.com/28404 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* convert over to 2d-modeGravatar Mike Klein2017-07-20
| | | | | | | | | | | | [√] convert all stages to use SkJumper_MemoryCtx / be 2d-compatible [√] convert compile to 2d also, remove 1d run/compile [√] convert all call sites [√] no diffs Change-Id: I3b806eb8fe0c3ec043359616409f7cd1211a1e43 Reviewed-on: https://skia-review.googlesource.com/24263 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* 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>
* clean up low-hanging swap_rbGravatar Mike Klein2017-06-28
| | | | | | | | | | | | | | | There are two remaining swap_rb uses that both look non-trivial to replace: - sampling out of index8 when the color table is bgra - table transforms on bgra inputs in SkColorSpaceXform I don't think it's a big deal to just leave swap_rb around, just a little sad. Change-Id: I3d30200cf867cbf37d6f86572b1574d3e22e3490 Reviewed-on: https://skia-review.googlesource.com/21040 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* plumb y through to SkJumperGravatar Mike Klein2017-06-01
| | | | | | | | | | | | | | | There'll still be a little more refactoring after this, but this is the main thing we want to do. This makes y available in a general-purpose register in pipeline stages, just like x. Stages that need y (seed_shader and dither) can just use it rather than pulling it off a context pointer. seed_shader loses its context pointer, and dither's gets simpler. Change-Id: Ic2d1e13b03fb45b73e308b38aafbb3a14c29cf7f Reviewed-on: https://skia-review.googlesource.com/18383 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* update SkRasterPipeline::run() to also take yGravatar Mike Klein2017-06-01
| | | | | | | | | y isn't used yet. This is just a warmup that updates the callers. Change-Id: I78f4f44e2b82f72b3a39fa8a8bdadef1d1b8a99e Reviewed-on: https://skia-review.googlesource.com/18381 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* call compile in convert_with_pipeline()Gravatar Mike Klein2017-05-31
| | | | | | | | | | We used to do this a while ago, then I removed compile(). This puts things back how they used to be. Change-Id: I676ec1a06249f2356f426fd2847af093526f54d2 Reviewed-on: https://skia-review.googlesource.com/18079 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* bug fix in convert_with_pipeline()Gravatar Mike Klein2017-05-30
| | | | | | | | | | | | What do you supppose happens if we put an SkColorSpaceTransferFn on the stack, pass its address to SkRasterPipeline, then pop it off the stack? BUG=skia:6671 Change-Id: I17c777d9dc55a67cca6196a01c076a6be8283d3d Reviewed-on: https://skia-review.googlesource.com/18078 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* SkRasterPipeline in SkArenaAllocGravatar Mike Klein2017-05-24
| | | | | | | | | Bug: skia:6673 Change-Id: Ia2bae4f6a9039a007a10b6b45bcf2f0854bf6e5c Reviewed-on: https://skia-review.googlesource.com/17794 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Dither copies when decreasing precision below 32-bit.Gravatar Mike Klein2017-05-23
| | | | | | | | | | | | | | | | Same GM diffs as the last attempt in 8888. CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android,Test-Win2k8-MSVC-GCE-CPU-AVX2-x86-Release,Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-Android BUG=chromium:720105 Still looking at why readpixels and readpixelspicture are so weird (lots of black) when drawing into sRGB 8888. Will follow up. Change-Id: I223e3b74e567aea1acaffa8db6b24fbf22d98c97 Reviewed-on: https://skia-review.googlesource.com/17443 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Revert "dither copies when decreasing precision"Gravatar Mike Klein2017-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 766f9cd5553ab091b85d287a79f47cbb91ad7989. Reason for revert: unit test failures, I think on bots running portable code path Original change's description: > dither copies when decreasing precision > > Still seeing the same 4444 diffs on copyTo4444 and all_bitmap_configs, > and now also 565 in all_bitmap_configs. > > BUG=chromium:720105 > > Change-Id: I19406f57aa6d2b2f98d98c093da302b004c7cd8b > Reviewed-on: https://skia-review.googlesource.com/17419 > Commit-Queue: Mike Klein <mtklein@chromium.org> > Reviewed-by: Matt Sarett <msarett@google.com> > TBR=mtklein@chromium.org,msarett@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:720105 Change-Id: Ia9ece7dccef325233b870102ab38fbed2336b95d Reviewed-on: https://skia-review.googlesource.com/17442 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* dither copies when decreasing precisionGravatar Mike Klein2017-05-20
| | | | | | | | | | | | Still seeing the same 4444 diffs on copyTo4444 and all_bitmap_configs, and now also 565 in all_bitmap_configs. BUG=chromium:720105 Change-Id: I19406f57aa6d2b2f98d98c093da302b004c7cd8b Reviewed-on: https://skia-review.googlesource.com/17419 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Matt Sarett <msarett@google.com>
* Pass alphaType to append_gamut_transform() to inform the clampGravatar Matt Sarett2017-05-12
| | | | | | | | | BUG=skia: Change-Id: I1a8aef36043d4091bffae95b0275fa7fa8a35c97 Reviewed-on: https://skia-review.googlesource.com/9441 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* make append_gamut_tranform() never failGravatar Mike Klein2017-05-09
| | | | | | | | | | | | | | The only way it could ostensibly fail is if we get non-XYZ color spaces, which should just not happen. Assert that doesn't happen and safely do nothing instead of failing. This is one of the leaf nodes to getting SkCreateRasterPipelineBlitter to never fail. Next come SkColorFilter:: and SkShader::appendStages(). Change-Id: I5c7a8c63d0a9837e2e55208e1674796d86f45307 Reviewed-on: https://skia-review.googlesource.com/16002 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: 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>
* Use SkTransferFunctionBehavior for raster pixel conversionsGravatar Matt Sarett2017-03-28
| | | | | | | | | | | Fixes some gbr-8888 behaviors. BUG=skia: Change-Id: I1351b043129f7ed0e125bfdb626a0ecaf64c15cc Reviewed-on: https://skia-review.googlesource.com/10169 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* SkConvertPixels: Add Alpha8 fast pathGravatar Matt Sarett2017-02-22
| | | | | | | | | BUG:692936 Change-Id: I8394554764b1f46bd8eaabb0194d52f361d477c1 Reviewed-on: https://skia-review.googlesource.com/8826 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Simplify more: remove SkRasterPipeline::compile().Gravatar Mike Klein2017-02-16
| | | | | | | | | | | | It's easier to work on SkJumper if everything funnels through run(). I don't anticipate huge benefit from compile() without JITing, but it's something we can always put back if we find a need. Change-Id: Id5256fd21495e8195cad1924dbad81856416d913 Reviewed-on: https://skia-review.googlesource.com/8468 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Rename SkConfig8888/SkPixelInfo to SkConvertPixelsGravatar Matt Sarett2017-02-15
BUG=skia: Change-Id: I4f3c6370b3ef4247aa446716c7c154899925d089 Reviewed-on: https://skia-review.googlesource.com/8442 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>