History log of /external/skia/src/core/SkRasterPipeline.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c91e3877a57ef140b688627b8c0acaafbefc9034 05-Jul-2017 Mike Reed <reed@google.com> add stages for black and white colors

histogram of test skps:

black: 1/7
white: 2/7
other: 4/7

Bug: skia:
Change-Id: I3a092899d31ce87837e66e5c8ea9ec5e0f239361
Reviewed-on: https://skia-review.googlesource.com/21408
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
/external/skia/src/core/SkRasterPipeline.cpp
7aad8cc2ff7a580bd5852d57289ace8c8dced6f5 05-Jul-2017 Mike Reed <reed@google.com> optimize for diff matrix types

Bug: skia:
Change-Id: I671e07c5bbb9e4ced92303c9959143324f7a6bdc
Reviewed-on: https://skia-review.googlesource.com/21523
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
/external/skia/src/core/SkRasterPipeline.cpp
6b59bf424c9d9d8a72d3c002871f143e6aff623e 04-Jul-2017 Mike Reed <reed@google.com> consolidate logic for matrix stage

Bug: skia:
Change-Id: Id1559b31692a1aed9aa4d15620b2019ae9c7c22b
Reviewed-on: https://skia-review.googlesource.com/21404
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
279091ef85eec98969b72805bbf613f1c0660380 27-Jun-2017 Mike Reed <reed@google.com> specialize loaders for dst registers, to avoid move/swap stages

Bug: skia:
Change-Id: I75d82ef2226c5f116b7de2208c4e914739414b6d
Reviewed-on: https://skia-review.googlesource.com/20984
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
9fff11133d1890a2733e8a61ba976492fe800c99 24-May-2017 Mike Klein <mtklein@chromium.org> better extend: alloc once, no recursion

Change-Id: I6a8cee08248462e4e17196028758dd8d44093b28
Reviewed-on: https://skia-review.googlesource.com/17831
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
b24704d35f67f5b460be9c92794892e06adceb46 24-May-2017 Mike Klein <mtklein@chromium.org> SkRasterPipeline in SkArenaAlloc

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>
/external/skia/src/core/SkRasterPipeline.cpp
1859f69d20e433b86714e5b9002121f2b20a5fc6 22-May-2017 Mike Klein <mtklein@chromium.org> some basic speed ups for SkRasterPipeline::append()

The new bench demos the speedup:
SkRasterPipelineReuse_…
…full 1x …some 1.8x …none 5.22x

Change-Id: I5e51fb4316ae04558710ce62560850584ccb4aea
Reviewed-on: https://skia-review.googlesource.com/17449
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
1be0db86aae4f69df4b71cc387eeda70d72afd56 21-Apr-2017 Mike Klein <mtklein@chromium.org> long live SkJumper

Change-Id: I5de3c8daae80e437b3553ab6afcee7120a1bb775
Reviewed-on: https://skia-review.googlesource.com/14038
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
0a64e32f3968d6f5bb514441fd1218e61ee6ba42 29-Mar-2017 Mike Klein <mtklein@chromium.org> Turn on SkJumper all the time, try 2.

Rebased on top of _win.S change, which I hope lands first.

CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel,win_chrome_official,win_chromium_dbg_ng,win_chromium_rel_ng,win_chromium_compile_dbg_ng,win_chromium_compile_rel_ng,win_clang;master.tryserver.chromium.android:android_optional_gpu_tests_rel

Change-Id: I30e97dbb55b8a42251b46f5607096ca12bc670b9
Reviewed-on: https://skia-review.googlesource.com/10462
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
/external/skia/src/core/SkRasterPipeline.cpp
2fcd17087e4e299a734f4f41fe94cd039adc2b64 08-Mar-2017 Mike Klein <mtklein@chromium.org> Revert "Turn on SkJumper all the time."

This reverts commit 135555101cbde68656f028c41506113374a4026f.

Reason for revert: forgot g3, seems to break Chrome NaCl builders?

https://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20Win/builds/15969/steps/compile/logs/stdio

Original change's description:
> Turn on SkJumper all the time.
>
> If the previous CL sticks, it's now easy to turn on SkJumper everywhere:
> I was mostly holding back because of build system complexity.
>
> This has the main effect of turning on SkJumper in Chromium.
> It's already been on on our local test bots and on Android framework.
>
> Change-Id: I7fbfc6aaaa7dace9c3f2cb509583c69b10997dbf
> Reviewed-on: https://skia-review.googlesource.com/9380
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
>

TBR=mtklein@chromium.org,herb@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I69747e9e75b2a8e3d78f6c150c9b6d6453e00632
Reviewed-on: https://skia-review.googlesource.com/9444
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
135555101cbde68656f028c41506113374a4026f 07-Mar-2017 Mike Klein <mtklein@chromium.org> Turn on SkJumper all the time.

If the previous CL sticks, it's now easy to turn on SkJumper everywhere:
I was mostly holding back because of build system complexity.

This has the main effect of turning on SkJumper in Chromium.
It's already been on on our local test bots and on Android framework.

Change-Id: I7fbfc6aaaa7dace9c3f2cb509583c69b10997dbf
Reviewed-on: https://skia-review.googlesource.com/9380
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
8729e5bbf7c436fd7c7c13182adbbfb419f566b5 16-Feb-2017 Mike Klein <mtklein@chromium.org> Simplify more: remove SkRasterPipeline::compile().

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>
/external/skia/src/core/SkRasterPipeline.cpp
e1caee1ad884def91b8afb50e5672f1f0ee278f1 15-Feb-2017 Mike Klein <mtklein@chromium.org> SkJumper

Change-Id: If9f73e712e429564fef58ccb838c212ec8d2e68c
Reviewed-on: https://skia-review.googlesource.com/8525
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
/external/skia/src/core/SkRasterPipeline.cpp
f6a1a2179ad6bf37dd81a658b30d12bfbdfa5c3f 15-Feb-2017 Mike Klein <mtklein@chromium.org> Clean up SkSplicer.

SkJumper's looking promising enough that I want this further out of my face.

Change-Id: I6dbe71aeabe32f7f4258ba157460e6985733b0ce
Reviewed-on: https://skia-review.googlesource.com/8528
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
319ba3d3a177498095c31696e0aec8b3af25f663 20-Jan-2017 Mike Klein <mtklein@chromium.org> Move shader register setup to SkRasterPipelineBlitter.

We've been seeding the initial values of our registers to x+0.5,y+0.5,
1,0, 0,0,0,0 (useful values for shaders to start with) in all pipelines.
This CL changes that to do so only when blitting, and only when we have
a shader.

The nicest part of this change is that SkRasterPipeline itself no longer
needs to have a concept of y, or what x means. It just marches x
through [x,x+n), and the blitter handles y and layers the meaning of
"dst x coordinate" onto x.

This ought to make SkSplicer a little easier to work with too.

dm --src gm --config f16 srgb 565 all draws the same.

Change-Id: I69d8c1cc14a06e5dfdd6a7493364f43a18f8dec5
Reviewed-on: https://skia-review.googlesource.com/7353
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
a7080264d11235d6f469d355b14a7647cba8eb75 09-Jan-2017 Mike Klein <mtklein@chromium.org> SkSplicer

I think I may have cracked the compile-ahead-of-time-splice-at-runtime nut.

This compiles stages ahead of time using clang, then splices them together at runtime. This means the stages can be written in simple C++, with some mild restrictions.

This performs identically to our Xbyak experiment, and already supports more stages. As written this stands alone from SkRasterPipeline_opts.h, but I'm fairly confident that the bulk (the STAGE implementations) can ultimately be shared.

As of PS 25 or so, this also supports all the stages used by bench/SkRasterPipelineBench.cpp:

SkRasterPipeline_…
400 …f16_compile 1x …f16_run 1.38x …srgb_compile 1.89x …srgb_run 2.21x

That is, ~30% faster than baseline for f16, ~15% faster for sRGB.

Change-Id: I1ec7dcb769613713ce56978c58038f606f87d63d
Reviewed-on: https://skia-review.googlesource.com/6733
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
83f532e9b5b81ec60e02f0cd2a04f2ccafaa2bb4 06-Jan-2017 Mike Klein <mtklein@chromium.org> Add a real SkXbyak bench, implement enough to run it.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

SkXbyak_…
9320 …JITCompiled 1x …Interpreted 1.24x …HandWritten 2.5x

Change-Id: I37d2d255ff32dcce73d29081d506e2d67477af97
Reviewed-on: https://skia-review.googlesource.com/6697
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
/external/skia/src/core/SkRasterPipeline.cpp
7f71d8845c3c57c6e4b33c3666cca46b55e91d02 06-Jan-2017 Mike Klein <mtklein@chromium.org> SkXbyak basics

A little JIT proof of concept for SkRasterPipeline, using xbyak, which is a header-only assembler. It's x86-only, but supports x86 very thoroughly, and it's very user friendly (at least as far as assembler libraries go...).

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Ie17e562b0f3fff5914041badfb2c1fe4f86efab8
Reviewed-on: https://skia-review.googlesource.com/5730
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
8c8cb5bfc547229422a33db5c344fe1542bf00a7 06-Jan-2017 Mike Klein <mtklein@chromium.org> simplify by removing _d stages

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I75e232faee6ad48f65bac5b119a461280b27bbc8
Reviewed-on: https://skia-review.googlesource.com/6661
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
d37d5d96493604c12cfaa2d64bcbd32c41b01f3b 14-Dec-2016 Mike Klein <mtklein@chromium.org> Revert "Revert "clamp to premul when reading premul sRGB""

This reverts commit 2e018f548d76b0688f9873c683cffc681fec40ec.

Reason for revert: doesn't appear to have been the roll problem.

Original change's description:
> Revert "clamp to premul when reading premul sRGB"
>
> This reverts commit 04e10da8362a0dcabd795a4ad53f617719ca0d20.
>
> Reason for revert: roll?
>
> Change-Id: Id0a8dcd62763bd6eddde120c513ca97e098a4268
> Reviewed-on: https://skia-review.googlesource.com/6022
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
>

TBR=mtklein@chromium.org,reviews@skia.org,brianosman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I399ca5e728ce6766c6707682c4c6b685681ffdeb
Reviewed-on: https://skia-review.googlesource.com/6025
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
2e018f548d76b0688f9873c683cffc681fec40ec 14-Dec-2016 Mike Klein <mtklein@chromium.org> Revert "clamp to premul when reading premul sRGB"

This reverts commit 04e10da8362a0dcabd795a4ad53f617719ca0d20.

Reason for revert: roll?

Change-Id: Id0a8dcd62763bd6eddde120c513ca97e098a4268
Reviewed-on: https://skia-review.googlesource.com/6022
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
04e10da8362a0dcabd795a4ad53f617719ca0d20 13-Dec-2016 Mike Klein <mtklein@chromium.org> clamp to premul when reading premul sRGB

It's pretty easy to start with sound premultiplied linear floats, pack those to sRGB encoded bytes, then read them back to linear floats and find them not quite premultiplied, with a color channel just a smidge greater than the alpha channel. This can happen basically any time we have different transfer functions for alpha and colors... sRGB being the only one we draw into.

This is an annoying problem with no known good solution. So apply the clamp hammer.

These new calls on SkRasterPipeline should make it impossible to get wrong.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I4c974f4a7b151f3f684946f1e83d06b1b288fd01
Reviewed-on: https://skia-review.googlesource.com/5945
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
ebe79ffd8627e3fea945a82895e64cede4ec21bf 06-Dec-2016 Mike Klein <mtklein@chromium.org> fStages.data() should always be defined, but UBSAN says NO

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD


Change-Id: I6aef3ec2bcb85d6ad4830c759a1234ef2e31f32d
Reviewed-on: https://skia-review.googlesource.com/5552
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
cc63173634e773eac5de0b92f05d117ed2bdca84 06-Dec-2016 Mike Klein <mtklein@chromium.org> remove upper limit on number of pipeline stages

Bicubic is going to blow right past 48. At this point the fixed preallocation strategy is starting to look naive... at 64 we'd allocate just over 1K for every pipeline (and every compiled pipeline).

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Ib2944ead1217123aba2b6347fd9d5315217540c9
Reviewed-on: https://skia-review.googlesource.com/5551
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
bf49d61fce3dc3829626762e1ffa3c4a70b7db32 30-Nov-2016 Mike Klein <mtklein@chromium.org> Revert "Show constant-foldable runs in SkRasterPipeline::dump()."

This reverts commit 9ac7b2c545769a6b7c863b8e4c7f88096c9a9969.

Reason for revert: misguided.

Original change's description:
> Show constant-foldable runs in SkRasterPipeline::dump().
>
> Change-Id: I2f85249a09163dd21a8008f50340b8463718ada2
> Reviewed-on: https://skia-review.googlesource.com/5350
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
>

TBR=mtklein@chromium.org,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I3ae6c8ec11853592b332a17aefd611dc238e6c26
Reviewed-on: https://skia-review.googlesource.com/5394
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
c789b61167dd98efc3c3bfcf9673eef24c2e57f4 30-Nov-2016 Mike Klein <mtklein@chromium.org> Bring back SkRasterPipeline::run() for one-off uses.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I308b6d75f2987a667eead9a55760a2ff6aec2984
Reviewed-on: https://skia-review.googlesource.com/5353
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
9ac7b2c545769a6b7c863b8e4c7f88096c9a9969 30-Nov-2016 Mike Klein <mtklein@chromium.org> Show constant-foldable runs in SkRasterPipeline::dump().

Change-Id: I2f85249a09163dd21a8008f50340b8463718ada2
Reviewed-on: https://skia-review.googlesource.com/5350
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
e03339a35435b6c4b9ddb5b9d1d3592be5185de2 28-Nov-2016 Mike Klein <mtklein@chromium.org> Convert blitter over to new style from_srgb, to_srgb.

Every sRGB GM changes, none noticeably.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I632845aea0f40751639cccbcfde8fa270cae0301
Reviewed-on: https://skia-review.googlesource.com/5275
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
3928c6b6165cf2d13d3b5f50762d7f621706a946 15-Nov-2016 Mike Klein <mtklein@chromium.org> Add SkRasterPipeline::dump().

Entirely for debugging.

TBR=herb@google.com

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

Change-Id: I6d6972c40b11854441f566c12516a2ec8c75c78f
Reviewed-on: https://skia-review.googlesource.com/4871
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
af49b19582f1f7a55e1300647804212252315b8a 15-Nov-2016 Mike Klein <mtklein@chromium.org> Start each pipeline with (x,y) in (dr,dg) registers for the shader.

Image shaders need to do some geometry work before sampling the image colors:
1) determine dst coordinates
2) map back to src coordinates
3) tiling

Feeding (x,y) through as (dr,dg) registers makes step 1) easy, perhaps trivial, while leaving (r,g,b,a) with their usual meanings, "the color", starting with the paint color.

This is easy to tweak into something like (x+0.5, y+0.5, 1) in (dr,dg,db) once this lands. Mostly I just want to get all the uninteresting boilerplate out of the way first.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4791
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: Ia07815d942ded6672dc1df785caf80a508fc8f37
Reviewed-on: https://skia-review.googlesource.com/4791
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
e9f74b89c09772dd5abae1c0709c711d7cdb6535 25-Oct-2016 Mike Klein <mtklein@chromium.org> SkRasterPipeline::compile().

I'm not yet caching these in the blitter, and speed is essentially unchanged in the bench where I am now building and compiling the pipeline only once. This may not be able to stay a simple std::function after I figure out caching, but for now it's a nice fit.

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

Change-Id: I9545af589f73baf9f17cb4e6ace9a814c2478fe9
Reviewed-on: https://skia-review.googlesource.com/3911
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
aebfb45104eeb6dab5dbbedda13c2eaa7b7f7868 25-Oct-2016 Mike Klein <mtklein@chromium.org> Move SkRasterPipeline further into SkOpts.

The portable code now becomes entirely focused on enum+ptr descriptions, leaving the concrete implementation of the pipeline to SkOpts::run_pipeline().

As implemented, the concrete implementation is basically the same, with a little more type safety.

Speed is essentially unchanged on my laptop, and that's having run_pipeline() rebuild its concrete state every call. There's room for improvement there if we split this into a compile_pipeline() / run_pipeline() sort of thing, which is my next planned CL.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3920
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: Ie4c554f51040426de7c5c144afa5d9d9d8938012
Reviewed-on: https://skia-review.googlesource.com/3920
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
04adfda9c74481d0b640c0ce18864588babfcdf6 12-Oct-2016 Mike Klein <mtklein@chromium.org> SkRasterPipeline: 8x pipelines, without any 8x code enabled.

Original review here: https://skia-review.googlesource.com/c/2990/
Second attempt here: https://skia-review.googlesource.com/c/3064/

This is the same as the second attempt, but with the change to SkOpts_hsw.cpp left out.
That omitted part is the key piece... this just lands the refactoring.

CQ_INCLUDE_TRYBOTS=master.client.skia:Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot,Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-GN,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Fast-Trybot;master.client.skia.compile:Build-Win-MSVC-x86_64-Debug-Trybot

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

Change-Id: Iaafa793a4854c2c9cd7e85cca3701bf871253f71
Reviewed-on: https://skia-review.googlesource.com/3242
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
42f4b42e8311f168aeeadd939b476c05b329500e 10-Oct-2016 Mike Klein <mtklein@chromium.org> Revert "SkRasterPipeline: 8x pipelines, attempt 2"

This reverts commit Id0ba250037e271a9475fe2f0989d64f0aa909bae.

crbug.com/654213
Looks like Chrome Canary's picking up Haswell code on non-Haswell machines.

Change-Id: I16f976da24db86d5c99636c472ffad56db213a2a
Reviewed-on: https://skia-review.googlesource.com/3108
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
a71e151c6f0be68dc96ad2d169bbc31edca8f946 07-Oct-2016 Mike Klein <mtklein@chromium.org> SkRasterPipeline: 8x pipelines, attempt 2

Original review here: https://skia-review.googlesource.com/c/2990/

Changes since:
- simpler implementations of load_tail() / store_tail(): slower, but more obviously correct to all compilers
- fleshed out math ops on Sk8i and Sk8u to make unit tests happy on -Fast bot (where we always have AVX2)
- now storing stage functions as void(*)() to avoid undefined behavior and/or linker problems. This restores 32-bit Windows.
- all AVX2 Sk8x methods are marked always-inline, to avoid linking the "wrong" version on Debug builds.

CQ_INCLUDE_TRYBOTS=master.client.skia:Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot,Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-GN,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Fast-Trybot;master.client.skia.compile:Build-Win-MSVC-x86_64-Debug-Trybot

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

Change-Id: Id0ba250037e271a9475fe2f0989d64f0aa909bae
Reviewed-on: https://skia-review.googlesource.com/3064
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
942858774831fea6e3f5f9d6c39b9538cf031bfd 07-Oct-2016 Mike Klein <mtklein@chromium.org> Revert "SkRasterPipeline: 8x pipelines"

This reverts commit I1c82e5755d8e44cc0b9c6673d04b117f85d71a3a.

Reason for revert: lots of failing bots.

TBR=mtklein@chromium.org,msarett@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I653bed3905187f43196504f19424985fa2a765b5
Reviewed-on: https://skia-review.googlesource.com/3063
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
1aebdaee0e2aa4324509fd3ad4c40c21703ae4a2 06-Oct-2016 Mike Klein <mtklein@chromium.org> SkRasterPipeline: 8x pipelines

Bench runtime changes:
sRGB: 7194 -> 3735 = 1.93x faster
F16: 6531 -> 2559 = 2.55x faster

Instead of building 4x and 1-3x pipelines and then maybe 8x and 1-7x, instead build either the short ones or the long ones, but not both. If we just take care to use a compatible run_pipeline(), there's some cross-module type disagreement but everything works out in the end.

Oddly, a few places that looked like they'd be faster using SkNx_fma() or Sk4f_round()/Sk8f_round() are actually faster the long way, e.g. multiply, add 0.5, truncate. Curious! In all the other places you see here that I've used SkNx_fma(), it's been a significant speedup.

This folds in a couple refactors and cleanups that I've been meaning to do. Hope you don't mind... if find the new code considerably easier to read than the old code.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2990
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I1c82e5755d8e44cc0b9c6673d04b117f85d71a3a
Reviewed-on: https://skia-review.googlesource.com/2990
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
26bea5d55735367152378bae14453e9666d1c625 05-Oct-2016 Mike Klein <mtklein@chromium.org> Make test lower-level, make const_cast more visible.

I can only think there's something funky going on with the hidden
const_cast inside SkRasterPipeline.cpp, or with the Sk4h -> Sk4f
conversion. So make the const_cast visible and write the test
directly in halfs instead of floats.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release-GN-Trybot

BUG=skia:

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

Change-Id: I3a7e19ae165fce44f177b4968a63ec04e25c4b93
Reviewed-on: https://skia-review.googlesource.com/3003
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
fa9f241a85c55c32a3fe2ae0324811de998f7a2e 29-Sep-2016 Mike Klein <mtklein@chromium.org> Add an enum layer of indirection for stock raster pipeline stages.

This is handy now, and becomes necessary with fancier backends:
- most code can't speak the type of AVX pipeline stages,
so indirection's definitely needed there;
- if the pipleine is entirely composed of stock stages,
these enum values become an abstract recipe that can be JITted.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2782
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: Iedd62e99ce39e94cf3e6ffc78c428f0ccc182342
Reviewed-on: https://skia-review.googlesource.com/2782
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
c8dd6bc3e7a4b01c848ba15b808ea6ffdf249b06 28-Sep-2016 Mike Klein <mtklein@chromium.org> Rearrange SkRasterPipeline scanline tail handling.

We used to step at a 4-pixel stride as long as possible, then run up to 3 times, one pixel at a time. Now replace those 1-at-a-time runs with a single tail stamp if there are 1-3 remaining pixels.

This style is simply more efficient: e.g. we'll blend and lerp once for 3 pixels instead of 3 times. This should make short blits significantly more efficient. It's also more future-oriented... AVX+ on Intel and SVE on ARM support masked loads and stores, so we can do the entire tail in one direct step.

This also makes it possible to re-arrange the code a bit to encapsulate each stage better. I think generally this code reads more clearly than the old code, but YMMV. I've arranged things so you write one function, but it's compiled into two specializations, one for tail=0 (Body) and one for tail>0 (Tail). It's pretty tidy.

For now I've just burned a register to pass around tail. It's 2 bits now, maybe soon 3 with AVX, and capped at 4 for even the craziest new toys, so there are plenty of places we can pack it if we want to get clever.

BUG=skia:

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

Change-Id: I45852a3e5d4c5b5e9315302c46601aee0d32265f
Reviewed-on: https://skia-review.googlesource.com/2717
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
/external/skia/src/core/SkRasterPipeline.cpp
9a5c47f4effba3b48a9a8c7c144b72b532d06efe 22-Jul-2016 mtklein <mtklein@chromium.org> Add SkRasterPipeline blitter.

This is now pixel-exact with the existing sRGB SW impl as far as I've tested.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146413002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot

Committed: https://skia.googlesource.com/skia/+/3011e337693a9786f62d8de9ac4b239ad6dbdaca
Review-Url: https://codereview.chromium.org/2146413002
/external/skia/src/core/SkRasterPipeline.cpp
aa29b2732914ad65334540babc945ae8c93f9036 22-Jul-2016 mtklein <mtklein@google.com> Revert of Add SkRasterPipeline blitter. (patchset #18 id:340001 of https://codereview.chromium.org/2146413002/ )

Reason for revert:
Leaking the blitter

https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/7908/steps/test_skia%20on%20Ubuntu/logs/stdio

Original issue's description:
> Add SkRasterPipeline blitter.
>
> This is now pixel-exact with the existing sRGB SW impl as far as I've tested.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146413002
> CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/3011e337693a9786f62d8de9ac4b239ad6dbdaca

TBR=reed@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2178523002
/external/skia/src/core/SkRasterPipeline.cpp
3011e337693a9786f62d8de9ac4b239ad6dbdaca 22-Jul-2016 mtklein <mtklein@chromium.org> Add SkRasterPipeline blitter.

This is now pixel-exact with the existing sRGB SW impl as far as I've tested.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146413002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2146413002
/external/skia/src/core/SkRasterPipeline.cpp
0abddf7bb7f77b1ff6a48efc9d1eafd053d975d2 13-Jul-2016 mtklein <mtklein@chromium.org> SkRasterPipeline: simplify impl and remove need to rewire stages

This builds the stages correctly wired from the get-go. With a little clever
setup, we can also design around the previous error cases like having no stages
or pipelines that call st->next() off the end.

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

Review-Url: https://codereview.chromium.org/2149443002
/external/skia/src/core/SkRasterPipeline.cpp
281b33fdd909ee3f43192cdf950ce00e3df62407 13-Jul-2016 mtklein <mtklein@chromium.org> SkRasterPipeline preliminaries

Re-uploading to see if I can get a CL number < 2^31.
patch from issue 2147533002 at patchset 240001 (http://crrev.com/2147533002#ps240001)

Already reviewed at the other crrev link.
TBR=

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2147533002
CQ_INCLUDE_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2144573004
/external/skia/src/core/SkRasterPipeline.cpp