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

Side by Side Diff: src/effects/SkOffsetImageFilter.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 2012 The Android Open Source Project 2 * Copyright 2012 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 "SkOffsetImageFilter.h" 8 #include "SkOffsetImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 sk_sp<SkFlattenable> SkOffsetImageFilter::CreateProc(SkReadBuffer& buffer) { 95 sk_sp<SkFlattenable> SkOffsetImageFilter::CreateProc(SkReadBuffer& buffer) {
96 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 96 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
97 SkPoint offset; 97 SkPoint offset;
98 buffer.readPoint(&offset); 98 buffer.readPoint(&offset);
99 return Make(offset.x(), offset.y(), common.getInput(0), &common.cropRect()); 99 return Make(offset.x(), offset.y(), common.getInput(0), &common.cropRect());
100 } 100 }
101 101
102 void SkOffsetImageFilter::flatten(SkWriteBuffer& buffer) const { 102 void SkOffsetImageFilter::flatten(SkWriteBuffer& buffer) const {
103 this->INHERITED::flatten(buffer); 103 this->INHERITED::flatten(buffer);
104 buffer.writePoint(fOffset); 104 buffer.writePoint("fOffset", fOffset);
105 } 105 }
106 106
107 SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy, 107 SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy,
108 sk_sp<SkImageFilter> input, 108 sk_sp<SkImageFilter> input,
109 const CropRect* cropRect) 109 const CropRect* cropRect)
110 : INHERITED(&input, 1, cropRect) { 110 : INHERITED(&input, 1, cropRect) {
111 fOffset.set(dx, dy); 111 fOffset.set(dx, dy);
112 } 112 }
113 113
114 #ifndef SK_IGNORE_TO_STRING 114 #ifndef SK_IGNORE_TO_STRING
115 void SkOffsetImageFilter::toString(SkString* str) const { 115 void SkOffsetImageFilter::toString(SkString* str) const {
116 str->appendf("SkOffsetImageFilter: ("); 116 str->appendf("SkOffsetImageFilter: (");
117 str->appendf("offset: (%f, %f) ", fOffset.fX, fOffset.fY); 117 str->appendf("offset: (%f, %f) ", fOffset.fX, fOffset.fY);
118 str->append("input: ("); 118 str->append("input: (");
119 if (this->getInput(0)) { 119 if (this->getInput(0)) {
120 this->getInput(0)->toString(str); 120 this->getInput(0)->toString(str);
121 } 121 }
122 str->append("))"); 122 str->append("))");
123 } 123 }
124 #endif 124 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698