skia2/modules/particles/include/SkParticleDrawable.h
Brian Osman d12f2786e2 Use ResourceProvider in particles
Currently just for image drawable, but going to use this for
references to other kinds of data in bindings, too.

Change-Id: Ic6673530013337bbaadd2d3f1c040626ec24ffb8
Bug: skia:9513
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256776
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-11-27 16:45:23 +00:00

35 lines
981 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;
class SkString;
namespace skresources { class ResourceProvider; }
class SkParticleDrawable : public SkReflected {
public:
REFLECTED_ABSTRACT(SkParticleDrawable, SkReflected)
virtual void draw(const skresources::ResourceProvider* resourceProvider, SkCanvas* canvas,
const SkParticles& particles, int count, const SkPaint& paint) = 0;
static void RegisterDrawableTypes();
static sk_sp<SkParticleDrawable> MakeCircle(int radius);
static sk_sp<SkParticleDrawable> MakeImage(const SkString& path, const SkString& name,
int cols, int rows);
};
#endif // SkParticleEffect_DEFINED