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

Side by Side Diff: src/effects/SkXfermodeImageFilter.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 2013 The Android Open Source Project 2 * Copyright 2013 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 "SkXfermodeImageFilter.h" 8 #include "SkXfermodeImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 sk_sp<SkFlattenable> SkXfermodeImageFilter::CreateProc(SkReadBuffer& buffer) { 43 sk_sp<SkFlattenable> SkXfermodeImageFilter::CreateProc(SkReadBuffer& buffer) {
44 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 2); 44 SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 2);
45 sk_sp<SkXfermode> mode(buffer.readXfermode()); 45 sk_sp<SkXfermode> mode(buffer.readXfermode());
46 return Make(std::move(mode), common.getInput(0), common.getInput(1), &common .cropRect()); 46 return Make(std::move(mode), common.getInput(0), common.getInput(1), &common .cropRect());
47 } 47 }
48 48
49 void SkXfermodeImageFilter::flatten(SkWriteBuffer& buffer) const { 49 void SkXfermodeImageFilter::flatten(SkWriteBuffer& buffer) const {
50 this->INHERITED::flatten(buffer); 50 this->INHERITED::flatten(buffer);
51 buffer.writeFlattenable(fMode.get()); 51 buffer.writeFlattenable("fMode", fMode.get());
52 } 52 }
53 53
54 sk_sp<SkSpecialImage> SkXfermodeImageFilter::onFilterImage(SkSpecialImage* sourc e, 54 sk_sp<SkSpecialImage> SkXfermodeImageFilter::onFilterImage(SkSpecialImage* sourc e,
55 const Context& ctx, 55 const Context& ctx,
56 SkIPoint* offset) con st { 56 SkIPoint* offset) con st {
57 SkIPoint backgroundOffset = SkIPoint::Make(0, 0); 57 SkIPoint backgroundOffset = SkIPoint::Make(0, 0);
58 sk_sp<SkSpecialImage> background(this->filterInput(0, source, ctx, &backgrou ndOffset)); 58 sk_sp<SkSpecialImage> background(this->filterInput(0, source, ctx, &backgrou ndOffset));
59 59
60 SkIPoint foregroundOffset = SkIPoint::Make(0, 0); 60 SkIPoint foregroundOffset = SkIPoint::Make(0, 0);
61 sk_sp<SkSpecialImage> foreground(this->filterInput(1, source, ctx, &foregrou ndOffset)); 61 sk_sp<SkSpecialImage> foreground(this->filterInput(1, source, ctx, &foregrou ndOffset));
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 SkMatrix matrix; 256 SkMatrix matrix;
257 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top ())); 257 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top ()));
258 drawContext->drawRect(GrClip::WideOpen(), paint, matrix, SkRect::Make(bounds )); 258 drawContext->drawRect(GrClip::WideOpen(), paint, matrix, SkRect::Make(bounds ));
259 259
260 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he ight()), 260 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he ight()),
261 kNeedNewImageUniqueID_SpecialImage, 261 kNeedNewImageUniqueID_SpecialImage,
262 dst.get()); 262 dst.get());
263 } 263 }
264 264
265 #endif 265 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698