Simplify shader paint alpha modulation.
authorMike Klein <mtklein@chromium.org>
Mon, 21 Nov 2016 18:05:23 +0000 (13:05 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Mon, 21 Nov 2016 18:52:47 +0000 (18:52 +0000)
commit43c847b7f281c071a33980359e4d5839855da20f
treec2914be8ad27522ccbc402582aae63733aa6848c
parent14d28991450cd5f296516f83c23536d226b37448
Simplify shader paint alpha modulation.

We don't need to do any of this funky swap, load, srcin nonsense.  We've got a perfectly good scale_constant_float stage just perfect to be used instead.

While we're at it, we only need to modulate by paint alpha if the paint's not opaque.  x*1== x...

This puts the (x,y) inputs to shaders in (r,g) where they expect them.  It also frees (dr,dg,db,da) for use by the shader.  Might be handy for bilerp.

BUG=skia:

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

Change-Id: Ief60c469ecac8300798b67cc68817cc1d127cf17
Reviewed-on: https://skia-review.googlesource.com/5100
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
src/core/SkRasterPipelineBlitter.cpp
src/opts/SkRasterPipeline_opts.h