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

Side by Side Diff: src/effects/SkPaintImageFilter.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 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"
(...skipping 13 matching lines...) Expand all
24 24
25 sk_sp<SkFlattenable> SkPaintImageFilter::CreateProc(SkReadBuffer& buffer) { 25 sk_sp<SkFlattenable> SkPaintImageFilter::CreateProc(SkReadBuffer& buffer) {
26 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); 26 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0);
27 SkPaint paint; 27 SkPaint paint;
28 buffer.readPaint(&paint); 28 buffer.readPaint(&paint);
29 return SkPaintImageFilter::Make(paint, &common.cropRect()); 29 return SkPaintImageFilter::Make(paint, &common.cropRect());
30 } 30 }
31 31
32 void SkPaintImageFilter::flatten(SkWriteBuffer& buffer) const { 32 void SkPaintImageFilter::flatten(SkWriteBuffer& buffer) const {
33 this->INHERITED::flatten(buffer); 33 this->INHERITED::flatten(buffer);
34 buffer.writePaint(fPaint); 34 buffer.writePaint("fPaint", fPaint);
35 } 35 }
36 36
37 sk_sp<SkSpecialImage> SkPaintImageFilter::onFilterImage(SkSpecialImage* source, 37 sk_sp<SkSpecialImage> SkPaintImageFilter::onFilterImage(SkSpecialImage* source,
38 const Context& ctx, 38 const Context& ctx,
39 SkIPoint* offset) const { 39 SkIPoint* offset) const {
40 SkIRect bounds; 40 SkIRect bounds;
41 const SkIRect srcBounds = SkIRect::MakeWH(source->width(), source->height()) ; 41 const SkIRect srcBounds = SkIRect::MakeWH(source->width(), source->height()) ;
42 if (!this->applyCropRect(ctx, srcBounds, &bounds)) { 42 if (!this->applyCropRect(ctx, srcBounds, &bounds)) {
43 return nullptr; 43 return nullptr;
44 } 44 }
(...skipping 30 matching lines...) Expand all
75 return true; 75 return true;
76 } 76 }
77 77
78 #ifndef SK_IGNORE_TO_STRING 78 #ifndef SK_IGNORE_TO_STRING
79 void SkPaintImageFilter::toString(SkString* str) const { 79 void SkPaintImageFilter::toString(SkString* str) const {
80 str->appendf("SkPaintImageFilter: ("); 80 str->appendf("SkPaintImageFilter: (");
81 fPaint.toString(str); 81 fPaint.toString(str);
82 str->append(")"); 82 str->append(")");
83 } 83 }
84 #endif 84 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698