gfx/skia/trunk/src/animator/SkPathParts.h

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

michael@0 1
michael@0 2 /*
michael@0 3 * Copyright 2006 The Android Open Source Project
michael@0 4 *
michael@0 5 * Use of this source code is governed by a BSD-style license that can be
michael@0 6 * found in the LICENSE file.
michael@0 7 */
michael@0 8
michael@0 9
michael@0 10 #ifndef SkPathParts_DEFINED
michael@0 11 #define SkPathParts_DEFINED
michael@0 12
michael@0 13 #include "SkDisplayable.h"
michael@0 14 #include "SkMemberInfo.h"
michael@0 15 #include "SkPath.h"
michael@0 16
michael@0 17 class SkDrawPath;
michael@0 18 class SkDrawMatrix;
michael@0 19
michael@0 20 class SkPathPart : public SkDisplayable {
michael@0 21 public:
michael@0 22 SkPathPart();
michael@0 23 virtual bool add() = 0;
michael@0 24 virtual void dirty();
michael@0 25 virtual SkDisplayable* getParent() const;
michael@0 26 virtual bool setParent(SkDisplayable* parent);
michael@0 27 #ifdef SK_DEBUG
michael@0 28 virtual bool isPathPart() const { return true; }
michael@0 29 #endif
michael@0 30 protected:
michael@0 31 SkDrawPath* fPath;
michael@0 32 };
michael@0 33
michael@0 34 class SkMoveTo : public SkPathPart {
michael@0 35 DECLARE_MEMBER_INFO(MoveTo);
michael@0 36 SkMoveTo();
michael@0 37 virtual bool add();
michael@0 38 protected:
michael@0 39 SkScalar x;
michael@0 40 SkScalar y;
michael@0 41 };
michael@0 42
michael@0 43 class SkRMoveTo : public SkMoveTo {
michael@0 44 DECLARE_MEMBER_INFO(RMoveTo);
michael@0 45 virtual bool add();
michael@0 46 private:
michael@0 47 typedef SkMoveTo INHERITED;
michael@0 48 };
michael@0 49
michael@0 50 class SkLineTo : public SkPathPart {
michael@0 51 DECLARE_MEMBER_INFO(LineTo);
michael@0 52 SkLineTo();
michael@0 53 virtual bool add();
michael@0 54 protected:
michael@0 55 SkScalar x;
michael@0 56 SkScalar y;
michael@0 57 };
michael@0 58
michael@0 59 class SkRLineTo : public SkLineTo {
michael@0 60 DECLARE_MEMBER_INFO(RLineTo);
michael@0 61 virtual bool add();
michael@0 62 private:
michael@0 63 typedef SkLineTo INHERITED;
michael@0 64 };
michael@0 65
michael@0 66 class SkQuadTo : public SkPathPart {
michael@0 67 DECLARE_MEMBER_INFO(QuadTo);
michael@0 68 SkQuadTo();
michael@0 69 virtual bool add();
michael@0 70 protected:
michael@0 71 SkScalar x1;
michael@0 72 SkScalar y1;
michael@0 73 SkScalar x2;
michael@0 74 SkScalar y2;
michael@0 75 };
michael@0 76
michael@0 77 class SkRQuadTo : public SkQuadTo {
michael@0 78 DECLARE_MEMBER_INFO(RQuadTo);
michael@0 79 virtual bool add();
michael@0 80 private:
michael@0 81 typedef SkQuadTo INHERITED;
michael@0 82 };
michael@0 83
michael@0 84 class SkCubicTo : public SkPathPart {
michael@0 85 DECLARE_MEMBER_INFO(CubicTo);
michael@0 86 SkCubicTo();
michael@0 87 virtual bool add();
michael@0 88 protected:
michael@0 89 SkScalar x1;
michael@0 90 SkScalar y1;
michael@0 91 SkScalar x2;
michael@0 92 SkScalar y2;
michael@0 93 SkScalar x3;
michael@0 94 SkScalar y3;
michael@0 95 };
michael@0 96
michael@0 97 class SkRCubicTo : public SkCubicTo {
michael@0 98 DECLARE_MEMBER_INFO(RCubicTo);
michael@0 99 virtual bool add();
michael@0 100 private:
michael@0 101 typedef SkCubicTo INHERITED;
michael@0 102 };
michael@0 103
michael@0 104 class SkClose : public SkPathPart {
michael@0 105 DECLARE_EMPTY_MEMBER_INFO(Close);
michael@0 106 virtual bool add();
michael@0 107 };
michael@0 108
michael@0 109 class SkAddGeom : public SkPathPart {
michael@0 110 DECLARE_PRIVATE_MEMBER_INFO(AddGeom);
michael@0 111 SkAddGeom();
michael@0 112 protected:
michael@0 113 int /*SkPath::Direction*/ direction;
michael@0 114 };
michael@0 115
michael@0 116 class SkAddRect : public SkAddGeom {
michael@0 117 DECLARE_MEMBER_INFO(AddRect);
michael@0 118 SkAddRect();
michael@0 119 virtual bool add();
michael@0 120 protected:
michael@0 121 SkRect fRect;
michael@0 122 private:
michael@0 123 typedef SkAddGeom INHERITED;
michael@0 124 };
michael@0 125
michael@0 126 class SkAddOval : public SkAddRect {
michael@0 127 DECLARE_MEMBER_INFO(AddOval);
michael@0 128 virtual bool add();
michael@0 129 private:
michael@0 130 typedef SkAddRect INHERITED;
michael@0 131 };
michael@0 132
michael@0 133 class SkAddCircle : public SkAddGeom {
michael@0 134 DECLARE_MEMBER_INFO(AddCircle);
michael@0 135 SkAddCircle();
michael@0 136 virtual bool add();
michael@0 137 private:
michael@0 138 SkScalar radius;
michael@0 139 SkScalar x;
michael@0 140 SkScalar y;
michael@0 141 typedef SkAddGeom INHERITED;
michael@0 142 };
michael@0 143
michael@0 144 class SkAddRoundRect : public SkAddRect {
michael@0 145 DECLARE_MEMBER_INFO(AddRoundRect);
michael@0 146 SkAddRoundRect();
michael@0 147 virtual bool add();
michael@0 148 private:
michael@0 149 SkScalar rx;
michael@0 150 SkScalar ry;
michael@0 151 typedef SkAddRect INHERITED;
michael@0 152 };
michael@0 153
michael@0 154 class SkAddPath : public SkPathPart {
michael@0 155 DECLARE_MEMBER_INFO(AddPath);
michael@0 156 SkAddPath();
michael@0 157 virtual bool add();
michael@0 158 private:
michael@0 159 typedef SkPathPart INHERITED;
michael@0 160 SkDrawMatrix* matrix;
michael@0 161 SkDrawPath* path;
michael@0 162 };
michael@0 163
michael@0 164 #endif // SkPathParts_DEFINED

mercurial