2019-02-15 19:29:38 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2019 Google LLC
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkParticleDrawable_DEFINED
|
|
|
|
#define SkParticleDrawable_DEFINED
|
|
|
|
|
|
|
|
#include "SkReflected.h"
|
|
|
|
|
|
|
|
class SkCanvas;
|
2019-02-20 17:25:20 +00:00
|
|
|
struct SkParticleState;
|
2019-02-15 19:29:38 +00:00
|
|
|
class SkPaint;
|
|
|
|
class SkString;
|
|
|
|
|
|
|
|
class SkParticleDrawable : public SkReflected {
|
|
|
|
public:
|
|
|
|
REFLECTED_ABSTRACT(SkParticleDrawable, SkReflected)
|
|
|
|
|
2019-02-20 17:25:20 +00:00
|
|
|
virtual void draw(SkCanvas* canvas, const SkParticleState particles[], int count,
|
|
|
|
const SkPaint* paint) = 0;
|
2019-02-15 19:29:38 +00:00
|
|
|
|
|
|
|
static void RegisterDrawableTypes();
|
|
|
|
|
|
|
|
static sk_sp<SkParticleDrawable> MakeCircle(int radius);
|
|
|
|
static sk_sp<SkParticleDrawable> MakeImage(const SkString& path, int cols, int rows);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SkParticleEffect_DEFINED
|