blob: 2707741ec89ad92813def2306c039c377f1c2439 [file] [log] [blame]
* Copyright 2013 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef SkTileImageFilter_DEFINED
#define SkTileImageFilter_DEFINED
#include "SkImageFilter.h"
class SK_API SkTileImageFilter : public SkImageFilter {
/** Create a tile image filter
@param src Defines the pixels to tile
@param dst Defines the pixels where tiles are drawn
@param input Input from which the subregion defined by srcRect will be tiled
static sk_sp<SkImageFilter> Make(const SkRect& src,
const SkRect& dst,
sk_sp<SkImageFilter> input);
SkIRect onFilterBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override;
SkIRect onFilterNodeBounds(const SkIRect&, const SkMatrix&, MapDirection) const override;
SkRect computeFastBounds(const SkRect& src) const override;
void flatten(SkWriteBuffer& buffer) const override;
sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
SkIPoint* offset) const override;
sk_sp<SkImageFilter> onMakeColorSpace(SkColorSpaceXformer*) const override;
SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, sk_sp<SkImageFilter> input)
: INHERITED(&input, 1, nullptr), fSrcRect(srcRect), fDstRect(dstRect) {}
SkRect fSrcRect;
SkRect fDstRect;
typedef SkImageFilter INHERITED;