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

Side by Side Diff: sky/engine/core/painting/PaintingContext.idl

Issue 1144483002: Flesh out the Painting API a bit. (Closed) Base URL: https://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/PaintingContext.cpp ('k') | sky/examples/raw/painting.sky » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/SkRect representation.
5 interface PaintingContext { 6 interface PaintingContext {
6 readonly attribute double height; 7 readonly attribute double height;
7 readonly attribute double width; 8 readonly attribute double width;
8 9
10 void save();
11 void saveLayer(float[] bounds4 /* optional */, Paint paint /* optional */);
12 void restore();
13
14 void translate(float dx, float dy);
15 void scale(float sx, float sy);
robertphillips 2015/05/13 20:22:06 rotateDegrees ? to leave room for a rotateRadians
Matt Perry 2015/05/13 20:32:44 Done.
16 void rotate(float degrees);
17 void skew(float sx, float sy);
18 void concat(float[] matrix9);
19
20 void clipRect(float[] rect4);
21
22 void drawPaint(Paint paint);
23 void drawRect(float[] rect4, Paint paint);
24 void drawOval(float[] rect4, Paint paint);
robertphillips 2015/05/13 20:22:06 What about something like: drawRoundRectXY(float[]
Matt Perry 2015/05/13 20:32:44 Sure. I didn't add all the methods from skia right
25 // TODO(mpcomplete): SkScalar is a float. Do we really want doubles?
9 void drawCircle(double x, double y, double radius, Paint paint); 26 void drawCircle(double x, double y, double radius, Paint paint);
reed1 2015/05/13 20:35:03 FWIW : SkScalar is currently float, but we are bui
27
10 void commit(); 28 void commit();
11 }; 29 };
OLDNEW
« no previous file with comments | « sky/engine/core/painting/PaintingContext.cpp ('k') | sky/examples/raw/painting.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698