blob: 0631a8b8c4417a3af1a8c9ee8db00ddba3212aaf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/*
* Copyright 2014 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkMatrixImageFilter_DEFINED
#define SkMatrixImageFilter_DEFINED
#include "SkImageFilter.h"
#include "SkScalar.h"
#include "SkSize.h"
#include "SkPoint.h"
#include "SkPaint.h"
/*! \class SkMatrixImageFilter
Matrix transformation image filter. This filter draws its source
input transformed by the given matrix.
*/
class SK_API SkMatrixImageFilter : public SkImageFilter {
public:
/** Construct a 2D transformation image filter.
* @param transform The matrix to apply when drawing the src bitmap
* @param filterLevel The quality of filtering to apply when scaling.
* @param input The input image filter. If nullptr, the src bitmap
* passed to filterImage() is used instead.
*/
static SkMatrixImageFilter* Create(const SkMatrix& transform,
SkFilterQuality,
SkImageFilter* input = nullptr);
virtual ~SkMatrixImageFilter();
SkRect computeFastBounds(const SkRect&) const override;
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMatrixImageFilter)
protected:
SkMatrixImageFilter(const SkMatrix& transform,
SkFilterQuality,
SkImageFilter* input);
void flatten(SkWriteBuffer&) const override;
bool onFilterImageDeprecated(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* loc) const override;
SkIRect onFilterNodeBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override;
private:
SkMatrix fTransform;
SkFilterQuality fFilterQuality;
typedef SkImageFilter INHERITED;
};
#endif
|