Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Side by Side Diff: sky/engine/core/painting/Canvas.dart

Issue 1135283005: Sky: Add a CustomDart attribute to the IDL compiler, and use that with Canvas (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: . Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/painting/Canvas.cpp ('k') | sky/engine/core/painting/Canvas.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // This extends the Canvas.dart generated from Canvas.idl.
6
7 class Rect {
8 List<double> _value;
9 double get left => _value[0];
10 double get top => _value[1];
11 double get right => _value[2];
12 double get bottom => _value[3];
13
14 void setLTRB(double left, double top, double right, double bottom) {
15 _value = [left, top, right, bottom];
16 }
17 }
18
19 class Canvas extends _Canvas {
20 double get height => _height;
21 double get width => _width;
22
23 void save() => _save();
24 void saveLayer(Rect bounds, Paint paint) =>
25 _saveLayer(bounds._value, Paint paint);
26 void restore() => _restore();
27 void translate(double dx, double dy) => _translate(dx, dy);
28 void scale(double sx, double sy) => _scale(sx, sy);
29 void rotateDegrees(double degrees) => _rotateDegrees(degrees);
30 void skew(double sx, double sy) => _skew(sx, sy);
31 void concat(List<double> matrix9) => _concat(matrix9);
32 void clipRect(Rect rect) => _clipRect(rect._value);
33
34 void drawPicture(Picture picture) => _drawPicture(picture);
35 void drawPaint(Paint paint) => _drawPaint(paint);
36 void drawRect(Rect rect, Paint paint) => _drawRect(rect._value, paint);
37 void drawOval(Rect rect, Paint paint) => _drawOval(rect._value, paint);
38 void drawCircle(double x, double y, double radius, Paint paint) =>
39 _drawCircle(x, y, radius, paint);
40 }
OLDNEW
« no previous file with comments | « sky/engine/core/painting/Canvas.cpp ('k') | sky/engine/core/painting/Canvas.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698