auto merge of #4891 : mmatyas/servo/canvas_gradient, r=jdm

Based on [ebalint](https://github.com/ebalint)'s original patch, this commit implements the linear and radial gradients for the canvas. The PR also includes test cases.
Depends on #4623 and servo/rust-azure#136.
This commit is contained in:
bors-servo 2015-03-20 03:12:47 -06:00
commit dea36f9816
55 changed files with 290 additions and 228 deletions

View file

@ -6,7 +6,7 @@
interface CanvasGradient {
// opaque object
// addColorStop should take a double
//void addColorStop(float offset, DOMString color);
void addColorStop(float offset, DOMString color);
};

View file

@ -52,8 +52,10 @@ interface CanvasRenderingContext2D {
// colours and styles (see also the CanvasDrawingStyles interface)
attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
attribute (DOMString or CanvasGradient or CanvasPattern) fillStyle; // (default black)
//CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
//CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
[Throws]
CanvasGradient createLinearGradient(double x0, double y0, double x1, double y1);
[Throws]
CanvasGradient createRadialGradient(double x0, double y0, double r0, double x1, double y1, double r1);
//CanvasPattern createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition);
// shadows