Commit 1f26d657 authored by Matt Perry's avatar Matt Perry

Add support for linear gradients, implemented as skia shaders.

I had to complicate the IDL bindings generation to allow passing an array of
colors. Without these changes, we'd try to convert the dart object to
Vector<SkColor>, which C++ thinks is Vector<unsigned>, and we'd use the wrong
converter. So I added some template grease to force it to use a
Vector<CanvasColor> converter.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1152963009
parent 1526e5f8
......@@ -26,8 +26,12 @@ void main() {
paint.color = const Color.fromARGB(128, 255, 0, 255);
context.rotateDegrees(45.0);
Gradient yellowBlue = new Gradient.Linear(
[new Point(-radius, -radius), new Point(0.0, 0.0)],
[const Color(0xFFFFFF00), const Color(0xFF0000FF)],
null);
context.drawRect(new Rect.fromLTRB(-radius, -radius, radius, radius),
paint);
new Paint()..setShader(yellowBlue));
// Scale x and y by 0.5.
var scaleMatrix = new Float32List.fromList([
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment