blob: 0196156f36f0beed7ebe721647cf0477fcf78d24 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
reed@android.comf76bacf2009-05-13 14:00:33 +00008#ifndef SkShape_DEFINED
9#define SkShape_DEFINED
10
11#include "SkFlattenable.h"
reed@android.comf76bacf2009-05-13 14:00:33 +000012
13class SkCanvas;
reed@android.comf48f2812009-05-18 04:20:55 +000014class SkMatrix;
reed@android.comf76bacf2009-05-13 14:00:33 +000015class SkWStream;
16
17class SkShape : public SkFlattenable {
18public:
reed@android.com0ad336f2009-06-29 16:02:20 +000019 SkShape();
20 virtual ~SkShape();
reed@android.comf76bacf2009-05-13 14:00:33 +000021
22 void draw(SkCanvas*);
23
24 /** Draw the shape translated by (dx,dy), which is applied before the
25 shape's matrix (if any).
26 */
27 void drawXY(SkCanvas*, SkScalar dx, SkScalar dy);
reed@android.com89bb83a2009-05-29 21:30:42 +000028
reed@android.comf76bacf2009-05-13 14:00:33 +000029 /** Draw the shape with the specified matrix, applied before the shape's
30 matrix (if any).
31 */
32 void drawMatrix(SkCanvas*, const SkMatrix&);
33
djsollen@google.comba28d032012-03-26 17:57:35 +000034 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkShape)
reed@android.comf76bacf2009-05-13 14:00:33 +000035
reed@android.com0ad336f2009-06-29 16:02:20 +000036protected:
37 virtual void onDraw(SkCanvas*);
38
39 SkShape(SkFlattenableReadBuffer&);
reed@android.comf76bacf2009-05-13 14:00:33 +000040
41private:
reed@android.comf76bacf2009-05-13 14:00:33 +000042
43 typedef SkFlattenable INHERITED;
44};
45
46#endif