Chromium Code Reviews| Index: include/effects/SkImageSource.h |
| diff --git a/include/effects/SkImageSource.h b/include/effects/SkImageSource.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5c87cbca9f4b261d985b24127c58048c78fc48e4 |
| --- /dev/null |
| +++ b/include/effects/SkImageSource.h |
| @@ -0,0 +1,48 @@ |
| +/* |
| + * 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 SkImageSource* Create(const SkImage*); |
|
reed1
2015/09/14 20:08:48
Can these just return SkImageFilter* ?
f(malita)
2015/09/14 20:12:50
Done.
|
| + static SkImageSource* Create(const SkImage*, |
| + const SkRect& srcRect, |
| + const SkRect& dstRect, |
| + SkFilterQuality); |
| + |
| + void computeFastBounds(const SkRect& src, SkRect* dst) const override; |
| + |
| + SK_TO_STRING_OVERRIDE() |
| + SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkImageSource) |
| + |
| +protected: |
| + void flatten(SkWriteBuffer&) const override; |
| + |
| + bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, |
| + SkBitmap* result, SkIPoint* offset) const override; |
| + |
| +private: |
| + explicit SkImageSource(const SkImage*); |
| + SkImageSource(const SkImage*, |
| + const SkRect& srcRect, |
| + const SkRect& dstRect, |
| + SkFilterQuality); |
| + |
| + SkAutoTUnref<const SkImage> fImage; |
| + SkRect fSrcRect, fDstRect; |
| + SkFilterQuality fFilterQuality; |
| + |
| + typedef SkImageFilter INHERITED; |
| +}; |
| + |
| +#endif |