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

Side by Side Diff: src/effects/SkMagnifierImageFilter.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 "SkMagnifierImageFilter.h" 8 #include "SkMagnifierImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 sk_sp<SkFlattenable> SkMagnifierImageFilter::CreateProc(SkReadBuffer& buffer) { 267 sk_sp<SkFlattenable> SkMagnifierImageFilter::CreateProc(SkReadBuffer& buffer) {
268 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); 268 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
269 SkRect src; 269 SkRect src;
270 buffer.readRect(&src); 270 buffer.readRect(&src);
271 return Make(src, buffer.readScalar(), common.getInput(0), &common.cropRect() ); 271 return Make(src, buffer.readScalar(), common.getInput(0), &common.cropRect() );
272 } 272 }
273 273
274 void SkMagnifierImageFilter::flatten(SkWriteBuffer& buffer) const { 274 void SkMagnifierImageFilter::flatten(SkWriteBuffer& buffer) const {
275 this->INHERITED::flatten(buffer); 275 this->INHERITED::flatten(buffer);
276 buffer.writeRect(fSrcRect); 276 buffer.writeRect("fSrcRect", fSrcRect);
277 buffer.writeScalar(fInset); 277 buffer.writeScalar("fInset", fInset);
278 } 278 }
279 279
280 sk_sp<SkSpecialImage> SkMagnifierImageFilter::onFilterImage(SkSpecialImage* sour ce, 280 sk_sp<SkSpecialImage> SkMagnifierImageFilter::onFilterImage(SkSpecialImage* sour ce,
281 const Context& ctx, 281 const Context& ctx,
282 SkIPoint* offset) co nst { 282 SkIPoint* offset) co nst {
283 SkIPoint inputOffset = SkIPoint::Make(0, 0); 283 SkIPoint inputOffset = SkIPoint::Make(0, 0);
284 sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset)) ; 284 sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset)) ;
285 if (!input) { 285 if (!input) {
286 return nullptr; 286 return nullptr;
287 } 287 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 414
415 #ifndef SK_IGNORE_TO_STRING 415 #ifndef SK_IGNORE_TO_STRING
416 void SkMagnifierImageFilter::toString(SkString* str) const { 416 void SkMagnifierImageFilter::toString(SkString* str) const {
417 str->appendf("SkMagnifierImageFilter: ("); 417 str->appendf("SkMagnifierImageFilter: (");
418 str->appendf("src: (%f,%f,%f,%f) ", 418 str->appendf("src: (%f,%f,%f,%f) ",
419 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto m); 419 fSrcRect.fLeft, fSrcRect.fTop, fSrcRect.fRight, fSrcRect.fBotto m);
420 str->appendf("inset: %f", fInset); 420 str->appendf("inset: %f", fInset);
421 str->append(")"); 421 str->append(")");
422 } 422 }
423 #endif 423 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698