OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The Android Open Source Project | 2 * Copyright 2014 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkMatrixImageFilter.h" | 8 #include "SkMatrixImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
11 #include "SkDevice.h" | 11 #include "SkDevice.h" |
12 #include "SkColorPriv.h" | 12 #include "SkColorPriv.h" |
13 #include "SkReadBuffer.h" | 13 #include "SkReadBuffer.h" |
14 #include "SkWriteBuffer.h" | 14 #include "SkWriteBuffer.h" |
15 #include "SkMatrix.h" | 15 #include "SkMatrix.h" |
16 #include "SkRect.h" | 16 #include "SkRect.h" |
17 | 17 |
18 SkMatrixImageFilter::SkMatrixImageFilter(const SkMatrix& transform, | 18 SkMatrixImageFilter::SkMatrixImageFilter(const SkMatrix& transform, |
19 SkFilterQuality filterQuality, | 19 SkFilterQuality filterQuality, |
20 SkImageFilter* input) | 20 SkImageFilter* input) |
21 : INHERITED(1, &input), | 21 : INHERITED(1, &input), |
22 fTransform(transform), | 22 fTransform(transform), |
23 fFilterQuality(filterQuality) { | 23 fFilterQuality(filterQuality) { |
24 } | 24 } |
25 | 25 |
26 SkMatrixImageFilter* SkMatrixImageFilter::Create(const SkMatrix& transform, | 26 SkMatrixImageFilter* SkMatrixImageFilter::Create(const SkMatrix& transform, |
27 SkFilterQuality filterQuality, | 27 SkFilterQuality filterQuality, |
28 SkImageFilter* input) { | 28 SkImageFilter* input) { |
29 return SkNEW_ARGS(SkMatrixImageFilter, (transform, filterQuality, input)); | 29 return new SkMatrixImageFilter(transform, filterQuality, input); |
30 } | 30 } |
31 | 31 |
32 SkFlattenable* SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) { | 32 SkFlattenable* SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) { |
33 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); | 33 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); |
34 SkMatrix matrix; | 34 SkMatrix matrix; |
35 buffer.readMatrix(&matrix); | 35 buffer.readMatrix(&matrix); |
36 SkFilterQuality quality = static_cast<SkFilterQuality>(buffer.readInt()); | 36 SkFilterQuality quality = static_cast<SkFilterQuality>(buffer.readInt()); |
37 return Create(matrix, quality, common.getInput(0)); | 37 return Create(matrix, quality, common.getInput(0)); |
38 } | 38 } |
39 | 39 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 fTransform[SkMatrix::kMPersp2]); | 139 fTransform[SkMatrix::kMPersp2]); |
140 | 140 |
141 str->append("<dt>FilterLevel:</dt><dd>"); | 141 str->append("<dt>FilterLevel:</dt><dd>"); |
142 static const char* gFilterLevelStrings[] = { "None", "Low", "Medium", "High"
}; | 142 static const char* gFilterLevelStrings[] = { "None", "Low", "Medium", "High"
}; |
143 str->append(gFilterLevelStrings[fFilterQuality]); | 143 str->append(gFilterLevelStrings[fFilterQuality]); |
144 str->append("</dd>"); | 144 str->append("</dd>"); |
145 | 145 |
146 str->appendf(")"); | 146 str->appendf(")"); |
147 } | 147 } |
148 #endif | 148 #endif |
OLD | NEW |