skia2/include/effects/SkImageSource.h
Michael Ludwig 06eacf44d5 Add new SkImageFilters factory API
In preparation for moving the filter-specific headers from include/effects and into src/effects/imagefilters, this exposes a more convenient API where all filters provided by Skia are accessible from the same factory.

It also only exposes the factories that take the shared enums (SkColorChannel, SkTileMode), so the per-filter enums can be phased out (SkBlurImageFilter::TileMode, etc.). It also accepts an SkIRect* instead of an SkImageFilter::CropRect* since all uses seem to be for integer rectangles and flags are either always on or always off. This will allow us to later remove the CropRect type.

Bug: skia:9280
Change-Id: I71f77ff44b573f87b837d6523b9eb565521f0f36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230876
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-02 13:33:35 +00:00

30 lines
775 B
C++

/*
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkImageSource_DEFINED
#define SkImageSource_DEFINED
#include "include/core/SkImage.h"
#include "include/core/SkImageFilter.h"
// DEPRECATED: Use include/effects/SkImageFilters::Image
class SK_API SkImageSource {
public:
static sk_sp<SkImageFilter> Make(sk_sp<SkImage> image);
static sk_sp<SkImageFilter> Make(sk_sp<SkImage> image,
const SkRect& srcRect,
const SkRect& dstRect,
SkFilterQuality filterQuality);
static void RegisterFlattenables();
private:
SkImageSource() = delete;
};
#endif