Brian Osman | 543d2e2 | 2019-02-15 14:29:38 -0500 | [diff] [blame] | 1 | /* |
| 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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "modules/particles/include/SkReflected.h" |
Brian Osman | 543d2e2 | 2019-02-15 14:29:38 -0500 | [diff] [blame] | 12 | |
Brian Osman | 543d2e2 | 2019-02-15 14:29:38 -0500 | [diff] [blame] | 13 | class SkCanvas; |
Brian Osman | 125daa4 | 2019-02-20 12:25:20 -0500 | [diff] [blame] | 14 | struct SkParticleState; |
Brian Osman | 543d2e2 | 2019-02-15 14:29:38 -0500 | [diff] [blame] | 15 | class SkPaint; |
Brian Osman | 543d2e2 | 2019-02-15 14:29:38 -0500 | [diff] [blame] | 16 | class SkString; |
| 17 | |
| 18 | class SkParticleDrawable : public SkReflected { |
| 19 | public: |
| 20 | REFLECTED_ABSTRACT(SkParticleDrawable, SkReflected) |
| 21 | |
Brian Osman | 125daa4 | 2019-02-20 12:25:20 -0500 | [diff] [blame] | 22 | virtual void draw(SkCanvas* canvas, const SkParticleState particles[], int count, |
| 23 | const SkPaint* paint) = 0; |
Brian Osman | 543d2e2 | 2019-02-15 14:29:38 -0500 | [diff] [blame] | 24 | |
| 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 |