skia2/modules/particles/include/SkParticleDrawable.h
Brian Osman 6104ba0dca Particles: Do a cleanup/standardization pass on the API
For clients not using JSON, the factories were inconsistent.

Change-Id: Ifd920fa1e18f5edffa12de238af8488406951e5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257683
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-12-03 20:06:18 +00:00

35 lines
997 B
C++

/*
* 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 "modules/particles/include/SkReflected.h"
class SkCanvas;
struct SkParticles;
class SkPaint;
namespace skresources { class ResourceProvider; }
class SkParticleDrawable : public SkReflected {
public:
REFLECTED_ABSTRACT(SkParticleDrawable, SkReflected)
virtual void draw(SkCanvas* canvas, const SkParticles& particles, int count,
const SkPaint& paint) = 0;
virtual void prepare(const skresources::ResourceProvider* resourceProvider) = 0;
static void RegisterDrawableTypes();
static sk_sp<SkParticleDrawable> MakeCircle(int radius);
static sk_sp<SkParticleDrawable> MakeImage(const char* imagePath, const char* imageName,
int cols, int rows);
};
#endif // SkParticleEffect_DEFINED