epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
| 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.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 9 | |
| 10 | #ifndef SkDrawPaint_DEFINED |
| 11 | #define SkDrawPaint_DEFINED |
| 12 | |
reed | 986ca61 | 2014-11-26 08:50:45 -0800 | [diff] [blame] | 13 | #include "SkADrawable.h" |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 14 | #include "SkIntArray.h" |
| 15 | #include "SkMemberInfo.h" |
| 16 | #include "SkPaint.h" |
| 17 | #include "SkXfermode.h" |
| 18 | |
| 19 | class SkDrawMaskFilter; |
| 20 | class SkDrawPathEffect; |
| 21 | class SkDrawShader; |
| 22 | class SkTransferMode; |
| 23 | class SkDrawTypeface; |
| 24 | |
reed | 986ca61 | 2014-11-26 08:50:45 -0800 | [diff] [blame] | 25 | class SkDrawPaint : public SkADrawable { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 26 | DECLARE_DRAW_MEMBER_INFO(Paint); |
| 27 | SkDrawPaint(); |
| 28 | virtual ~SkDrawPaint(); |
tomhudson@google.com | d6caf2e | 2011-07-08 14:41:12 +0000 | [diff] [blame] | 29 | virtual bool add(SkAnimateMaker* , SkDisplayable* child); |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 30 | SkDisplayable* deepCopy(SkAnimateMaker* ) override; |
| 31 | bool draw(SkAnimateMaker& ) override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 32 | #ifdef SK_DUMP_ENABLED |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 33 | void dump(SkAnimateMaker* ) override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 34 | #endif |
tfarina | f4219dd | 2015-04-27 17:18:28 -0700 | [diff] [blame] | 35 | void executeFunction(SkDisplayable* target, int index, |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 36 | SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type, |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 37 | SkScriptValue* ) override; |
| 38 | const SkFunctionParamType* getFunctionsParameters() override; |
| 39 | bool getProperty(int index, SkScriptValue* value) const override; |
| 40 | bool resolveIDs(SkAnimateMaker& maker, SkDisplayable* original, SkApply* apply) override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 41 | protected: |
| 42 | static const SkFunctionParamType fFunctionParameters[]; |
| 43 | void setupPaint(SkPaint* paint) const; |
| 44 | public: |
| 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; |
| 73 | private: |
reed | 986ca61 | 2014-11-26 08:50:45 -0800 | [diff] [blame] | 74 | typedef SkADrawable INHERITED; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 75 | friend class SkTextToPath; |
| 76 | friend class SkSaveLayer; |
| 77 | }; |
| 78 | |
| 79 | #endif // SkDrawPaint_DEFINED |