gfx/skia/trunk/src/animator/SkPaintParts.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/animator/SkPaintParts.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,75 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2006 The Android Open Source Project
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +
    1.12 +
    1.13 +#ifndef SkPaintParts_DEFINED
    1.14 +#define SkPaintParts_DEFINED
    1.15 +
    1.16 +#include "SkDisplayable.h"
    1.17 +#include "SkMemberInfo.h"
    1.18 +#include "SkPaint.h"
    1.19 +#include "SkShader.h"
    1.20 +#include "SkTypeface.h"
    1.21 +#include "SkXfermode.h"
    1.22 +
    1.23 +class SkDrawPaint;
    1.24 +class SkDrawMatrix;
    1.25 +
    1.26 +class SkPaintPart : public SkDisplayable {
    1.27 +public:
    1.28 +    SkPaintPart();
    1.29 +    virtual bool add() = 0;
    1.30 +    virtual SkDisplayable* getParent() const;
    1.31 +    virtual bool setParent(SkDisplayable* parent);
    1.32 +#ifdef SK_DEBUG
    1.33 +    virtual bool isPaintPart() const { return true; }
    1.34 +#endif
    1.35 +protected:
    1.36 +    SkDrawPaint* fPaint;
    1.37 +};
    1.38 +
    1.39 +class SkDrawMaskFilter : public SkPaintPart {
    1.40 +    DECLARE_EMPTY_MEMBER_INFO(MaskFilter);
    1.41 +    virtual SkMaskFilter* getMaskFilter();
    1.42 +protected:
    1.43 +    virtual bool add();
    1.44 +};
    1.45 +
    1.46 +class SkDrawPathEffect : public SkPaintPart {
    1.47 +    DECLARE_EMPTY_MEMBER_INFO(PathEffect);
    1.48 +    virtual SkPathEffect* getPathEffect();
    1.49 +protected:
    1.50 +    virtual bool add();
    1.51 +};
    1.52 +
    1.53 +class SkDrawShader : public SkPaintPart {
    1.54 +    DECLARE_DRAW_MEMBER_INFO(Shader);
    1.55 +    SkDrawShader();
    1.56 +    virtual SkShader* getShader();
    1.57 +protected:
    1.58 +    virtual bool add();
    1.59 +    void addPostlude(SkShader* shader);
    1.60 +    SkDrawMatrix* matrix;
    1.61 +    int /*SkShader::TileMode*/ tileMode;
    1.62 +};
    1.63 +
    1.64 +class SkDrawTypeface  : public SkPaintPart {
    1.65 +    DECLARE_DRAW_MEMBER_INFO(Typeface);
    1.66 +    SkDrawTypeface();
    1.67 +#ifdef SK_DUMP_ENABLED
    1.68 +    virtual void dump(SkAnimateMaker *);
    1.69 +#endif
    1.70 +    SkTypeface* getTypeface() {
    1.71 +        return SkTypeface::CreateFromName(fontName.c_str(), style); }
    1.72 +protected:
    1.73 +    virtual bool add();
    1.74 +    SkString fontName;
    1.75 +    SkTypeface::Style style;
    1.76 +};
    1.77 +
    1.78 +#endif // SkPaintParts_DEFINED

mercurial