blob: a47b24dff11a559bdc4403aad0f02b15f80cdbb8 [file] [log] [blame]
Brian Osman543d2e22019-02-15 14:29:38 -05001/*
2* Copyright 2019 Google LLC
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
7
8#ifndef SkParticleDrawable_DEFINED
9#define SkParticleDrawable_DEFINED
10
11#include "SkReflected.h"
12
Brian Osman543d2e22019-02-15 14:29:38 -050013class SkCanvas;
Brian Osman125daa42019-02-20 12:25:20 -050014struct SkParticleState;
Brian Osman543d2e22019-02-15 14:29:38 -050015class SkPaint;
Brian Osman543d2e22019-02-15 14:29:38 -050016class SkString;
17
18class SkParticleDrawable : public SkReflected {
19public:
20 REFLECTED_ABSTRACT(SkParticleDrawable, SkReflected)
21
Brian Osman125daa42019-02-20 12:25:20 -050022 virtual void draw(SkCanvas* canvas, const SkParticleState particles[], int count,
23 const SkPaint* paint) = 0;
Brian Osman543d2e22019-02-15 14:29:38 -050024
25 static void RegisterDrawableTypes();
26
27 static sk_sp<SkParticleDrawable> MakeCircle(int radius);
28 static sk_sp<SkParticleDrawable> MakeImage(const SkString& path, int cols, int rows);
29};
30
31#endif // SkParticleEffect_DEFINED