Home | History | Annotate | Download | only in animator
      1 /* libs/graphics/animator/SkDrawPaint.h
      2 **
      3 ** Copyright 2006, The Android Open Source Project
      4 **
      5 ** Licensed under the Apache License, Version 2.0 (the "License");
      6 ** you may not use this file except in compliance with the License.
      7 ** You may obtain a copy of the License at
      8 **
      9 **     http://www.apache.org/licenses/LICENSE-2.0
     10 **
     11 ** Unless required by applicable law or agreed to in writing, software
     12 ** distributed under the License is distributed on an "AS IS" BASIS,
     13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14 ** See the License for the specific language governing permissions and
     15 ** limitations under the License.
     16 */
     17 
     18 #ifndef SkDrawPaint_DEFINED
     19 #define SkDrawPaint_DEFINED
     20 
     21 #include "SkDrawable.h"
     22 #include "SkIntArray.h"
     23 #include "SkMemberInfo.h"
     24 #include "SkPaint.h"
     25 #include "SkXfermode.h"
     26 
     27 class SkDrawMaskFilter;
     28 class SkDrawPathEffect;
     29 class SkDrawShader;
     30 class SkTransferMode;
     31 class SkDrawTypeface;
     32 
     33 class SkDrawPaint : public SkDrawable {
     34     DECLARE_DRAW_MEMBER_INFO(Paint);
     35     SkDrawPaint();
     36     virtual ~SkDrawPaint();
     37     virtual bool add(SkAnimateMaker& , SkDisplayable* child);
     38     virtual SkDisplayable* deepCopy(SkAnimateMaker* );
     39     virtual bool draw(SkAnimateMaker& );
     40 #ifdef SK_DUMP_ENABLED
     41     virtual void dump(SkAnimateMaker* );
     42 #endif
     43     virtual void executeFunction(SkDisplayable* target, int index,
     44         SkTDArray<SkScriptValue>& parameters, SkDisplayTypes type,
     45         SkScriptValue* );
     46     virtual const SkFunctionParamType* getFunctionsParameters();
     47     virtual bool getProperty(int index, SkScriptValue* value) const;
     48     virtual bool resolveIDs(SkAnimateMaker& maker, SkDisplayable* original, SkApply* apply);
     49 protected:
     50     static const SkFunctionParamType fFunctionParameters[];
     51     void setupPaint(SkPaint* paint) const;
     52 public:
     53     SkBool antiAlias;
     54     SkDrawColor* color;
     55     SkBool fakeBold;
     56     SkBool filterBitmap;
     57     SkBool linearText;
     58     SkDrawMaskFilter* maskFilter;
     59     SkDrawPathEffect* pathEffect;
     60     SkDrawShader* shader;
     61     SkBool strikeThru;
     62     SkBool stroke;
     63     int /*SkPaint::Cap*/ strokeCap;
     64     int /*SkPaint::Join */ strokeJoin;
     65     SkScalar strokeMiter;
     66     SkScalar strokeWidth;
     67     int /* SkPaint::Style */ style;
     68     int /* SkPaint::Align */ textAlign;
     69     SkScalar textScaleX;
     70     SkScalar textSize;
     71     SkScalar textSkewX;
     72     SkDrawTypeface* typeface;
     73     SkBool underline;
     74     int /*SkXfermode::Modes*/ xfermode;
     75     SkBool8 fOwnsColor;
     76     SkBool8 fOwnsMaskFilter;
     77     SkBool8 fOwnsPathEffect;
     78     SkBool8 fOwnsShader;
     79     SkBool8 fOwnsTransferMode;
     80     SkBool8 fOwnsTypeface;
     81 private:
     82     typedef SkDrawable INHERITED;
     83     friend class SkTextToPath;
     84     friend class SkSaveLayer;
     85 };
     86 
     87 #endif // SkDrawPaint_DEFINED
     88 
     89