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

Side by Side Diff: src/effects/SkPaintImageFilter.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/SkOffsetImageFilter.cpp ('k') | src/effects/SkPictureImageFilter.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 2016 Google Inc. 2 * Copyright 2016 Google Inc.
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 "SkPaintImageFilter.h" 8 #include "SkPaintImageFilter.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkReadBuffer.h" 10 #include "SkReadBuffer.h"
11 #include "SkSpecialImage.h" 11 #include "SkSpecialImage.h"
12 #include "SkSpecialSurface.h" 12 #include "SkSpecialSurface.h"
13 #include "SkWriteBuffer.h" 13 #include "SkWriteBuffer.h"
14 14
15 sk_sp<SkImageFilter> SkPaintImageFilter::Make(const SkPaint& paint,
16 const CropRect* cropRect) {
17 return sk_sp<SkImageFilter>(new SkPaintImageFilter(paint, cropRect));
18 }
19
15 SkPaintImageFilter::SkPaintImageFilter(const SkPaint& paint, const CropRect* cro pRect) 20 SkPaintImageFilter::SkPaintImageFilter(const SkPaint& paint, const CropRect* cro pRect)
16 : INHERITED(nullptr, 0, cropRect) 21 : INHERITED(nullptr, 0, cropRect)
17 , fPaint(paint) { 22 , fPaint(paint) {
18 } 23 }
19 24
20 sk_sp<SkFlattenable> SkPaintImageFilter::CreateProc(SkReadBuffer& buffer) { 25 sk_sp<SkFlattenable> SkPaintImageFilter::CreateProc(SkReadBuffer& buffer) {
21 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); 26 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0);
22 SkPaint paint; 27 SkPaint paint;
23 buffer.readPaint(&paint); 28 buffer.readPaint(&paint);
24 return SkPaintImageFilter::Make(paint, &common.cropRect()); 29 return SkPaintImageFilter::Make(paint, &common.cropRect());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return true; 75 return true;
71 } 76 }
72 77
73 #ifndef SK_IGNORE_TO_STRING 78 #ifndef SK_IGNORE_TO_STRING
74 void SkPaintImageFilter::toString(SkString* str) const { 79 void SkPaintImageFilter::toString(SkString* str) const {
75 str->appendf("SkPaintImageFilter: ("); 80 str->appendf("SkPaintImageFilter: (");
76 fPaint.toString(str); 81 fPaint.toString(str);
77 str->append(")"); 82 str->append(")");
78 } 83 }
79 #endif 84 #endif
OLDNEW
« no previous file with comments | « src/effects/SkOffsetImageFilter.cpp ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698