blob: 44ed7c477dc7875d5c2e511b9c3d9699e1744181 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
reed@android.com8a1c16f2008-12-17 15:59:43 +00009
10#ifndef SkDrawRectangle_DEFINED
11#define SkDrawRectangle_DEFINED
12
13#include "SkBoundable.h"
14#include "SkMemberInfo.h"
15#include "SkRect.h"
16
17class SkRectToRect;
18
19class SkDrawRect : public SkBoundable {
20 DECLARE_DRAW_MEMBER_INFO(Rect);
21 SkDrawRect();
mtklein72c9faa2015-01-09 10:06:39 -080022 void dirty() SK_OVERRIDE;
23 bool draw(SkAnimateMaker& ) SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000024#ifdef SK_DUMP_ENABLED
mtklein72c9faa2015-01-09 10:06:39 -080025 void dump(SkAnimateMaker* ) SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000026#endif
mtklein72c9faa2015-01-09 10:06:39 -080027 SkDisplayable* getParent() const SK_OVERRIDE;
28 bool getProperty(int index, SkScriptValue* value) const SK_OVERRIDE;
29 bool setParent(SkDisplayable* parent) SK_OVERRIDE;
30 bool setProperty(int index, SkScriptValue& ) SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000031protected:
32 SkRect fRect;
33 SkDisplayable* fParent;
34private:
35 friend class SkDrawClip;
36 friend class SkRectToRect;
37 friend class SkSaveLayer;
38 typedef SkBoundable INHERITED;
39};
40
41class SkRoundRect : public SkDrawRect {
42 DECLARE_MEMBER_INFO(RoundRect);
43 SkRoundRect();
mtklein72c9faa2015-01-09 10:06:39 -080044 bool draw(SkAnimateMaker& ) SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000045#ifdef SK_DUMP_ENABLED
mtklein72c9faa2015-01-09 10:06:39 -080046 void dump(SkAnimateMaker* ) SK_OVERRIDE;
rmistry@google.comd6176b02012-08-23 18:14:13 +000047#endif
reed@android.com8a1c16f2008-12-17 15:59:43 +000048protected:
49 SkScalar rx;
50 SkScalar ry;
51private:
52 typedef SkDrawRect INHERITED;
53};
54
55#endif // SkDrawRectangle_DEFINED