blob: 074bdff96836323b62bc800e791b522f97b4eef2 [file] [log] [blame]
// 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 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 float height;
readonly attribute float width;
void save();
void saveLayer(Rect bounds /* optional */, Paint paint /* optional */);
void restore();
void translate(float dx, float dy);
void scale(float sx, float sy);
void rotateDegrees(float degrees);
void skew(float sx, float sy);
void concat(float[] matrix9);
void clipRect(Rect rect);
void drawPicture(Picture picture);
void drawPaint(Paint paint);
void drawRect(Rect rect, Paint paint);
void drawOval(Rect rect, Paint paint);
void drawCircle(float x, float y, float radius, Paint paint);
void drawPath(Path path, Paint paint);
void drawImage(Image image, float x, float y, Paint paint);
};