refactor lighting imagefilter to save codesize

Goal was to just remove template args and add virtuals where needed.
Ended up having to also move a couple of classes/helpers earlier in the file, but nothing beyond that.

Size savings (on Mac laptop) : 67896

Before:
   8/8   MB	1	30.6ms	30.7ms	30.7ms	30.9ms	0%	█▁▅▁▄▃▄▁▃▃	8888	lightingspotlitspecular_large
   8/8   MB	1	34.2ms	37.6ms	38.5ms	45.9ms	9%	▂▂▃▅▁▅█▂▅▂	8888	lightingspotlitspecular_small
   8/8   MB	1	31.3ms	35ms	34.6ms	38.4ms	7%	▁▄▅▆▆▁▇▃▂█	8888	lightingdistantlitspecular_large
   8/8   MB	1	29.9ms	33.5ms	34.3ms	39.2ms	8%	▁▅█▃▄▇▄▂▄▆	8888	lightingdistantlitspecular_small
   8/8   MB	1	30.4ms	34.1ms	34.5ms	40.7ms	11%	▂▄█▃▁▅▂▅▁▇	8888	lightingpointlitspecular_large
   8/8   MB	1	29.8ms	36.2ms	34.8ms	41.4ms	12%	▂▃▅▁▅▇▂▁▆█	8888	lightingpointlitspecular_small
   8/8   MB	1	16.3ms	19.5ms	20.5ms	26.6ms	17%	▁▆▃▃█▃▂▅▁▆	8888	lightingspotlitdiffuse_large
   8/8   MB	1	17.3ms	19.3ms	19.4ms	23.3ms	10%	▄▁▂▁▆▅▁▃▂█	8888	lightingspotlitdiffuse_small
   8/8   MB	1	12.7ms	14.9ms	17ms	27.9ms	30%	▂▁█▁▂▄▂▂▂▆	8888	lightingdistantlitdiffuse_large
   8/8   MB	1	12.4ms	14.5ms	15.8ms	24.7ms	23%	▁▂▅▂▁▃█▂▃▂	8888	lightingdistantlitdiffuse_small
   8/8   MB	1	13.6ms	14.9ms	16.6ms	22.5ms	22%	▁█▅▁▆▂▁▂▁█	8888	lightingpointlitdiffuse_large
   8/8   MB	1	13.8ms	17ms	16.5ms	19.2ms	11%	▆▆▁▁▆▅▅█▃▂	8888	lightingpointlitdiffuse_small

After:
   8/8   MB	1	23.5ms	23.6ms	23.8ms	25.1ms	2%	▃▁█▁▁▂▁▂▁▁	8888	lightingspotlitspecular_large
   8/8   MB	1	23.5ms	23.6ms	23.9ms	24.9ms	2%	█▅▂▁▁▁▁▁▆▃	8888	lightingspotlitspecular_small
   8/8   MB	1	21.6ms	21.8ms	21.9ms	22.3ms	1%	█▆▃▁▄▄▃▂▄▂	8888	lightingdistantlitspecular_large
   8/8   MB	1	21.6ms	21.7ms	21.9ms	22.7ms	2%	█▅▂▂▂▁▂▂▂▃	8888	lightingdistantlitspecular_small
   8/8   MB	1	22.3ms	22.9ms	22.8ms	23.2ms	1%	▇▆▁▄▆▄▃█▄▆	8888	lightingpointlitspecular_large
   8/8   MB	1	22.1ms	22.2ms	22.5ms	23.6ms	3%	██▁▁▂▂▁▁▂▂	8888	lightingpointlitspecular_small
   8/8   MB	1	12.8ms	13ms	13ms	13.3ms	2%	▃▇█▇▁▅▄▃▂▄	8888	lightingspotlitdiffuse_large
   8/8   MB	1	12.8ms	13ms	13ms	13.2ms	1%	▄▃██▄▁▃▅▂▇	8888	lightingspotlitdiffuse_small
   8/8   MB	1	10.6ms	10.7ms	10.8ms	11.1ms	2%	▂▄██▂▁▃▃▂▂	8888	lightingdistantlitdiffuse_large
   8/8   MB	1	10.6ms	10.7ms	10.8ms	11.3ms	2%	▂▂▇█▃▁▂▅▁▂	8888	lightingdistantlitdiffuse_small
   8/8   MB	1	10.9ms	11.1ms	11.2ms	11.6ms	2%	▁▂▇▁█▃▂▂▇▁	8888	lightingpointlitdiffuse_large
   8/8   MB	1	10.9ms	11.1ms	11.1ms	11.5ms	2%	▄▃█▅▃▃▁▃▂▁	8888	lightingpointlitdiffuse_small

Bug: skia:
Change-Id: I7542a5ca1f209a732630f646b4ceb4fb08150ce4
Reviewed-on: https://skia-review.googlesource.com/20155
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
1 file changed