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

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

Issue 1855733002: change flattenable factory to return sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkBlurDrawLooper.cpp ('k') | src/effects/SkBlurMaskFilter.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 2011 The Android Open Source Project 2 * Copyright 2011 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 "SkBlurImageFilter.h" 8 #include "SkBlurImageFilter.h"
9 9
10 #include "SkAutoPixmapStorage.h" 10 #include "SkAutoPixmapStorage.h"
(...skipping 24 matching lines...) Expand all
35 return sigma; 35 return sigma;
36 } 36 }
37 37
38 SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX, 38 SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX,
39 SkScalar sigmaY, 39 SkScalar sigmaY,
40 SkImageFilter* input, 40 SkImageFilter* input,
41 const CropRect* cropRect) 41 const CropRect* cropRect)
42 : INHERITED(1, &input, cropRect), fSigma(SkSize::Make(sigmaX, sigmaY)) { 42 : INHERITED(1, &input, cropRect), fSigma(SkSize::Make(sigmaX, sigmaY)) {
43 } 43 }
44 44
45 SkFlattenable* SkBlurImageFilter::CreateProc(SkReadBuffer& buffer) { 45 sk_sp<SkFlattenable> SkBlurImageFilter::CreateProc(SkReadBuffer& buffer) {
46 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 46 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
47 SkScalar sigmaX = buffer.readScalar(); 47 SkScalar sigmaX = buffer.readScalar();
48 SkScalar sigmaY = buffer.readScalar(); 48 SkScalar sigmaY = buffer.readScalar();
49 return Create(sigmaX, sigmaY, common.getInput(0).get(), &common.cropRect()); 49 return sk_sp<SkFlattenable>(Create(sigmaX, sigmaY, common.getInput(0).get(),
50 &common.cropRect()));
50 } 51 }
51 52
52 void SkBlurImageFilter::flatten(SkWriteBuffer& buffer) const { 53 void SkBlurImageFilter::flatten(SkWriteBuffer& buffer) const {
53 this->INHERITED::flatten(buffer); 54 this->INHERITED::flatten(buffer);
54 buffer.writeScalar(fSigma.fWidth); 55 buffer.writeScalar(fSigma.fWidth);
55 buffer.writeScalar(fSigma.fHeight); 56 buffer.writeScalar(fSigma.fHeight);
56 } 57 }
57 58
58 static void get_box3_params(SkScalar s, int *kernelSize, int* kernelSize3, int * lowOffset, 59 static void get_box3_params(SkScalar s, int *kernelSize, int* kernelSize3, int * lowOffset,
59 int *highOffset) { 60 int *highOffset) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 str->appendf("SkBlurImageFilter: ("); 239 str->appendf("SkBlurImageFilter: (");
239 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); 240 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight);
240 241
241 if (this->getInput(0)) { 242 if (this->getInput(0)) {
242 this->getInput(0)->toString(str); 243 this->getInput(0)->toString(str);
243 } 244 }
244 245
245 str->append("))"); 246 str->append("))");
246 } 247 }
247 #endif 248 #endif
OLDNEW
« no previous file with comments | « src/effects/SkBlurDrawLooper.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698