2 * Copyright 2006 The Android Open Source Project
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
8 #ifndef SkPaintPart_DEFINED
9 #define SkPaintPart_DEFINED
11 #include "SkDisplayable.h"
12 #include "SkMemberInfo.h"
15 #include "SkTypeface.h"
16 #include "SkXfermode.h"
21 class SkPaintPart : public SkDisplayable {
24 virtual bool add() = 0;
25 virtual SkDisplayable* getParent() const;
26 virtual bool setParent(SkDisplayable* parent);
28 virtual bool isPaintPart() const { return true; }
34 class SkDrawMaskFilter : public SkPaintPart {
35 DECLARE_EMPTY_MEMBER_INFO(MaskFilter);
36 virtual SkMaskFilter* getMaskFilter();
38 bool add() SK_OVERRIDE;
41 class SkDrawPathEffect : public SkPaintPart {
42 DECLARE_EMPTY_MEMBER_INFO(PathEffect);
43 virtual SkPathEffect* getPathEffect();
45 bool add() SK_OVERRIDE;
48 class SkDrawShader : public SkPaintPart {
49 DECLARE_DRAW_MEMBER_INFO(Shader);
51 virtual SkShader* getShader();
53 bool add() SK_OVERRIDE;
54 SkMatrix* getMatrix(); // returns NULL if matrix is NULL
56 int /*SkShader::TileMode*/ tileMode;
59 class SkDrawTypeface : public SkPaintPart {
60 DECLARE_DRAW_MEMBER_INFO(Typeface);
62 #ifdef SK_DUMP_ENABLED
63 void dump(SkAnimateMaker *) SK_OVERRIDE;
65 SkTypeface* getTypeface() {
66 return SkTypeface::CreateFromName(fontName.c_str(), style); }
68 bool add() SK_OVERRIDE;
70 SkTypeface::Style style;
73 #endif // SkPaintPart_DEFINED