OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The Android Open Source Project | 2 * Copyright 2013 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 "SkPictureImageFilter.h" | 8 #include "SkPictureImageFilter.h" |
9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
11 #include "SkReadBuffer.h" | 11 #include "SkReadBuffer.h" |
12 #include "SkSurfaceProps.h" | 12 #include "SkSurfaceProps.h" |
13 #include "SkWriteBuffer.h" | 13 #include "SkWriteBuffer.h" |
14 #include "SkValidationUtils.h" | 14 #include "SkValidationUtils.h" |
15 | 15 |
16 SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture) | 16 SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture) |
17 : INHERITED(0, 0, nullptr) | 17 : INHERITED(nullptr, 0, nullptr) |
18 , fPicture(std::move(picture)) | 18 , fPicture(std::move(picture)) |
19 , fCropRect(fPicture ? fPicture->cullRect() : SkRect::MakeEmpty()) | 19 , fCropRect(fPicture ? fPicture->cullRect() : SkRect::MakeEmpty()) |
20 , fPictureResolution(kDeviceSpace_PictureResolution) | 20 , fPictureResolution(kDeviceSpace_PictureResolution) |
21 , fFilterQuality(kLow_SkFilterQuality) { | 21 , fFilterQuality(kLow_SkFilterQuality) { |
22 } | 22 } |
23 | 23 |
24 SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture, const SkRec
t& cropRect, | 24 SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture, const SkRec
t& cropRect, |
25 PictureResolution pictureResolution, | 25 PictureResolution pictureResolution, |
26 SkFilterQuality filterQuality) | 26 SkFilterQuality filterQuality) |
27 : INHERITED(0, 0, nullptr) | 27 : INHERITED(nullptr, 0, nullptr) |
28 , fPicture(std::move(picture)) | 28 , fPicture(std::move(picture)) |
29 , fCropRect(cropRect) | 29 , fCropRect(cropRect) |
30 , fPictureResolution(pictureResolution) | 30 , fPictureResolution(pictureResolution) |
31 , fFilterQuality(filterQuality) { | 31 , fFilterQuality(filterQuality) { |
32 } | 32 } |
33 | 33 |
34 SkFlattenable* SkPictureImageFilter::CreateProc(SkReadBuffer& buffer) { | 34 SkFlattenable* SkPictureImageFilter::CreateProc(SkReadBuffer& buffer) { |
35 sk_sp<SkPicture> picture; | 35 sk_sp<SkPicture> picture; |
36 SkRect cropRect; | 36 SkRect cropRect; |
37 | 37 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 str->appendf("crop: (%f,%f,%f,%f) ", | 164 str->appendf("crop: (%f,%f,%f,%f) ", |
165 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB
ottom); | 165 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB
ottom); |
166 if (fPicture) { | 166 if (fPicture) { |
167 str->appendf("picture: (%f,%f,%f,%f)", | 167 str->appendf("picture: (%f,%f,%f,%f)", |
168 fPicture->cullRect().fLeft, fPicture->cullRect().fTop, | 168 fPicture->cullRect().fLeft, fPicture->cullRect().fTop, |
169 fPicture->cullRect().fRight, fPicture->cullRect().fBottom); | 169 fPicture->cullRect().fRight, fPicture->cullRect().fBottom); |
170 } | 170 } |
171 str->append(")"); | 171 str->append(")"); |
172 } | 172 } |
173 #endif | 173 #endif |
OLD | NEW |