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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/PaintingContext.idl
diff --git a/sky/engine/core/painting/PaintingContext.idl b/sky/engine/core/painting/PaintingContext.idl
index 8eec203b5b9fbde6570dc4004f7244c640b03275..f7c8884668ae8df2439fb515f5cf93080cd361a3 100644
--- a/sky/engine/core/painting/PaintingContext.idl
+++ b/sky/engine/core/painting/PaintingContext.idl
@@ -2,10 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// TODO(mpcomplete): Figure out a better SkMatrix/SkRect representation.
interface PaintingContext {
readonly attribute double height;
readonly attribute double width;
+ void save();
+ void saveLayer(float[] bounds4 /* optional */, Paint paint /* optional */);
+ void restore();
+
+ void translate(float dx, float dy);
+ 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.
+ void rotate(float degrees);
+ void skew(float sx, float sy);
+ void concat(float[] matrix9);
+
+ void clipRect(float[] rect4);
+
+ void drawPaint(Paint paint);
+ void drawRect(float[] rect4, Paint paint);
+ 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
+ // TODO(mpcomplete): SkScalar is a float. Do we really want doubles?
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
+
void commit();
};
« 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