1ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com/*
2ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Copyright 2006 The Android Open Source Project
3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com *
4ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * Use of this source code is governed by a BSD-style license that can be
5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com * found in the LICENSE file.
6ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com */
7ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com
88d4dc714da9fc598d48ad3e360870aee622094c4reed@google.com#ifndef SkPaintPart_DEFINED
98d4dc714da9fc598d48ad3e360870aee622094c4reed@google.com#define SkPaintPart_DEFINED
108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkDisplayable.h"
128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkMemberInfo.h"
138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkPaint.h"
148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkShader.h"
158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkTypeface.h"
168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkXfermode.h"
178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkDrawPaint;
198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkDrawMatrix;
208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkPaintPart : public SkDisplayable {
228a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.compublic:
238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkPaintPart();
248a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual bool add() = 0;
258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual SkDisplayable* getParent() const;
268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual bool setParent(SkDisplayable* parent);
278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifdef SK_DEBUG
288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual bool isPaintPart() const { return true; }
298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprotected:
318a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkDrawPaint* fPaint;
328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
348a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkDrawMaskFilter : public SkPaintPart {
358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    DECLARE_EMPTY_MEMBER_INFO(MaskFilter);
368a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual SkMaskFilter* getMaskFilter();
378a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprotected:
388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual bool add();
398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkDrawPathEffect : public SkPaintPart {
428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    DECLARE_EMPTY_MEMBER_INFO(PathEffect);
438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual SkPathEffect* getPathEffect();
448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprotected:
458a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual bool add();
468a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
478a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
488a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkDrawShader : public SkPaintPart {
498a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    DECLARE_DRAW_MEMBER_INFO(Shader);
508a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkDrawShader();
518a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual SkShader* getShader();
528a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprotected:
538a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual bool add();
549c9005a347e9996f357bd79591bd34f74f8bbc66commit-bot@chromium.org    SkMatrix* getMatrix(); // returns NULL if matrix is NULL
558a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkDrawMatrix* matrix;
568a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    int /*SkShader::TileMode*/ tileMode;
578a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
588a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
598a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkDrawTypeface  : public SkPaintPart {
608a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    DECLARE_DRAW_MEMBER_INFO(Typeface);
618a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkDrawTypeface();
628a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifdef SK_DUMP_ENABLED
638a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual void dump(SkAnimateMaker *);
648a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
658a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkTypeface* getTypeface() {
661220e1c28a6fb75817eec056fc307190d50ae8e6deanm@chromium.org        return SkTypeface::CreateFromName(fontName.c_str(), style); }
678a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprotected:
688a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual bool add();
698a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkString fontName;
708a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkTypeface::Style style;
718a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
728a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
738d4dc714da9fc598d48ad3e360870aee622094c4reed@google.com#endif // SkPaintPart_DEFINED
74