tweak SkVMBlitter for paints with no shader

As written today we push two sets of the paint color uniforms (4 floats
each set, 8 total): the blitter pushes one unpremul set itself to pass
to shaders that would like to use them, and when there's no shader, we
synthesize an Color4Shader using the paint color that ends up pushing
the other set, this time premul.

When the paint color is opaque there's no difference between these two
sets of uniforms, and when not, well, it's just a few cheap *hoisted*
multiplies to go from that first unpremul set to premul.  So no real
pressing need to push those premul values at all.

This CL adds a new SkShaderBase subclass PaintColorShader used only for
that case where we're synthesizing a shader from the paint color, and
just does what I've described, `return premul(paint);`.

I really only did this because I've been poking around in the debugger
looking for some other bug and noticed the duplicate values in the
uniforms array.  I expect no real-world effect from this CL except fewer
uniforms to look at in the debugger.

Change-Id: I5e1c17945ed77467c91e351f58fcf900674c4391
Reviewed-by: Herb Derby <>
Commit-Queue: Mike Klein <>
1 file changed