Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: src/effects/SkPictureImageFilter.cpp

Issue 1893973002: Outline SkImageFilter Make methods (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkPaintImageFilter.cpp ('k') | src/effects/SkTestImageFilters.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkReadBuffer.h" 11 #include "SkReadBuffer.h"
12 #include "SkSpecialImage.h" 12 #include "SkSpecialImage.h"
13 #include "SkSpecialSurface.h" 13 #include "SkSpecialSurface.h"
14 #include "SkWriteBuffer.h" 14 #include "SkWriteBuffer.h"
15 #include "SkValidationUtils.h" 15 #include "SkValidationUtils.h"
16 16
17 sk_sp<SkImageFilter> SkPictureImageFilter::Make(sk_sp<SkPicture> picture) {
18 return sk_sp<SkImageFilter>(new SkPictureImageFilter(std::move(picture)));
19 }
20
21 sk_sp<SkImageFilter> SkPictureImageFilter::Make(sk_sp<SkPicture> picture,
22 const SkRect& cropRect) {
23 return sk_sp<SkImageFilter>(new SkPictureImageFilter(std::move(picture),
24 cropRect,
25 kDeviceSpace_PictureRes olution,
26 kLow_SkFilterQuality));
27 }
28
29 sk_sp<SkImageFilter> SkPictureImageFilter::MakeForLocalSpace(sk_sp<SkPicture> pi cture,
30 const SkRect& cropR ect,
31 SkFilterQuality fil terQuality) {
32 return sk_sp<SkImageFilter>(new SkPictureImageFilter(std::move(picture),
33 cropRect,
34 kLocalSpace_PictureReso lution,
35 filterQuality));
36 }
37
17 SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture) 38 SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture)
18 : INHERITED(nullptr, 0, nullptr) 39 : INHERITED(nullptr, 0, nullptr)
19 , fPicture(std::move(picture)) 40 , fPicture(std::move(picture))
20 , fCropRect(fPicture ? fPicture->cullRect() : SkRect::MakeEmpty()) 41 , fCropRect(fPicture ? fPicture->cullRect() : SkRect::MakeEmpty())
21 , fPictureResolution(kDeviceSpace_PictureResolution) 42 , fPictureResolution(kDeviceSpace_PictureResolution)
22 , fFilterQuality(kLow_SkFilterQuality) { 43 , fFilterQuality(kLow_SkFilterQuality) {
23 } 44 }
24 45
25 SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture, const SkRec t& cropRect, 46 SkPictureImageFilter::SkPictureImageFilter(sk_sp<SkPicture> picture, const SkRec t& cropRect,
26 PictureResolution pictureResolution, 47 PictureResolution pictureResolution,
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 str->appendf("crop: (%f,%f,%f,%f) ", 205 str->appendf("crop: (%f,%f,%f,%f) ",
185 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB ottom); 206 fCropRect.fLeft, fCropRect.fTop, fCropRect.fRight, fCropRect.fB ottom);
186 if (fPicture) { 207 if (fPicture) {
187 str->appendf("picture: (%f,%f,%f,%f)", 208 str->appendf("picture: (%f,%f,%f,%f)",
188 fPicture->cullRect().fLeft, fPicture->cullRect().fTop, 209 fPicture->cullRect().fLeft, fPicture->cullRect().fTop,
189 fPicture->cullRect().fRight, fPicture->cullRect().fBottom); 210 fPicture->cullRect().fRight, fPicture->cullRect().fBottom);
190 } 211 }
191 str->append(")"); 212 str->append(")");
192 } 213 }
193 #endif 214 #endif
OLDNEW
« no previous file with comments | « src/effects/SkPaintImageFilter.cpp ('k') | src/effects/SkTestImageFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698