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 interface Canvas { | 6 interface Canvas { |
7 // Height and width are used for culling optimizations and do not necessarily | 7 // Height and width are used for culling optimizations and do not necessarily |
8 // imply that the Canvas is backed by a buffer with any specific bounds. | 8 // imply that the Canvas is backed by a buffer with any specific bounds. |
9 readonly attribute float height; | 9 readonly attribute float height; |
10 readonly attribute float width; | 10 readonly attribute float width; |
11 | 11 |
12 void save(); | 12 void save(); |
13 void saveLayer(Rect bounds /* optional */, Paint paint /* optional */); | 13 void saveLayer(Rect bounds /* optional */, Paint paint /* optional */); |
14 void restore(); | 14 void restore(); |
15 | 15 |
16 void translate(float dx, float dy); | 16 void translate(float dx, float dy); |
17 void scale(float sx, float sy); | 17 void scale(float sx, float sy); |
18 void rotateDegrees(float degrees); | 18 void rotateDegrees(float degrees); |
19 void skew(float sx, float sy); | 19 void skew(float sx, float sy); |
20 void concat(float[] matrix9); | 20 void concat(float[] matrix9); |
21 | 21 |
22 void clipRect(Rect rect); | 22 void clipRect(Rect rect); |
23 | 23 |
24 void drawPicture(Picture picture); | 24 void drawPicture(Picture picture); |
25 | 25 |
26 void drawPaint(Paint paint); | 26 void drawPaint(Paint paint); |
27 void drawRect(Rect rect, Paint paint); | 27 void drawRect(Rect rect, Paint paint); |
28 void drawOval(Rect rect, Paint paint); | 28 void drawOval(Rect rect, Paint paint); |
29 void drawCircle(float x, float y, float radius, Paint paint); | 29 void drawCircle(float x, float y, float radius, Paint paint); |
| 30 void drawPath(Path path, Paint paint); |
30 }; | 31 }; |
OLD | NEW |