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 11 #include "modules/particles/include/SkReflected.h" 12 13 class SkCanvas; 14 struct SkParticles; 15 class SkPaint; 16 17 namespace skresources { class ResourceProvider; } 18 19 class SkParticleDrawable : public SkReflected { 20 public: 21 REFLECTED_ABSTRACT(SkParticleDrawable, SkReflected) 22 23 virtual void draw(SkCanvas* canvas, const SkParticles& particles, int count, 24 const SkPaint& paint) = 0; 25 virtual void prepare(const skresources::ResourceProvider* resourceProvider) = 0; 26 27 static void RegisterDrawableTypes(); 28 29 static sk_sp<SkParticleDrawable> MakeCircle(int radius); 30 static sk_sp<SkParticleDrawable> MakeImage(const char* imagePath, const char* imageName, 31 int cols, int rows); 32 }; 33 34 #endif // SkParticleEffect_DEFINED 35