| 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 [ |
| 7 // Height and width are used for culling optimizations and do not necessarily | 7 Constructor(PictureRecorder recorder, double width, double height), |
| 8 // imply that the Canvas is backed by a buffer with any specific bounds. | 8 ] interface Canvas { |
| 9 readonly attribute float height; | |
| 10 readonly attribute float width; | |
| 11 | |
| 12 void save(); | 9 void save(); |
| 13 // TODO(jackson): Paint should be optional, but making it optional causes cras
h | 10 // TODO(jackson): Paint should be optional, but making it optional causes cras
h |
| 14 void saveLayer(Rect bounds, /* optional */ Paint paint); | 11 void saveLayer(Rect bounds, /* optional */ Paint paint); |
| 15 void restore(); | 12 void restore(); |
| 16 | 13 |
| 17 void translate(float dx, float dy); | 14 void translate(float dx, float dy); |
| 18 void scale(float sx, float sy); | 15 void scale(float sx, float sy); |
| 19 void rotate(float radians); | 16 void rotate(float radians); |
| 20 void skew(float sx, float sy); | 17 void skew(float sx, float sy); |
| 21 void concat(Float32List matrix4); | 18 void concat(Float32List matrix4); |
| 22 | 19 |
| 23 void clipRect(Rect rect); | 20 void clipRect(Rect rect); |
| 24 void clipRRect(RRect rrect); | 21 void clipRRect(RRect rrect); |
| 25 void clipPath(Path path); | 22 void clipPath(Path path); |
| 26 | 23 |
| 27 void drawLine(float x0, float y0, float x1, float y1, Paint paint); | 24 void drawLine(float x0, float y0, float x1, float y1, Paint paint); |
| 28 void drawPicture(Picture picture); | 25 void drawPicture(Picture picture); |
| 29 void drawPaint(Paint paint); | 26 void drawPaint(Paint paint); |
| 30 void drawRect(Rect rect, Paint paint); | 27 void drawRect(Rect rect, Paint paint); |
| 31 void drawRRect(RRect rrect, Paint paint); | 28 void drawRRect(RRect rrect, Paint paint); |
| 32 void drawOval(Rect rect, Paint paint); | 29 void drawOval(Rect rect, Paint paint); |
| 33 void drawCircle(float x, float y, float radius, Paint paint); | 30 void drawCircle(float x, float y, float radius, Paint paint); |
| 34 void drawPath(Path path, Paint paint); | 31 void drawPath(Path path, Paint paint); |
| 35 void drawImage(Image image, float x, float y, Paint paint); | 32 void drawImage(Image image, float x, float y, Paint paint); |
| 36 }; | 33 }; |
| OLD | NEW |