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

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

Issue 1911963008: DNC - JSON of flattenables, with field names. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add names to call sites 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
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 sk_sp<SkFlattenable> SkBlurImageFilter::CreateProc(SkReadBuffer& buffer) { 55 sk_sp<SkFlattenable> SkBlurImageFilter::CreateProc(SkReadBuffer& buffer) {
56 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 56 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
57 SkScalar sigmaX = buffer.readScalar(); 57 SkScalar sigmaX = buffer.readScalar();
58 SkScalar sigmaY = buffer.readScalar(); 58 SkScalar sigmaY = buffer.readScalar();
59 return Make(sigmaX, sigmaY, common.getInput(0), &common.cropRect()); 59 return Make(sigmaX, sigmaY, common.getInput(0), &common.cropRect());
60 } 60 }
61 61
62 void SkBlurImageFilter::flatten(SkWriteBuffer& buffer) const { 62 void SkBlurImageFilter::flatten(SkWriteBuffer& buffer) const {
63 this->INHERITED::flatten(buffer); 63 this->INHERITED::flatten(buffer);
64 buffer.writeScalar(fSigma.fWidth); 64 buffer.writeScalar("fSigmaWidth", fSigma.fWidth);
65 buffer.writeScalar(fSigma.fHeight); 65 buffer.writeScalar("fSigmaHeight", fSigma.fHeight);
66 } 66 }
67 67
68 static void get_box3_params(SkScalar s, int *kernelSize, int* kernelSize3, int * lowOffset, 68 static void get_box3_params(SkScalar s, int *kernelSize, int* kernelSize3, int * lowOffset,
69 int *highOffset) { 69 int *highOffset) {
70 float pi = SkScalarToFloat(SK_ScalarPI); 70 float pi = SkScalarToFloat(SK_ScalarPI);
71 int d = static_cast<int>(floorf(SkScalarToFloat(s) * 3.0f * sqrtf(2.0f * pi) / 4.0f + 0.5f)); 71 int d = static_cast<int>(floorf(SkScalarToFloat(s) * 3.0f * sqrtf(2.0f * pi) / 4.0f + 0.5f));
72 *kernelSize = d; 72 *kernelSize = d;
73 if (d % 2 == 1) { 73 if (d % 2 == 1) {
74 *lowOffset = *highOffset = (d - 1) / 2; 74 *lowOffset = *highOffset = (d - 1) / 2;
75 *kernelSize3 = d; 75 *kernelSize3 = d;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 str->appendf("SkBlurImageFilter: ("); 249 str->appendf("SkBlurImageFilter: (");
250 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); 250 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight);
251 251
252 if (this->getInput(0)) { 252 if (this->getInput(0)) {
253 this->getInput(0)->toString(str); 253 this->getInput(0)->toString(str);
254 } 254 }
255 255
256 str->append("))"); 256 str->append("))");
257 } 257 }
258 #endif 258 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698