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

Unified Diff: sky/engine/core/painting/Canvas.idl

Issue 1144483002: Flesh out the Painting API a bit. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased to eseidel's canvas patch 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
Index: sky/engine/core/painting/Canvas.idl
diff --git a/sky/engine/core/painting/Canvas.idl b/sky/engine/core/painting/Canvas.idl
index 36fc06318df17e5002b04ca37245356e7bbf8a46..14479c5923990e1bd3b5b5cb2613318b53e7c94b 100644
--- a/sky/engine/core/painting/Canvas.idl
+++ b/sky/engine/core/painting/Canvas.idl
@@ -1,11 +1,29 @@
// Copyright 2015 The Chromium Authors. All rights reserved.
// 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 Canvas {
// Height and width are used for culling optimizations and do not necessarily
// imply that the Canvas is backed by a buffer with any specific bounds.
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);
+ 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);
+ // TODO(mpcomplete): float
eseidel 2015/05/13 20:24:38 Feel free to change it. TBR=me.
void drawCircle(double x, double y, double radius, Paint paint);
};

Powered by Google App Engine
This is Rietveld 408576698