OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // TODO(mpcomplete): Figure out a better SkMatrix representation. | 5 // TODO(mpcomplete): Figure out a better SkMatrix representation. |
6 [ | 6 [ |
7 Constructor(PictureRecorder recorder, double width, double height), | 7 Constructor(PictureRecorder recorder, Size bounds), |
8 RaisesException=Constructor, | 8 RaisesException=Constructor, |
9 ] interface Canvas { | 9 ] interface Canvas { |
10 void save(); | 10 void save(); |
11 // TODO(jackson): Paint should be optional, but making it optional causes cras
h | 11 // TODO(jackson): Paint should be optional, but making it optional causes cras
h |
12 void saveLayer(Rect bounds, /* optional */ Paint paint); | 12 void saveLayer(Rect bounds, /* optional */ Paint paint); |
13 void restore(); | 13 void restore(); |
14 | 14 |
15 void translate(float dx, float dy); | 15 void translate(float dx, float dy); |
16 void scale(float sx, float sy); | 16 void scale(float sx, float sy); |
17 void rotate(float radians); | 17 void rotate(float radians); |
18 void skew(float sx, float sy); | 18 void skew(float sx, float sy); |
19 void concat(Float32List matrix4); | 19 void concat(Float32List matrix4); |
20 | 20 |
21 void clipRect(Rect rect); | 21 void clipRect(Rect rect); |
22 void clipRRect(RRect rrect); | 22 void clipRRect(RRect rrect); |
23 void clipPath(Path path); | 23 void clipPath(Path path); |
24 | 24 |
25 void drawLine(float x0, float y0, float x1, float y1, Paint paint); | 25 void drawLine(Point p1, Point p2, Paint paint); |
26 void drawPicture(Picture picture); | 26 void drawPicture(Picture picture); |
27 void drawPaint(Paint paint); | 27 void drawPaint(Paint paint); |
28 void drawRect(Rect rect, Paint paint); | 28 void drawRect(Rect rect, Paint paint); |
29 void drawRRect(RRect rrect, Paint paint); | 29 void drawRRect(RRect rrect, Paint paint); |
30 void drawOval(Rect rect, Paint paint); | 30 void drawOval(Rect rect, Paint paint); |
31 void drawCircle(float x, float y, float radius, Paint paint); | 31 void drawCircle(Point c, float radius, Paint paint); |
32 void drawPath(Path path, Paint paint); | 32 void drawPath(Path path, Paint paint); |
33 void drawImage(Image image, float x, float y, Paint paint); | 33 void drawImage(Image image, Point p, Paint paint); |
34 void drawImageRect(Image image, Rect src, Rect dst, Paint paint); | 34 void drawImageRect(Image image, Rect src, Rect dst, Paint paint); |
35 }; | 35 }; |
OLD | NEW |