blob: 5ac5a93ea2f512cf638d8219beade757bf95f97d [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 SkDrawPaint_DEFINED
11#define SkDrawPaint_DEFINED
12
reed986ca612014-11-26 08:50:45 -080013#include "SkADrawable.h"
reed@android.com8a1c16f2008-12-17 15:59:43 +000014#include "SkIntArray.h"
15#include "SkMemberInfo.h"
16#include "SkPaint.h"
17#include "SkXfermode.h"
18
19class SkDrawMaskFilter;
20class SkDrawPathEffect;
21class SkDrawShader;
22class SkTransferMode;
23class SkDrawTypeface;
24
reed986ca612014-11-26 08:50:45 -080025class SkDrawPaint : public SkADrawable {
reed@android.com8a1c16f2008-12-17 15:59:43 +000026 DECLARE_DRAW_MEMBER_INFO(Paint);
27 SkDrawPaint();
28 virtual ~SkDrawPaint();
tomhudson@google.comd6caf2e2011-07-08 14:41:12 +000029 virtual bool add(SkAnimateMaker* , SkDisplayable* child);
tfarinaaa458fb2015-01-05 17:18:51 -080030 virtual SkDisplayable* deepCopy(SkAnimateMaker* ) SK_OVERRIDE;
31 virtual bool draw(SkAnimateMaker& ) SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000032#ifdef SK_DUMP_ENABLED
tfarinaaa458fb2015-01-05 17:18:51 -080033 virtual void dump(SkAnimateMaker* ) SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000034#endif
rmistry@google.comd6176b02012-08-23 18:14:13 +000035 virtual void executeFunction(SkDisplayable* target, int index,
reed@android.com8a1c16f2008-12-17 15:59:43 +000036 SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type,
tfarinaaa458fb2015-01-05 17:18:51 -080037 SkScriptValue* ) SK_OVERRIDE;
38 virtual const SkFunctionParamType* getFunctionsParameters() SK_OVERRIDE;
39 virtual bool getProperty(int index, SkScriptValue* value) const SK_OVERRIDE;
40 virtual bool resolveIDs(SkAnimateMaker& maker, SkDisplayable* original, SkApply* apply) SK_OVERRIDE;
reed@android.com8a1c16f2008-12-17 15:59:43 +000041protected:
42 static const SkFunctionParamType fFunctionParameters[];
43 void setupPaint(SkPaint* paint) const;
44public:
45 SkBool antiAlias;
46 SkDrawColor* color;
47 SkBool fakeBold;
48 SkBool filterBitmap;
49 SkBool linearText;
50 SkDrawMaskFilter* maskFilter;
51 SkDrawPathEffect* pathEffect;
52 SkDrawShader* shader;
53 SkBool strikeThru;
54 SkBool stroke;
55 int /*SkPaint::Cap*/ strokeCap;
56 int /*SkPaint::Join */ strokeJoin;
57 SkScalar strokeMiter;
58 SkScalar strokeWidth;
59 int /* SkPaint::Style */ style;
60 int /* SkPaint::Align */ textAlign;
61 SkScalar textScaleX;
62 SkScalar textSize;
63 SkScalar textSkewX;
64 SkDrawTypeface* typeface;
65 SkBool underline;
66 int /*SkXfermode::Modes*/ xfermode;
67 SkBool8 fOwnsColor;
68 SkBool8 fOwnsMaskFilter;
69 SkBool8 fOwnsPathEffect;
70 SkBool8 fOwnsShader;
71 SkBool8 fOwnsTransferMode;
72 SkBool8 fOwnsTypeface;
73private:
reed986ca612014-11-26 08:50:45 -080074 typedef SkADrawable INHERITED;
reed@android.com8a1c16f2008-12-17 15:59:43 +000075 friend class SkTextToPath;
76 friend class SkSaveLayer;
77};
78
79#endif // SkDrawPaint_DEFINED