e5e79840ef
Change filterBounds(), onFilterBounds() and onFilterNodeBounds() and computeFastBounds() to return the destination rectangle. There was no code path that could return false, and returning rects by value is ok now. BUG=skia:5094 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1823573003 Review URL: https://codereview.chromium.org/1823573003
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
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 "SkImageFilter.h"
|
|
|
|
class SkImage;
|
|
|
|
class SK_API SkImageSource : public SkImageFilter {
|
|
public:
|
|
static SkImageFilter* Create(SkImage*);
|
|
static SkImageFilter* Create(SkImage*,
|
|
const SkRect& srcRect,
|
|
const SkRect& dstRect,
|
|
SkFilterQuality);
|
|
|
|
SkRect computeFastBounds(const SkRect& src) const override;
|
|
|
|
SK_TO_STRING_OVERRIDE()
|
|
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkImageSource)
|
|
|
|
protected:
|
|
void flatten(SkWriteBuffer&) const override;
|
|
|
|
SkSpecialImage* onFilterImage(SkSpecialImage* source, const Context&,
|
|
SkIPoint* offset) const override;
|
|
|
|
private:
|
|
explicit SkImageSource(SkImage*);
|
|
SkImageSource(SkImage*,
|
|
const SkRect& srcRect,
|
|
const SkRect& dstRect,
|
|
SkFilterQuality);
|
|
|
|
sk_sp<SkImage> fImage;
|
|
SkRect fSrcRect, fDstRect;
|
|
SkFilterQuality fFilterQuality;
|
|
|
|
typedef SkImageFilter INHERITED;
|
|
};
|
|
|
|
#endif
|